summaryrefslogtreecommitdiffstats
path: root/src/glsl/SConscript
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-12-10 16:29:04 +0000
committerJosé Fonseca <[email protected]>2009-12-10 16:30:08 +0000
commit491f384c3958067e6c4c994041f5d8d413b806bc (patch)
tree761cddddb7c577277b626449aca7a2bef65e1d94 /src/glsl/SConscript
parent289eab5389c0f0f3f85f872b2ba440f5e8416a50 (diff)
scons: Get GLSL code building correctly when cross compiling.
This is quite messy. GLSL code has to be built twice: one for the host OS, another for the target OS.
Diffstat (limited to 'src/glsl/SConscript')
-rw-r--r--src/glsl/SConscript68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/glsl/SConscript b/src/glsl/SConscript
new file mode 100644
index 00000000000..6f1f81b199a
--- /dev/null
+++ b/src/glsl/SConscript
@@ -0,0 +1,68 @@
+import common
+
+Import('*')
+
+env = env.Clone()
+
+sources = [
+ 'pp/sl_pp_context.c',
+ 'pp/sl_pp_define.c',
+ 'pp/sl_pp_dict.c',
+ 'pp/sl_pp_error.c',
+ 'pp/sl_pp_expression.c',
+ 'pp/sl_pp_extension.c',
+ 'pp/sl_pp_if.c',
+ 'pp/sl_pp_line.c',
+ 'pp/sl_pp_macro.c',
+ 'pp/sl_pp_pragma.c',
+ 'pp/sl_pp_process.c',
+ 'pp/sl_pp_purify.c',
+ 'pp/sl_pp_token.c',
+ 'pp/sl_pp_version.c',
+ 'cl/sl_cl_parse.c',
+]
+
+glsl = env.StaticLibrary(
+ target = 'glsl',
+ source = sources,
+)
+
+Export('glsl')
+
+env = env.Clone()
+
+if env['platform'] == 'windows':
+ env.PrependUnique(LIBS = [
+ 'user32',
+ ])
+
+env.Prepend(LIBS = [glsl])
+
+env.Program(
+ target = 'purify',
+ source = ['apps/purify.c'],
+)
+
+env.Program(
+ target = 'tokenise',
+ source = ['apps/tokenise.c'],
+)
+
+env.Program(
+ target = 'version',
+ source = ['apps/version.c'],
+)
+
+env.Program(
+ target = 'process',
+ source = ['apps/process.c'],
+)
+
+glsl_compile = env.Program(
+ target = 'compile',
+ source = ['apps/compile.c'],
+)
+
+if env['platform'] == common.default_platform:
+ # Only export the GLSL compiler when building for the host platform
+ Export('glsl_compile')