scons: Fix MinGW cross compilation.
The generated GLSL header files were only being built for the host
platform, and not the target platform.
Trivial.
diff --git a/src/compiler/SConscript.glsl b/src/compiler/SConscript.glsl
index d9878a0..f255369 100644
--- a/src/compiler/SConscript.glsl
+++ b/src/compiler/SConscript.glsl
@@ -89,35 +89,7 @@
compiler_objs += mesa_objs
-glsl = env.ConvenienceLibrary(
- target = 'glsl',
- source = glsl_sources,
-)
-
-# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll depends on
-# glsl_parser.h
-env.Depends(glsl, glsl_parser)
-
-Export('glsl')
-
-# 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']:
- Return()
-
-env = env.Clone()
-
-if env['platform'] == 'windows':
- env.PrependUnique(LIBS = [
- 'user32',
- ])
-
-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',
@@ -137,6 +109,38 @@
command = python_cmd + ' $SCRIPT strings > $TARGET'
)
+glsl = env.ConvenienceLibrary(
+ target = 'glsl',
+ source = glsl_sources,
+)
+
+# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll depends on
+# glsl_parser.h
+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']:
+ Return()
+
+env = env.Clone()
+
+if env['platform'] == 'windows':
+ env.PrependUnique(LIBS = [
+ 'user32',
+ ])
+
+env.Prepend(LIBS = [compiler, glsl])
+
+compiler_objs += env.StaticObject("glsl/main.cpp")
+
glsl_compiler = env.Program(
target = 'glsl_compiler',
source = compiler_objs,