Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2014-03-19 14:21:24 +0400
committerJens Verwiebe <info@jensverwiebe.de>2014-03-19 14:21:36 +0400
commit67f0290382ad8daea57716cb0d70fc533fc4bd0d (patch)
treecfad54c218cef68a4a8be01bd90dc5612754bfe2 /extern/bullet2
parent28c1a860e20085afa49ecd79777f45e93a8eebff (diff)
OSX/bullet/scons: a better workaround for clang 3.4 issues with actual bullet, according cmake ( less speed penalty )
Diffstat (limited to 'extern/bullet2')
-rw-r--r--extern/bullet2/src/SConscript16
1 files changed, 13 insertions, 3 deletions
diff --git a/extern/bullet2/src/SConscript b/extern/bullet2/src/SConscript
index 69e56782974..3b3d6f2ffce 100644
--- a/extern/bullet2/src/SConscript
+++ b/extern/bullet2/src/SConscript
@@ -19,8 +19,8 @@ elif env['OURPLATFORM'] in ('linux', 'freebsd4', 'freebsd5'):
cflags += ['-O2']
elif sys.platform=='darwin':
defs += ' NDEBUG'
- bt_cc_flags = env['CCFLAGS'] + ['-O0', '-fPIC', '-msse','-msse2', '-msse3', '-mssse3', '-ffast-math']
- bt_cxx_flags = env['CXXFLAGS'] + ['-O0', '-fPIC', '-msse','-msse2', '-msse3', '-mssse3', '-ffast-math']
+ bt_flags = env['CCFLAGS'] + ['-fPIC', '-msse','-msse2', '-msse3', '-mssse3', '-ffast-math'] # basic -O0 optimization
+ bt_opt_flags = bt_flags + ['-O3']
bullet2_src = env.Glob("LinearMath/*.cpp")
bullet2_src += env.Glob("BulletCollision/BroadphaseCollision/*.cpp")
@@ -39,6 +39,16 @@ bullet2_src += env.Glob("BulletSoftBody/*.cpp")
incs = '. BulletCollision BulletDynamics LinearMath BulletSoftBody'
if sys.platform=='darwin':
- env.BlenderLib ( libname = 'extern_bullet2', sources=bullet2_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], cc_compileflags=bt_cc_flags, cxx_compileflags=bt_cxx_flags )
+ if env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.4':
+ # Due some bugs in bullet, clang 3.4 produces wrong code when optimized below -O0
+ # to avoid too much speed penalty compiling whole bullet lib non-optimized,
+ # we build a seperate non-optimized/optimized parts and just link together finally
+ bullet2_src.remove("BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp")
+ bullet2_fix_src = env.Glob("BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp")
+ env.BlenderLib ( libname = 'extern_fix_bullet2', sources=bullet2_fix_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], cc_compileflags=bt_flags, cxx_compileflags=bt_flags )
+
+ env.BlenderLib ( libname = 'extern_bullet2', sources=bullet2_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], cc_compileflags=bt_opt_flags, cxx_compileflags=bt_opt_flags )
else:
env.BlenderLib ( libname = 'extern_bullet2', sources=bullet2_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], compileflags=cflags )
+
+env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.3' \ No newline at end of file