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
|
import common
Import('*')
from sys import executable as python_cmd
env = env.Clone()
env.MSVC2013Compat()
env.Prepend(CPPPATH = [
'#include',
'#src',
'#src/mapi',
'#src/mesa',
'#src/gallium/include',
'#src/gallium/auxiliary',
'#src/compiler/nir',
'#src/compiler/spirv',
])
# Make generated headers reachable from the include path.
env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
env.Prepend(CPPPATH = [Dir('.').abspath, Dir('spirv').abspath])
# spirv generated sources
env.CodeGenerate(
target = 'spirv/spirv_info.c',
script = 'spirv/spirv_info_c.py',
source = ['spirv/spirv.core.grammar.json'],
command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
)
env.CodeGenerate(
target = 'spirv/vtn_gather_types.c',
script = 'spirv/vtn_gather_types_c.py',
source = ['spirv/spirv.core.grammar.json'],
command = python_cmd + ' $SCRIPT $SOURCE $TARGET'
)
# parse Makefile.sources
source_lists = env.ParseSourceList('Makefile.sources')
spirv_sources = source_lists['SPIRV_FILES']
spirv_sources += source_lists['SPIRV_GENERATED_FILES']
spirv = env.ConvenienceLibrary(
target = 'spirv',
source = spirv_sources,
)
env.Alias('spirv', spirv)
Export('spirv')
|