• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import 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('glsl').abspath])
23env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
24
25# nir generated sources
26
27nir_builder_opcodes_h = env.CodeGenerate(
28    target = 'nir/nir_builder_opcodes.h',
29    script = 'nir/nir_builder_opcodes_h.py',
30    source = [],
31    command = python_cmd + ' $SCRIPT > $TARGET'
32)
33
34env.CodeGenerate(
35    target = 'nir/nir_constant_expressions.c',
36    script = 'nir/nir_constant_expressions.py',
37    source = [],
38    command = python_cmd + ' $SCRIPT > $TARGET'
39)
40
41env.CodeGenerate(
42    target = 'nir/nir_opcodes.h',
43    script = 'nir/nir_opcodes_h.py',
44    source = [],
45    command = python_cmd + ' $SCRIPT > $TARGET'
46)
47
48env.CodeGenerate(
49    target = 'nir/nir_opcodes.c',
50    script = 'nir/nir_opcodes_c.py',
51    source = [],
52    command = python_cmd + ' $SCRIPT > $TARGET'
53)
54
55env.CodeGenerate(
56    target = 'nir/nir_opt_algebraic.c',
57    script = 'nir/nir_opt_algebraic.py',
58    source = [],
59    command = python_cmd + ' $SCRIPT > $TARGET'
60)
61
62bldroot = Dir('.').abspath
63
64env.CodeGenerate(
65    target = 'nir/nir_intrinsics.h',
66    script = 'nir/nir_intrinsics_h.py',
67    source = [],
68    command = python_cmd + ' $SCRIPT --outdir ' + bldroot + '/nir'
69)
70
71env.CodeGenerate(
72    target = 'nir/nir_intrinsics.c',
73    script = 'nir/nir_intrinsics_c.py',
74    source = [],
75    command = python_cmd + ' $SCRIPT --outdir ' + bldroot + '/nir'
76)
77
78# parse Makefile.sources
79source_lists = env.ParseSourceList('Makefile.sources')
80
81nir_sources = source_lists['NIR_FILES']
82nir_sources += source_lists['NIR_GENERATED_FILES']
83
84nir = env.ConvenienceLibrary(
85    target = 'nir',
86    source = nir_sources,
87)
88
89env.Alias('nir', nir)
90Export('nir')
91