[Bf-blender-cvs] [534233d] depsgraph_refactor: Depsgraph: Fix for building depsgraph module under SCons (part 2)

Joshua Leung noreply at git.blender.org
Thu May 22 13:40:08 CEST 2014


Commit: 534233d68353d922cc7c64eb35ce83aba3bbbab6
Author: Joshua Leung
Date:   Thu May 22 23:06:56 2014 +1200
https://developer.blender.org/rB534233d68353d922cc7c64eb35ce83aba3bbbab6

Depsgraph: Fix for building depsgraph module under SCons (part 2)

The build was failing on SCons + mingw64 since some defines were needed to
get around some C++ "standard library" crap which isn't at all standardly
(or at least not in the same namespace) available yet. Copied over some existing
code for dealing with this from the Ceres stuff (extern/libmv/third_party/ceres/SConscript)
so that this works.

===================================================================

M	source/blender/depsgraph/SConscript

===================================================================

diff --git a/source/blender/depsgraph/SConscript b/source/blender/depsgraph/SConscript
index 2635f66..3dfce1f 100644
--- a/source/blender/depsgraph/SConscript
+++ b/source/blender/depsgraph/SConscript
@@ -25,6 +25,8 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+from unordered_map import test_unordered_map
+
 Import('env')
 
 sources = env.Glob('intern/*.cpp') + env.Glob('util/*.cpp')
@@ -48,6 +50,29 @@ incs.append(env['BF_BOOST_INC'])
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
     incs.append(env['BF_PTHREADS_INC'])
+	
+
+def define_unordered_map(conf):
+    found, namespace, include_prefix = test_unordered_map(conf)
+    if found:
+        if not include_prefix:
+            if namespace == 'std':
+                defs.append('DEG_STD_UNORDERED_MAP')
+                return True
+            elif namespace == 'std::tr1':
+                defs.append('DEG_STD_UNORDERED_MAP_IN_TR1_NAMESPACE')
+                return True
+        else:
+            if namespace == 'std::tr1':
+                defs.append('DEG_TR1_UNORDERED_MAP')
+                return True
+    return False
+
+conf = Configure(env)
+if not define_unordered_map(conf):
+    print("-- Replacing unordered_map/set with map/set (warning: slower!)")
+    defs.append('DEG_NO_UNORDERED_MAP')
+env = conf.Finish()
 
 env.BlenderLib(libname='bf_depsgraph', sources=sources,
                includes=incs, defines=defs,




More information about the Bf-blender-cvs mailing list