scons: Build nir/glsl_types.cpp once.
authorJose Fonseca <jfonseca@vmware.com>
Mon, 19 Oct 2015 13:29:28 +0000 (14:29 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Mon, 19 Oct 2015 14:59:59 +0000 (15:59 +0100)
Undoes early hacks, and ensures nir/glsl_types.cpp is built once, and
only once.

The root problem is that SCons doesn't know about NIR nor any source
file in the NIR_FILES source list.

Tested with libgl-gdi and libgl-xlib scons targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/targets/libgl-gdi/SConscript
src/gallium/targets/libgl-gdi/glsl_types_hack.cpp [deleted file]
src/gallium/targets/libgl-xlib/SConscript
src/gallium/targets/libgl-xlib/glsl_types_hack.cpp [deleted file]
src/gallium/targets/osmesa/SConscript
src/gallium/targets/osmesa/glsl_types_hack.cpp [deleted file]
src/glsl/SConscript
src/mesa/drivers/x11/SConscript

index eb777a86cb2dd9b5cdc696ff0a4abbe31bb7b333..594f34d7fadff5385c5ba9d7ea7bc73015a75197 100644 (file)
@@ -7,10 +7,6 @@ env = env.Clone()
 
 env.Append(CPPPATH = [
     '#src',
-    '#src/mesa',
-    '#src/mapi',
-    '#src/glsl',
-    '#src/glsl/nir',
     '#src/gallium/state_trackers/wgl',
     '#src/gallium/winsys/sw',
 ])
@@ -24,11 +20,7 @@ env.Append(LIBS = [
 
 env.Prepend(LIBS = [mesautil])
 
-sources = [
-    'libgl_gdi.c',
-    'glsl_types_hack.cpp'
-]
-
+sources = ['libgl_gdi.c']
 drivers = []
 
 if True:
diff --git a/src/gallium/targets/libgl-gdi/glsl_types_hack.cpp b/src/gallium/targets/libgl-gdi/glsl_types_hack.cpp
deleted file mode 100644 (file)
index 5c042f2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/* errrg scons.. otherwise "scons: *** Two environments with different actions were specified for the same target: $mesa/build/linux-x86_64-debug/glsl/nir/glsl_types.os" */
-#include "glsl_types.cpp"
-
index fedc522fbdc5018763c3df6763e85a58807bdba0..df5a220ac2594d74d3edb0f35880cefff3b295a9 100644 (file)
@@ -6,8 +6,6 @@ Import('*')
 env = env.Clone()
 
 env.Append(CPPPATH = [
-    '#/src/glsl',
-    '#/src/glsl/nir',
     '#/src/mapi',
     '#/src/mesa',
     '#/src/mesa/main',
@@ -38,7 +36,6 @@ env.Prepend(LIBS = [
 
 sources = [
     'xlib.c',
-    'glsl_types_hack.cpp',
 ]
 
 if True:
diff --git a/src/gallium/targets/libgl-xlib/glsl_types_hack.cpp b/src/gallium/targets/libgl-xlib/glsl_types_hack.cpp
deleted file mode 100644 (file)
index 5c042f2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/* errrg scons.. otherwise "scons: *** Two environments with different actions were specified for the same target: $mesa/build/linux-x86_64-debug/glsl/nir/glsl_types.os" */
-#include "glsl_types.cpp"
-
index 78930a98e039ee449899ce48adc0817bca410108..4a9115ba1cfaf36ddeef4c144075669cb01f0a47 100644 (file)
@@ -5,8 +5,6 @@ env = env.Clone()
 env.Prepend(CPPPATH = [
     '#src/mapi',
     '#src/mesa',
-    '#src/glsl',
-    '#src/glsl/nir',
     #Dir('../../../mapi'), # src/mapi build path for python-generated GL API files/headers
 ])
 
@@ -24,10 +22,7 @@ env.Prepend(LIBS = [
 
 env.Append(CPPDEFINES = ['GALLIUM_TRACE', 'GALLIUM_SOFTPIPE'])
 
-sources = [
-    'target.c',
-    'glsl_types_hack.cpp'
-]
+sources = ['target.c']
 
 if env['llvm']:
     env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE')
diff --git a/src/gallium/targets/osmesa/glsl_types_hack.cpp b/src/gallium/targets/osmesa/glsl_types_hack.cpp
deleted file mode 100644 (file)
index 5c042f2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/* errrg scons.. otherwise "scons: *** Two environments with different actions were specified for the same target: $mesa/build/linux-x86_64-debug/glsl/nir/glsl_types.os" */
-#include "glsl_types.cpp"
-
index 927cbdcdb78104def10b0ce361104f061ab6f565..70bf5b09c3c8846023d28a7686a1bef12a2ee845 100644 (file)
@@ -61,6 +61,12 @@ source_lists = env.ParseSourceList('Makefile.sources')
 for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES'):
     glsl_sources += source_lists[l]
 
+# add nir/glsl_types.cpp manually, because SCons still doesn't know about NIR.
+# XXX: Remove this once we build NIR and NIR_FILES.
+glsl_sources += [
+    'nir/glsl_types.cpp',
+]
+
 if env['msvc']:
     env.Prepend(CPPPATH = ['#/src/getopt'])
     env.PrependUnique(LIBS = [getopt])
@@ -81,7 +87,6 @@ mesa_objs = env.StaticObject([
     'prog_hash_table.c',
     'symbol_table.c',
     'dummy_errors.c',
-    'nir/glsl_types.cpp',
 ])
 
 compiler_objs += mesa_objs
index aa1e73a9d4ab53abf57722668379c82fdf097d32..cd5cccda0d1842279cc92d073ec71dcd5a95d617 100644 (file)
@@ -33,7 +33,6 @@ sources = [
        'xm_dd.c',
        'xm_line.c',
        'xm_tri.c',
-       '../../../glsl/nir/glsl_types.cpp',
 ]
 
 # Disallow undefined symbols