• 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    '#src/compiler/spirv',
20])
21
22# Make generated headers reachable from the include path.
23env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
24env.Prepend(CPPPATH = [Dir('.').abspath, Dir('spirv').abspath])
25
26# spirv generated sources
27
28env.CodeGenerate(
29    target = 'spirv/spirv_info.c',
30    script = 'spirv/spirv_info_c.py',
31    source = ['spirv/spirv.core.grammar.json'],
32    command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
33)
34
35env.CodeGenerate(
36    target = 'spirv/vtn_gather_types.c',
37    script = 'spirv/vtn_gather_types_c.py',
38    source = ['spirv/spirv.core.grammar.json'],
39    command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
40)
41
42env.CodeGenerate(
43    target = 'spirv/vtn_generator_ids.h',
44    script = 'spirv/vtn_generator_ids_h.py',
45    source = ['spirv/spir-v.xml'],
46    command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
47)
48
49# parse Makefile.sources
50source_lists = env.ParseSourceList('Makefile.sources')
51
52spirv_sources = source_lists['SPIRV_FILES']
53spirv_sources += source_lists['SPIRV_GENERATED_FILES']
54
55spirv = env.ConvenienceLibrary(
56    target = 'spirv',
57    source = spirv_sources,
58)
59
60env.Alias('spirv', spirv)
61Export('spirv')
62