diff options
Diffstat (limited to 'modules/bullet/SCsub')
-rw-r--r-- | modules/bullet/SCsub | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index b853ebfc63..09509abc44 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -7,9 +7,13 @@ env_bullet = env_modules.Clone() # Thirdparty source files +thirdparty_obj = [] + if env["builtin_bullet"]: - # Build only version 2 for now (as of 2.89) + # Build only "Bullet2" API (not "Bullet3" folders). # Sync file list with relevant upstream CMakeLists.txt for each folder. + if env["float"] == "64": + env.Append(CPPDEFINES=["BT_USE_DOUBLE_PRECISION=1"]) thirdparty_dir = "#thirdparty/bullet/" bullet2_src = [ @@ -185,6 +189,7 @@ if env["builtin_bullet"]: "LinearMath/btGeometryUtil.cpp", "LinearMath/btPolarDecomposition.cpp", "LinearMath/btQuickprof.cpp", + "LinearMath/btReducedVector.cpp", "LinearMath/btSerializer.cpp", "LinearMath/btSerializer64.cpp", "LinearMath/btThreads.cpp", @@ -196,20 +201,24 @@ if env["builtin_bullet"]: thirdparty_sources = [thirdparty_dir + file for file in bullet2_src] - # Treat Bullet headers as system headers to avoid raising warnings. Not supported on MSVC. - if not env.msvc: - env_bullet.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path]) - else: - env_bullet.Prepend(CPPPATH=[thirdparty_dir]) - # if env['target'] == "debug" or env['target'] == "release_debug": - # env_bullet.Append(CPPDEFINES=['BT_DEBUG']) + env_bullet.Prepend(CPPPATH=[thirdparty_dir]) + if env["target"] == "debug" or env["target"] == "release_debug": + env_bullet.Append(CPPDEFINES=["DEBUG"]) - env_bullet.Append(CPPDEFINES=["BT_USE_OLD_DAMPING_METHOD"]) + env_bullet.Append(CPPDEFINES=["BT_USE_OLD_DAMPING_METHOD", "BT_THREADSAFE"]) env_thirdparty = env_bullet.Clone() env_thirdparty.disable_warnings() - env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) + env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) + env.modules_sources += thirdparty_obj # Godot source files -env_bullet.add_source_files(env.modules_sources, "*.cpp") + +module_obj = [] + +env_bullet.add_source_files(module_obj, "*.cpp") +env.modules_sources += module_obj + +# Needed to force rebuilding the module files when the thirdparty library is updated. +env.Depends(module_obj, thirdparty_obj) |