summaryrefslogtreecommitdiffstats
path: root/src/compiler/SConscript.nir
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-04-13 18:19:52 +0100
committerEmil Velikov <[email protected]>2016-04-14 16:38:59 +0100
commitffcc00ce309e5b4d279d24b2a85d23904d721a9a (patch)
tree5ce624a840603995b3eb5a482cdd19bf3ee04805 /src/compiler/SConscript.nir
parentfeb6732e8055f17008077c7505f4cd343380116d (diff)
scons: Build NIR.
Emil Velikov: - Attribute the src/{glsl,compiler}/nir move - Flesh out to separate SConscript Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/compiler/SConscript.nir')
-rw-r--r--src/compiler/SConscript.nir73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/compiler/SConscript.nir b/src/compiler/SConscript.nir
new file mode 100644
index 00000000000..51cc0d403fd
--- /dev/null
+++ b/src/compiler/SConscript.nir
@@ -0,0 +1,73 @@
+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',
+])
+
+# Make generated headers reachable from the include path.
+env.Prepend(CPPPATH = [Dir('.').abspath, Dir('nir').abspath])
+
+# nir generated sources
+
+nir_builder_opcodes_h = env.CodeGenerate(
+ target = 'nir/nir_builder_opcodes.h',
+ script = 'nir/nir_builder_opcodes_h.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT > $TARGET'
+)
+
+env.CodeGenerate(
+ target = 'nir/nir_constant_expressions.c',
+ script = 'nir/nir_constant_expressions.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT > $TARGET'
+)
+
+env.CodeGenerate(
+ target = 'nir/nir_opcodes.h',
+ script = 'nir/nir_opcodes_h.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT > $TARGET'
+)
+
+env.CodeGenerate(
+ target = 'nir/nir_opcodes.c',
+ script = 'nir/nir_opcodes_c.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT > $TARGET'
+)
+
+env.CodeGenerate(
+ target = 'nir/nir_opt_algebraic.c',
+ script = 'nir/nir_opt_algebraic.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT > $TARGET'
+)
+
+# parse Makefile.sources
+source_lists = env.ParseSourceList('Makefile.sources')
+
+nir_sources = source_lists['NIR_FILES']
+nir_sources += source_lists['NIR_GENERATED_FILES']
+
+nir = env.ConvenienceLibrary(
+ target = 'nir',
+ source = nir_sources,
+)
+
+env.Alias('nir', nir)
+Export('nir')