From b957e4bae6c58c3a7760a0cc13f146b30659078d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Thu, 20 Nov 2014 17:16:18 -0500 Subject: [PATCH 1/2] Add support for building on Windows. --- make.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/make.py b/make.py index be3cd57..f2a7814 100755 --- a/make.py +++ b/make.py @@ -93,24 +93,36 @@ def stage(text): emscripten.Building.emcc('glue.cpp', args, 'glue.bc') assert(os.path.exists('glue.bc')) - if not os.path.exists('config.h'): - stage('Configure (if this fails, run autogen.sh in bullet/ first)') + # Configure with CMake on Windows, and with configure on Unix. + cmake_build = emscripten.WINDOWS - emscripten.Building.configure(['../configure', '--disable-demos','--disable-dependency-tracking']) + if cmake_build: + if not os.path.exists('CMakeCache.txt'): + emscripten.Building.configure([emscripten.PYTHON, os.path.join(EMSCRIPTEN_ROOT, 'emcmake'), 'cmake', '..', '-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF', '-DBUILD_CPU_DEMOS=OFF', '-DUSE_GLUT=OFF', '-DCMAKE_BUILD_TYPE=Release']) + else: + if not os.path.exists('config.h'): + stage('Configure (if this fails, run autogen.sh in bullet/ first)') + emscripten.Building.configure(['../configure', '--disable-demos','--disable-dependency-tracking']) stage('Make') - emscripten.Building.make(['make', '-j']) + if emscripten.WINDOWS: + emscripten.Building.make(['mingw32-make', '-j']) + else: + emscripten.Building.make(['make', '-j']) stage('Link') - emscripten.Building.link([ - 'glue.bc', - os.path.join('src', '.libs', 'libBulletDynamics.a'), - os.path.join('src', '.libs', 'libBulletCollision.a'), - os.path.join('src', '.libs', 'libLinearMath.a') - ], - 'libbullet.bc') + if cmake_build: + bullet_libs = [os.path.join('src', 'BulletDynamics', 'libBulletDynamics.a'), + os.path.join('src', 'BulletCollision', 'libBulletCollision.a'), + os.path.join('src', 'LinearMath', 'libLinearMath.a')] + else: + bullet_libs = [os.path.join('src', '.libs', 'libBulletDynamics.a'), + os.path.join('src', '.libs', 'libBulletCollision.a'), + os.path.join('src', '.libs', 'libLinearMath.a')] + + emscripten.Building.link(['glue.bc'] + bullet_libs, 'libbullet.bc') assert os.path.exists('libbullet.bc') stage('emcc: ' + ' '.join(emcc_args)) From 2713c4eb048eb8ad7e1c929cfadea34f0e6450ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Sat, 20 Jun 2015 21:14:46 +0300 Subject: [PATCH 2/2] Add build message about CMake run. --- make.py | 1 + 1 file changed, 1 insertion(+) diff --git a/make.py b/make.py index f2a7814..cc262c0 100755 --- a/make.py +++ b/make.py @@ -98,6 +98,7 @@ def stage(text): if cmake_build: if not os.path.exists('CMakeCache.txt'): + stage('Configure via CMake') emscripten.Building.configure([emscripten.PYTHON, os.path.join(EMSCRIPTEN_ROOT, 'emcmake'), 'cmake', '..', '-DBUILD_DEMOS=OFF', '-DBUILD_EXTRAS=OFF', '-DBUILD_CPU_DEMOS=OFF', '-DUSE_GLUT=OFF', '-DCMAKE_BUILD_TYPE=Release']) else: if not os.path.exists('config.h'):