|
3 | 3 | import glob, hashlib, os, re, shutil, subprocess, sys
|
4 | 4 | import tools.shared
|
5 | 5 | from tools.shared import *
|
6 |
| -from runner import RunnerCore, path_from_root, checked_sanity, test_modes |
| 6 | +from runner import RunnerCore, path_from_root, checked_sanity, test_modes, get_bullet_library |
7 | 7 |
|
8 | 8 | class T(RunnerCore): # Short name, to make it more fun to use manually on the commandline
|
9 | 9 | def is_le32(self):
|
@@ -9001,30 +9001,17 @@ def test_the_bullet(self): # Called thus so it runs late in the alphabetical cyc
|
9001 | 9001 | Settings.SAFE_HEAP_LINES = ['btVoronoiSimplexSolver.h:40', 'btVoronoiSimplexSolver.h:41',
|
9002 | 9002 | 'btVoronoiSimplexSolver.h:42', 'btVoronoiSimplexSolver.h:43']
|
9003 | 9003 |
|
9004 |
| - configure_commands = [['sh', './configure'], ['cmake', '.']] |
9005 |
| - configure_args = [['--disable-demos','--disable-dependency-tracking'], ['-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF']] |
9006 |
| - for c in range(0,2): |
9007 |
| - configure = configure_commands[c] |
| 9004 | + for use_cmake in [False, True]: # If false, use a configure script to configure Bullet build. |
9008 | 9005 | # Windows cannot run configure sh scripts.
|
9009 |
| - if WINDOWS and configure[0] == 'sh': |
| 9006 | + if WINDOWS and not use_cmake: |
9010 | 9007 | continue
|
9011 | 9008 |
|
9012 |
| - # Depending on whether 'configure' or 'cmake' is used to build, Bullet places output files in different directory structures. |
9013 |
| - if configure[0] == 'sh': |
9014 |
| - generated_libs = [os.path.join('src', '.libs', 'libBulletDynamics.a'), |
9015 |
| - os.path.join('src', '.libs', 'libBulletCollision.a'), |
9016 |
| - os.path.join('src', '.libs', 'libLinearMath.a')] |
9017 |
| - else: |
9018 |
| - generated_libs = [os.path.join('src', 'BulletDynamics', 'libBulletDynamics.a'), |
9019 |
| - os.path.join('src', 'BulletCollision', 'libBulletCollision.a'), |
9020 |
| - os.path.join('src', 'LinearMath', 'libLinearMath.a')] |
9021 |
| - |
9022 | 9009 | def test():
|
9023 | 9010 | self.do_run(open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(),
|
9024 | 9011 | [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings
|
9025 | 9012 | open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(),
|
9026 | 9013 | open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()],
|
9027 |
| - libraries=self.get_library('bullet', generated_libs, configure=configure, configure_args=configure_args[c], cache_name_extra=configure[0]), |
| 9014 | + libraries=get_bullet_library(self, use_cmake), |
9028 | 9015 | includes=[path_from_root('tests', 'bullet', 'src')])
|
9029 | 9016 | test()
|
9030 | 9017 |
|
|
0 commit comments