summaryrefslogtreecommitdiffstats
path: root/src/compiler/SConscript.spirv
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2018-03-30 09:12:00 -0600
committerBrian Paul <[email protected]>2018-03-30 14:33:03 -0600
commit31d91f019b58ca362c05db1fd0c75fedd169cd7b (patch)
treef2339281d532a806827960cffa8158837639929f /src/compiler/SConscript.spirv
parentcdc34e2cea73b7932e51ad407595d487d2d565c3 (diff)
spirv: Fix building with SCons
The SCons build broke with commit ba975140d3c9 because a SPIR-V function is called from Mesa main. This adds a convenience library for SPIR-V and adds it to everything that was including nir. It also adds both nir and spirv to drivers/x11/SConscript. Also add nir/spirv modules to osmesa and libgl-gdi targets. (Brian Paul) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105817 Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/compiler/SConscript.spirv')
-rw-r--r--src/compiler/SConscript.spirv54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/compiler/SConscript.spirv b/src/compiler/SConscript.spirv
new file mode 100644
index 00000000000..49410881d0b
--- /dev/null
+++ b/src/compiler/SConscript.spirv
@@ -0,0 +1,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')