scons: Autogenerate GLSL builtin library *_gc.h from *.gc files.
authorMichal Krol <michal@vmware.com>
Wed, 25 Nov 2009 13:52:21 +0000 (14:52 +0100)
committerMichal Krol <michal@vmware.com>
Wed, 25 Nov 2009 13:52:21 +0000 (14:52 +0100)
src/SConscript
src/glsl/apps/SConscript
src/mesa/SConscript
src/mesa/shader/slang/library/SConscript [new file with mode: 0644]

index 0fe0798b3958241ae344d4314f14c6e513a660fc..f7fac33790bfd892f9b5c1ffa7943533ce6f7caf 100644 (file)
@@ -1,9 +1,9 @@
 Import('*')
 
-SConscript('gallium/SConscript')
 SConscript('glsl/pp/SConscript')
 SConscript('glsl/cl/SConscript')
 SConscript('glsl/apps/SConscript')
+SConscript('gallium/SConscript')
 
 if 'mesa' in env['statetrackers']:
        SConscript('mesa/SConscript')
index 4a89e3f1dfe73157281e4389f02d6f778b031841..4c81b3be956d706b6231028a5649dfa8ee6d78af 100644 (file)
@@ -29,7 +29,8 @@ env.Program(
     source = ['process.c'],
 )
 
-env.Program(
+glsl_compile = env.Program(
     target = 'compile',
     source = ['compile.c'],
 )
+Export('glsl_compile')
index dde9bb08a997ba529ac4cd98848863eb464a8c70..d5a9031f402cfa76605dee88836bc89347aa261c 100644 (file)
@@ -335,7 +335,9 @@ if env['platform'] != 'winddk':
                # Add the dir containing the generated header (somewhere inside  the
                # build dir) to the include path  
                env.Append(CPPPATH = [matypes[0].dir])
-       
+
+       SConscript('shader/slang/library/SConscript')
+
        #
        # Libraries
        # 
diff --git a/src/mesa/shader/slang/library/SConscript b/src/mesa/shader/slang/library/SConscript
new file mode 100644 (file)
index 0000000..8b3fd03
--- /dev/null
@@ -0,0 +1,44 @@
+#######################################################################
+# SConscript for GLSL builtin library
+
+Import('*')
+
+env = env.Clone()
+
+bld_frag = Builder(
+       action = glsl_compile[0].abspath + ' fragment $SOURCE $TARGET',
+       suffix = '.gc',
+       src_suffix = '_gc.h')
+       
+bld_vert = Builder(
+       action = glsl_compile[0].abspath + ' vertex $SOURCE $TARGET',
+       suffix = '.gc',
+       src_suffix = '_gc.h')
+
+env['BUILDERS']['bld_frag'] = bld_frag
+env['BUILDERS']['bld_vert'] = bld_vert
+
+# Generate GLSL builtin library binaries
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_core_gc.h',
+       '#src/mesa/shader/slang/library/slang_core.gc')
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_common_builtin_gc.h',
+       '#src/mesa/shader/slang/library/slang_common_builtin.gc')
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_fragment_builtin_gc.h',
+       '#src/mesa/shader/slang/library/slang_fragment_builtin.gc')
+env.bld_vert(
+       '#src/mesa/shader/slang/library/slang_vertex_builtin_gc.h',
+       '#src/mesa/shader/slang/library/slang_vertex_builtin.gc')
+
+# Generate GLSL 1.20 builtin library binaries
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_120_core_gc.h',
+       '#src/mesa/shader/slang/library/slang_120_core.gc')
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_builtin_120_common_gc.h',
+       '#src/mesa/shader/slang/library/slang_builtin_120_common.gc')
+env.bld_frag(
+       '#src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h',
+       '#src/mesa/shader/slang/library/slang_builtin_120_fragment.gc')