summaryrefslogtreecommitdiffstats
path: root/src/compiler/SConscript.glsl
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-08-31 12:16:32 +0100
committerJose Fonseca <[email protected]>2016-08-31 12:18:34 +0100
commit55e417222f774b2a714313391c8f90982e7a7b4f (patch)
treed7a41520ed39c18980ed03a6f0ff932790015ca3 /src/compiler/SConscript.glsl
parent8caf2cb0c06fe0a1dddff3aed56392f376fda424 (diff)
scons: Fix MinGW cross compilation.
The generated GLSL header files were only being built for the host platform, and not the target platform. Trivial.
Diffstat (limited to 'src/compiler/SConscript.glsl')
-rw-r--r--src/compiler/SConscript.glsl46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/compiler/SConscript.glsl b/src/compiler/SConscript.glsl
index d9878a00945..f2553693a7a 100644
--- a/src/compiler/SConscript.glsl
+++ b/src/compiler/SConscript.glsl
@@ -89,6 +89,26 @@ mesa_objs = env.StaticObject([
compiler_objs += mesa_objs
+# GLSL generated sources
+env.CodeGenerate(
+ target = 'glsl/ir_expression_operation.h',
+ script = 'glsl/ir_expression_operation.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT enum > $TARGET'
+)
+env.CodeGenerate(
+ target = 'glsl/ir_expression_operation_constant.h',
+ script = 'glsl/ir_expression_operation.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT constant > $TARGET'
+)
+env.CodeGenerate(
+ target = 'glsl/ir_expression_operation_strings.h',
+ script = 'glsl/ir_expression_operation.py',
+ source = [],
+ command = python_cmd + ' $SCRIPT strings > $TARGET'
+)
+
glsl = env.ConvenienceLibrary(
target = 'glsl',
source = glsl_sources,
@@ -100,6 +120,11 @@ env.Depends(glsl, glsl_parser)
Export('glsl')
+#
+# XXX: It's important to not add any generated source files after this point,
+# or it will break MinGW cross-compilation.
+#
+
# Skip building these programs as they will cause SCons error "Two environments
# with different actions were specified for the same target"
if env['crosscompile'] or env['embedded']:
@@ -116,27 +141,6 @@ env.Prepend(LIBS = [compiler, glsl])
compiler_objs += env.StaticObject("glsl/main.cpp")
-# GLSL generated sources
-
-env.CodeGenerate(
- target = 'glsl/ir_expression_operation.h',
- script = 'glsl/ir_expression_operation.py',
- source = [],
- command = python_cmd + ' $SCRIPT enum > $TARGET'
-)
-env.CodeGenerate(
- target = 'glsl/ir_expression_operation_constant.h',
- script = 'glsl/ir_expression_operation.py',
- source = [],
- command = python_cmd + ' $SCRIPT constant > $TARGET'
-)
-env.CodeGenerate(
- target = 'glsl/ir_expression_operation_strings.h',
- script = 'glsl/ir_expression_operation.py',
- source = [],
- command = python_cmd + ' $SCRIPT strings > $TARGET'
-)
-
glsl_compiler = env.Program(
target = 'glsl_compiler',
source = compiler_objs,