blob: 51cc0d403fdbe32359132449cce5e49f5eb4e62d [file] [log] [blame]
Jose Fonsecaffcc00c2016-04-13 18:19:52 +01001import common
2
3Import('*')
4
5from sys import executable as python_cmd
6
7env = env.Clone()
8
9env.MSVC2013Compat()
10
11env.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.
22env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
23
24# nir generated sources
25
26nir_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
33env.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
40env.CodeGenerate(
41 target = 'nir/nir_opcodes.h',
42 script = 'nir/nir_opcodes_h.py',
43 source = [],
44 command = python_cmd + ' $SCRIPT > $TARGET'
45)
46
47env.CodeGenerate(
48 target = 'nir/nir_opcodes.c',
49 script = 'nir/nir_opcodes_c.py',
50 source = [],
51 command = python_cmd + ' $SCRIPT > $TARGET'
52)
53
54env.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
62source_lists = env.ParseSourceList('Makefile.sources')
63
64nir_sources = source_lists['NIR_FILES']
65nir_sources += source_lists['NIR_GENERATED_FILES']
66
67nir = env.ConvenienceLibrary(
68 target = 'nir',
69 source = nir_sources,
70)
71
72env.Alias('nir', nir)
73Export('nir')