summaryrefslogtreecommitdiff
path: root/src/util/SConscript
blob: bd8fb17274567e09d61d73580774ae72ec1ee8fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import common

Import('*')

from sys import executable as python_cmd

env = env.Clone()

env.MSVC2008Compat()

env.Prepend(CPPPATH = [
    '#include',
    '#src',
    '#src/mapi',
    '#src/mesa',
    '#src/gallium/include',
    '#src/gallium/auxiliary',
    '#src/util',
])

env.CodeGenerate(
    target = 'format_srgb.c',
    script = 'format_srgb.py',
    source = [],
    command = python_cmd + ' $SCRIPT > $TARGET'
)

# parse Makefile.sources
source_lists = env.ParseSourceList('Makefile.sources')

mesautil_sources = (
    source_lists['MESA_UTIL_FILES'] +
    source_lists['MESA_UTIL_GENERATED_FILES']
)

mesautil = env.ConvenienceLibrary(
    target = 'mesautil',
    source = mesautil_sources,
)

env.Alias('mesautil', mesautil)
Export('mesautil')


# http://www.scons.org/wiki/UnitTests
u_atomic_test = env.Program(
    target = 'u_atomic_test',
    source = ['u_atomic_test.c'],
)
alias = env.Alias("u_atomic_test", u_atomic_test, u_atomic_test[0].abspath)
AlwaysBuild(alias)

roundeven_test = env.Program(
    target = 'roundeven_test',
    source = ['roundeven_test.c'],
)
alias = env.Alias("roundeven_test", roundeven_test, roundeven_test[0].abspath)
AlwaysBuild(alias)