scons: Build NIR.
[mesa.git] / src / compiler / SConscript.nir
1 import common
2
3 Import('*')
4
5 from sys import executable as python_cmd
6
7 env = env.Clone()
8
9 env.MSVC2013Compat()
10
11 env.Prepend(CPPPATH = [
12 '#include',
13 '#src',
14 '#src/mapi',
15 '#src/mesa',
16 '#src/gallium/include',
17 '#src/gallium/auxiliary',
18 '#src/compiler/nir',
19 ])
20
21 # Make generated headers reachable from the include path.
22 env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
23
24 # nir generated sources
25
26 nir_builder_opcodes_h = env.CodeGenerate(
27 target = 'nir/nir_builder_opcodes.h',
28 script = 'nir/nir_builder_opcodes_h.py',
29 source = [],
30 command = python_cmd + ' $SCRIPT > $TARGET'
31 )
32
33 env.CodeGenerate(
34 target = 'nir/nir_constant_expressions.c',
35 script = 'nir/nir_constant_expressions.py',
36 source = [],
37 command = python_cmd + ' $SCRIPT > $TARGET'
38 )
39
40 env.CodeGenerate(
41 target = 'nir/nir_opcodes.h',
42 script = 'nir/nir_opcodes_h.py',
43 source = [],
44 command = python_cmd + ' $SCRIPT > $TARGET'
45 )
46
47 env.CodeGenerate(
48 target = 'nir/nir_opcodes.c',
49 script = 'nir/nir_opcodes_c.py',
50 source = [],
51 command = python_cmd + ' $SCRIPT > $TARGET'
52 )
53
54 env.CodeGenerate(
55 target = 'nir/nir_opt_algebraic.c',
56 script = 'nir/nir_opt_algebraic.py',
57 source = [],
58 command = python_cmd + ' $SCRIPT > $TARGET'
59 )
60
61 # parse Makefile.sources
62 source_lists = env.ParseSourceList('Makefile.sources')
63
64 nir_sources = source_lists['NIR_FILES']
65 nir_sources += source_lists['NIR_GENERATED_FILES']
66
67 nir = env.ConvenienceLibrary(
68 target = 'nir',
69 source = nir_sources,
70 )
71
72 env.Alias('nir', nir)
73 Export('nir')