Added support for compiling BULLET with scons on windows
using bandoler's patch as a basis (thanks!). A couple of notes: - This is for windows only, I did not have a chance to try linux yet. - SConscript for PHY_Bullet may need tweaking (plus support for other platforms), but at least it's in there :) Any problems, shout :)
This commit is contained in:
19
SConstruct
19
SConstruct
@@ -331,8 +331,9 @@ elif sys.platform == 'win32':
|
|||||||
use_openal = 'true'
|
use_openal = 'true'
|
||||||
use_fmod = 'false'
|
use_fmod = 'false'
|
||||||
use_quicktime = 'true'
|
use_quicktime = 'true'
|
||||||
use_sumo = 'true'
|
use_sumo = 'false'
|
||||||
use_ode = 'false'
|
use_ode = 'false'
|
||||||
|
use_bullet = 'true'
|
||||||
use_buildinfo = 'true'
|
use_buildinfo = 'true'
|
||||||
build_blender_dynamic = 'true'
|
build_blender_dynamic = 'true'
|
||||||
build_blender_static = 'false'
|
build_blender_static = 'false'
|
||||||
@@ -402,6 +403,10 @@ elif sys.platform == 'win32':
|
|||||||
qhull_lib = ['qhull']
|
qhull_lib = ['qhull']
|
||||||
qhull_libpath = ['#../lib/windows/qhull/lib']
|
qhull_libpath = ['#../lib/windows/qhull/lib']
|
||||||
qhull_include = ['#extern/qhull/include']
|
qhull_include = ['#extern/qhull/include']
|
||||||
|
# Bullet library information
|
||||||
|
bullet_lib = []
|
||||||
|
bullet_libpath = []
|
||||||
|
bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
|
||||||
# ODE library information
|
# ODE library information
|
||||||
ode_lib = [] # TODO
|
ode_lib = [] # TODO
|
||||||
ode_libpath = ['#../lib/windows/ode/lib']
|
ode_libpath = ['#../lib/windows/ode/lib']
|
||||||
@@ -794,6 +799,8 @@ else:
|
|||||||
config.write ("BUILD_GAMEENGINE = %r\n"%(use_gameengine))
|
config.write ("BUILD_GAMEENGINE = %r\n"%(use_gameengine))
|
||||||
if use_ode == 'true':
|
if use_ode == 'true':
|
||||||
config.write ("USE_PHYSICS = 'ode'\n")
|
config.write ("USE_PHYSICS = 'ode'\n")
|
||||||
|
elif use_bullet == 'true':
|
||||||
|
config.write("USE_PHYSICS = 'bullet'\n")
|
||||||
else:
|
else:
|
||||||
config.write ("USE_PHYSICS = 'solid'\n")
|
config.write ("USE_PHYSICS = 'solid'\n")
|
||||||
config.write ("USE_OPENAL = %r\n"%(use_openal))
|
config.write ("USE_OPENAL = %r\n"%(use_openal))
|
||||||
@@ -842,6 +849,9 @@ else:
|
|||||||
config.write ("ODE_INCLUDE = %r\n"%(ode_include))
|
config.write ("ODE_INCLUDE = %r\n"%(ode_include))
|
||||||
config.write ("ODE_LIBPATH = %r\n"%(ode_libpath))
|
config.write ("ODE_LIBPATH = %r\n"%(ode_libpath))
|
||||||
config.write ("ODE_LIBRARY = %r\n"%(ode_lib))
|
config.write ("ODE_LIBRARY = %r\n"%(ode_lib))
|
||||||
|
config.write ("BULLET_INCLUDE = %r\n"%(bullet_include))
|
||||||
|
config.write ("BULLET_LIBPATH = %r\n"%(bullet_libpath))
|
||||||
|
config.write ("BULLET_LIBRARY = %r\n"%(bullet_lib))
|
||||||
config.write ("OPENAL_INCLUDE = %r\n"%(openal_include))
|
config.write ("OPENAL_INCLUDE = %r\n"%(openal_include))
|
||||||
config.write ("OPENAL_LIBPATH = %r\n"%(openal_libpath))
|
config.write ("OPENAL_LIBPATH = %r\n"%(openal_libpath))
|
||||||
config.write ("OPENAL_LIBRARY = %r\n"%(openal_lib))
|
config.write ("OPENAL_LIBRARY = %r\n"%(openal_lib))
|
||||||
@@ -891,7 +901,7 @@ user_options.AddOptions (
|
|||||||
'false')),
|
'false')),
|
||||||
(EnumOption ('USE_PHYSICS', 'solid',
|
(EnumOption ('USE_PHYSICS', 'solid',
|
||||||
'Select which physics engine to use.',
|
'Select which physics engine to use.',
|
||||||
allowed_values = ('ode', 'solid'))),
|
allowed_values = ('ode', 'solid', 'bullet'))),
|
||||||
(BoolOption ('BUILD_GAMEENGINE',
|
(BoolOption ('BUILD_GAMEENGINE',
|
||||||
'Set to 1 to build blender with game engine support.',
|
'Set to 1 to build blender with game engine support.',
|
||||||
'false')),
|
'false')),
|
||||||
@@ -943,6 +953,9 @@ user_options.AddOptions (
|
|||||||
('ODE_INCLUDE', 'Include directory for ODE header files.'),
|
('ODE_INCLUDE', 'Include directory for ODE header files.'),
|
||||||
('ODE_LIBPATH', 'Library path where the ODE library is located.'),
|
('ODE_LIBPATH', 'Library path where the ODE library is located.'),
|
||||||
('ODE_LIBRARY', 'ODE library name.'),
|
('ODE_LIBRARY', 'ODE library name.'),
|
||||||
|
('BULLET_INCLUDE', 'Include directory for BULLET header files.'),
|
||||||
|
('BULLET_LIBPATH', 'Library path where the BULLET library is located.'),
|
||||||
|
('BULLET_LIBRARY', 'BULLET library name'),
|
||||||
('OPENAL_INCLUDE', 'Include directory for OpenAL header files.'),
|
('OPENAL_INCLUDE', 'Include directory for OpenAL header files.'),
|
||||||
('OPENAL_LIBPATH', 'Library path where the OpenAL library is located.'),
|
('OPENAL_LIBPATH', 'Library path where the OpenAL library is located.'),
|
||||||
('OPENAL_LIBRARY', 'OpenAL library name.'),
|
('OPENAL_LIBRARY', 'OpenAL library name.'),
|
||||||
@@ -980,6 +993,8 @@ if user_options_dict['BUILD_GAMEENGINE'] == 1:
|
|||||||
defines += ['GAMEBLENDER=1']
|
defines += ['GAMEBLENDER=1']
|
||||||
if user_options_dict['USE_PHYSICS'] == 'ode':
|
if user_options_dict['USE_PHYSICS'] == 'ode':
|
||||||
defines += ['USE_ODE']
|
defines += ['USE_ODE']
|
||||||
|
elif user_options_dict['USE_PHYSICS'] == 'bullet':
|
||||||
|
defines += ['USE_BULLET']
|
||||||
else:
|
else:
|
||||||
defines += ['USE_SUMO_SOLID']
|
defines += ['USE_SUMO_SOLID']
|
||||||
else:
|
else:
|
||||||
|
3
extern/SConscript
vendored
3
extern/SConscript
vendored
@@ -5,7 +5,8 @@ Import('user_options_dict')
|
|||||||
|
|
||||||
print "externs..."
|
print "externs..."
|
||||||
SConscript(['qhull/SConscript',
|
SConscript(['qhull/SConscript',
|
||||||
'solid/SConscript'])
|
'solid/SConscript',
|
||||||
|
'bullet/SConscript'])
|
||||||
|
|
||||||
|
|
||||||
if user_options_dict['USE_INTERNATIONAL'] == 1:
|
if user_options_dict['USE_INTERNATIONAL'] == 1:
|
||||||
|
4
extern/bullet/SConscript
vendored
4
extern/bullet/SConscript
vendored
@@ -83,7 +83,7 @@ bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
|
|||||||
|
|
||||||
'BulletDynamics/ConstraintSolver/ContactConstraint.cpp',
|
'BulletDynamics/ConstraintSolver/ContactConstraint.cpp',
|
||||||
'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp',
|
'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp',
|
||||||
'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp',
|
#'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp',
|
||||||
'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp',
|
'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp',
|
||||||
'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp',
|
'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp',
|
||||||
'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp',
|
'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp',
|
||||||
@@ -101,4 +101,4 @@ bullet_env.Append (CPPPATH = ['.',
|
|||||||
])
|
])
|
||||||
source_files = bullet_sources
|
source_files = bullet_sources
|
||||||
|
|
||||||
bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=source_files)
|
bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=bullet_sources)
|
||||||
|
@@ -25,7 +25,7 @@ makesdna_tool.Append (LIBPATH = '#'+user_options_dict['BUILD_DIR']+'/lib')
|
|||||||
makesdna_tool.Append (LIBS = 'blender_guardedalloc')
|
makesdna_tool.Append (LIBS = 'blender_guardedalloc')
|
||||||
makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files)
|
makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files)
|
||||||
|
|
||||||
dna = Environment ()
|
dna = Environment (ENV = os.environ)
|
||||||
dna_dict = dna.Dictionary()
|
dna_dict = dna.Dictionary()
|
||||||
makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX']
|
makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX']
|
||||||
dna.Depends ('dna.c', '#'+makesdna_name)
|
dna.Depends ('dna.c', '#'+makesdna_name)
|
||||||
|
@@ -35,6 +35,7 @@ kx_blenderhook_env.Append (CPPPATH=['.',
|
|||||||
'#source/gameengine/Network',
|
'#source/gameengine/Network',
|
||||||
'#source/gameengine/SceneGraph',
|
'#source/gameengine/SceneGraph',
|
||||||
'#source/gameengine/Physics/common',
|
'#source/gameengine/Physics/common',
|
||||||
|
'#source/gameengine/Physics/Bullet',
|
||||||
'#source/gameengine/Physics/Sumo',
|
'#source/gameengine/Physics/Sumo',
|
||||||
'#source/gameengine/Physics/Sumo/Fuzzics/include',
|
'#source/gameengine/Physics/Sumo/Fuzzics/include',
|
||||||
'#source/gameengine/Network/LoopBackNetwork',
|
'#source/gameengine/Network/LoopBackNetwork',
|
||||||
@@ -45,6 +46,7 @@ kx_blenderhook_env.Append (CPPPATH=['.',
|
|||||||
|
|
||||||
kx_blenderhook_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
|
kx_blenderhook_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
|
||||||
kx_blenderhook_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
kx_blenderhook_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
||||||
|
kx_blenderhook_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
|
||||||
kx_blenderhook_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
|
kx_blenderhook_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
|
||||||
|
|
||||||
if sys.platform=='win32':
|
if sys.platform=='win32':
|
||||||
|
@@ -49,6 +49,7 @@ kx_converter_env.Append (CPPPATH = ['.',
|
|||||||
'#source/gameengine/Network',
|
'#source/gameengine/Network',
|
||||||
'#source/gameengine/SceneGraph',
|
'#source/gameengine/SceneGraph',
|
||||||
'#source/gameengine/Physics/common',
|
'#source/gameengine/Physics/common',
|
||||||
|
'#source/gameengine/Physics/Bullet',
|
||||||
'#source/gameengine/Physics/BlOde',
|
'#source/gameengine/Physics/BlOde',
|
||||||
'#source/gameengine/Physics/Dummy',
|
'#source/gameengine/Physics/Dummy',
|
||||||
'#source/gameengine/Physics/Sumo',
|
'#source/gameengine/Physics/Sumo',
|
||||||
@@ -60,5 +61,6 @@ kx_converter_env.Append (CPPPATH = ['.',
|
|||||||
|
|
||||||
kx_converter_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
|
kx_converter_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
|
||||||
kx_converter_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
kx_converter_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
||||||
|
kx_converter_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
|
||||||
|
|
||||||
kx_converter_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_converter', source=source_files)
|
kx_converter_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_converter', source=source_files)
|
||||||
|
@@ -68,6 +68,11 @@ if user_options_dict['USE_PHYSICS'] == 'ode':
|
|||||||
source_files += ['KX_OdePhysicsController.cpp']
|
source_files += ['KX_OdePhysicsController.cpp']
|
||||||
ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
||||||
|
|
||||||
|
if user_options_dict['USE_PHYSICS'] == 'bullet':
|
||||||
|
source_files += ['KX_BulletPhysicsController.cpp']
|
||||||
|
ketsji_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
|
||||||
|
ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
|
||||||
|
|
||||||
ketsji_env.Append (CPPPATH = ['.',
|
ketsji_env.Append (CPPPATH = ['.',
|
||||||
'#source/kernel/gen_system',
|
'#source/kernel/gen_system',
|
||||||
'#intern/string',
|
'#intern/string',
|
||||||
@@ -97,6 +102,7 @@ ketsji_env.Append (CPPPATH = ['.',
|
|||||||
'#source/gameengine/Network',
|
'#source/gameengine/Network',
|
||||||
'#source/gameengine/SceneGraph',
|
'#source/gameengine/SceneGraph',
|
||||||
'#source/gameengine/Physics/common',
|
'#source/gameengine/Physics/common',
|
||||||
|
'#source/gameengine/Physics/Bullet',
|
||||||
'#source/gameengine/Physics/BlOde',
|
'#source/gameengine/Physics/BlOde',
|
||||||
'#source/gameengine/Physics/Dummy',
|
'#source/gameengine/Physics/Dummy',
|
||||||
'#source/gameengine/Physics/Sumo',
|
'#source/gameengine/Physics/Sumo',
|
||||||
|
22
source/gameengine/Physics/Bullet/SConscript
Normal file
22
source/gameengine/Physics/Bullet/SConscript
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import sys
|
||||||
|
Import ('user_options_dict')
|
||||||
|
Import ('library_env')
|
||||||
|
|
||||||
|
phy_bullet_env = library_env.Copy ()
|
||||||
|
|
||||||
|
source_files = ['CcdPhysicsEnvironment.cpp',
|
||||||
|
'CcdPhysicsController.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
|
phy_bullet_env.Append (CPPPATH=['.',
|
||||||
|
'../common'])
|
||||||
|
|
||||||
|
phy_bullet_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform=='win32':
|
||||||
|
phy_bullet_env.Append (CXXFLAGS = ['/GR'])
|
||||||
|
phy_bullet_env.Append (CCFLAGS =['/O2'])
|
||||||
|
|
||||||
|
phy_bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Bullet', source=source_files)
|
@@ -22,3 +22,5 @@ if user_options_dict['USE_PHYSICS'] == 'solid':
|
|||||||
SConscript(['Physics/Sumo/SConscript'])
|
SConscript(['Physics/Sumo/SConscript'])
|
||||||
elif user_options_dict['USE_PHYSICS'] == 'ode':
|
elif user_options_dict['USE_PHYSICS'] == 'ode':
|
||||||
SConscript(['Physics/BlOde/SConscript'])
|
SConscript(['Physics/BlOde/SConscript'])
|
||||||
|
elif user_options_dict['USE_PHYSICS'] == 'bullet':
|
||||||
|
SConscript(['Physics/Bullet/SConscript'])
|
||||||
|
@@ -87,6 +87,8 @@ def ketsji_libs(env):
|
|||||||
'NG_loopbacknetwork'])
|
'NG_loopbacknetwork'])
|
||||||
if bs_globals.user_options_dict['USE_PHYSICS'] == 'solid':
|
if bs_globals.user_options_dict['USE_PHYSICS'] == 'solid':
|
||||||
env.Append (LIBS=['PHY_Sumo', 'PHY_Physics', 'blender_MT', 'extern_solid', 'extern_qhull'])
|
env.Append (LIBS=['PHY_Sumo', 'PHY_Physics', 'blender_MT', 'extern_solid', 'extern_qhull'])
|
||||||
|
elif bs_globals.user_options_dict['USE_PHYSICS'] == 'bullet':
|
||||||
|
env.Append (LIBS=['PHY_Bullet', 'PHY_Physics', 'blender_MT','extern_bullet'])
|
||||||
else:
|
else:
|
||||||
env.Append (LIBS=['PHY_Ode',
|
env.Append (LIBS=['PHY_Ode',
|
||||||
'PHY_Physics'])
|
'PHY_Physics'])
|
||||||
|
Reference in New Issue
Block a user