* Fix 64 bit native bullet compile on windows. 64 bit build requires using mingw-w64 instead of mingw32. Also if mingw-w64 is used, both 32 bit and 64 bit are supported.

* Add note regarding requirement to use GCC 4.7.3 when compiling native bullet on windows, since 4.8.1 crashes with segmentation fault

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10835 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
sha..RD 11 years ago
parent cc2d4cd83f
commit 2abf8218be
  1. 10
      engine/bullet-native-build.txt
  2. 41
      engine/nbproject/build-bullet-natives.xml

@ -19,7 +19,7 @@ ALL PLATFORMS
- Android NDK (optional): http://developer.android.com/sdk/ndk/index.html - Android NDK (optional): http://developer.android.com/sdk/ndk/index.html
WINDOWS WINDOWS
- Install mingw GNU C++ Compiler: http://www.mingw.org/ - Install mingw-w64 GNU C++ Compiler: http://mingw-w64.sourceforge.net/
- Install CMake: http://www.cmake.org/ - Install CMake: http://www.cmake.org/
Mac OSX Mac OSX
@ -136,10 +136,14 @@ Commands:
Building on WINDOWS (MinGW/GCC, Recommended) Building on WINDOWS (MinGW/GCC, Recommended)
----------------------------------- -----------------------------------
Requirements: Requirements:
- GNU C++ Compiler: http://www.mingw.org/ - GNU C++ Compiler: http://mingw-w64.sourceforge.net/
http://mingw-w64.sourceforge.net/ http://sourceforge.net/projects/mingwbuilds/
- CMake: http://www.cmake.org/ - CMake: http://www.cmake.org/
NOTE: At this time compiling with GCC 4.8.1 fails with a segmentation fault.
You must use an older GCC version like 4.7.3.
The second link above (mingwbuilds) offers snapshots of MinGW for GCC 4.7.3.
Commands: Commands:
> cd bullet-trunk > cd bullet-trunk
> cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles" > cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"

@ -441,11 +441,12 @@
<includepath path="${bullet.java.include}"/> <includepath path="${bullet.java.include}"/>
<includepath path="${bullet.java.include}/win32"/> <includepath path="${bullet.java.include}/win32"/>
<includepath path="${bullet.bullet.include}"/> <includepath path="${bullet.bullet.include}"/>
<!--compilerarg value="-m32"/--> <compilerarg value="-m32"/>
<linker name="${bullet.windows.compiler}" debug="${bullet.compile.debug}" > <linker name="${bullet.windows.compiler}" debug="${bullet.compile.debug}" >
<linkerarg value="-o${bullet.library.name}.dll" /> <linkerarg value="-o${bullet.library.name}.dll" />
<linkerarg value="--kill-at" /> <linkerarg value="--kill-at" />
<linkerarg value="-static"/> <linkerarg value="-static"/>
<linkerarg value="-m32"/>
<libset dir="build/bullet-base" libs="BulletMultiThreaded,BulletDynamics,BulletCollision,LinearMath"/> <libset dir="build/bullet-base" libs="BulletMultiThreaded,BulletDynamics,BulletCollision,LinearMath"/>
</linker> </linker>
</cc> </cc>
@ -455,7 +456,7 @@
<target name="-nativelib-windows-64" if="doBuildWindowsBinary64"> <target name="-nativelib-windows-64" if="doBuildWindowsBinary64">
<echo message="Building Windows 64bit version of native bullet"/> <echo message="Building Windows 64bit version of native bullet"/>
<mkdir dir="${bullet.output.dir}/windows"/> <mkdir dir="${bullet.output.dir}/windows"/>
<cc multithreaded="" name="${bullet.windows.compiler}" warnings="none" debug="${bullet.compile.debug}" outtype="shared" outfile="${bullet.output.dir}/windows/${bullet.library.name}64" objdir="build/bullet-native"> <cc multithreaded="" name="${bullet.windows.compiler}" warnings="none" debug="${bullet.compile.debug}" outtype="shared" outfile="${bullet.output.dir}/windows/${bullet.library.name}64" objdir="build/bullet-native-64">
<compilerarg value="-fpermissive"/> <compilerarg value="-fpermissive"/>
<fileset dir="${bullet.source.dir}"> <fileset dir="${bullet.source.dir}">
<include name="*.cpp"> <include name="*.cpp">
@ -464,12 +465,13 @@
<includepath path="${bullet.java.include}"/> <includepath path="${bullet.java.include}"/>
<includepath path="${bullet.java.include}/win32"/> <includepath path="${bullet.java.include}/win32"/>
<includepath path="${bullet.bullet.include}"/> <includepath path="${bullet.bullet.include}"/>
<!--compilerarg value="-m32"/--> <compilerarg value="-m64"/>
<linker name="${bullet.windows.compiler}" debug="${bullet.compile.debug}" > <linker name="${bullet.windows.compiler}" debug="${bullet.compile.debug}" >
<linkerarg value="-o${bullet.library.name}64.dll" /> <linkerarg value="-o${bullet.library.name}64.dll" />
<linkerarg value="--kill-at" /> <linkerarg value="--kill-at" />
<linkerarg value="-static"/> <linkerarg value="-static"/>
<libset dir="build/bullet-base" libs="BulletMultiThreaded,BulletDynamics,BulletCollision,LinearMath"/> <linkerarg value="-m64"/>
<libset dir="build/bullet-base-64" libs="BulletMultiThreaded,BulletDynamics,BulletCollision,LinearMath"/>
</linker> </linker>
</cc> </cc>
<delete file="${bullet.output.dir}/windows/history.xml"/> <delete file="${bullet.output.dir}/windows/history.xml"/>
@ -520,7 +522,7 @@
<available file="${ndk.dir}/${ndk-build-name}" property="haveAndoidNdk"/> <available file="${ndk.dir}/${ndk-build-name}" property="haveAndoidNdk"/>
</target> </target>
<target name="compile-bullet-sources" description="downloads and compiles the bullet native library to static binaries to be included in the final libbulletjme" depends="-check-conditions-pre, -get-bullet-sources, -compile-bullet-sources-windows, -compile-bullet-sources-macosx, -compile-bullet-sources-linux, -compile-bullet-sources-linux-64, -compile-bullet-sources-linux-mingw, -compile-bullet-sources-linux-mingw-64"/> <target name="compile-bullet-sources" description="downloads and compiles the bullet native library to static binaries to be included in the final libbulletjme" depends="-check-conditions-pre, -get-bullet-sources, -compile-bullet-sources-windows, -compile-bullet-sources-windows-64, -compile-bullet-sources-macosx, -compile-bullet-sources-linux, -compile-bullet-sources-linux-64, -compile-bullet-sources-linux-mingw, -compile-bullet-sources-linux-mingw-64"/>
<target name="-get-bullet-sources" unless="haveBulletSource"> <target name="-get-bullet-sources" unless="haveBulletSource">
<echo>Downloading bullet source..</echo> <echo>Downloading bullet source..</echo>
@ -541,8 +543,33 @@
<arg value="-DBUILD_EXTRAS:BOOL=OFF"/> <arg value="-DBUILD_EXTRAS:BOOL=OFF"/>
<arg value="-DBUILD_DEMOS:BOOL=OFF"/> <arg value="-DBUILD_DEMOS:BOOL=OFF"/>
<arg value="-DCMAKE_BUILD_TYPE=Release"/> <arg value="-DCMAKE_BUILD_TYPE=Release"/>
<arg value="-DCMAKE_CXX_FLAGS=-fpermissive"/> <arg value="-DCMAKE_C_FLAGS=-m32 -fpermissive"/>
<arg value="-DCMAKE_CXX_FLAGS=-m32 -fpermissive"/>
<arg value="-DCMAKE_LD_FLAGS=-m32"/>
<arg value="."/>
<arg value="-G"/>
<arg value="MinGW Makefiles"/>
</exec>
<exec executable="${make.windows}" dir="${bullet.folder}"/>
</target>
<target name="-compile-bullet-sources-windows-64" if="doBuildWindowsBase64">
<mkdir dir="build/bullet-base-64"/>
<property location="build/bullet-base-64" name="build64.folder.resolved"/>
<replace file="${bullet.folder}/CMakeLists.txt" token="#TODO add better GLUT detection for MinGW" value=" INCLUDE_DIRECTORIES($${BULLET_PHYSICS_SOURCE_DIR}/Glut)${line.separator}SET(GLUT_glut_LIBRARY $${BULLET_PHYSICS_SOURCE_DIR}/Glut/glut32.lib)"/>
<exec executable="${cmake.windows}" dir="${bullet.folder}" failonerror="true">
<arg value="."/>
<arg value="-DLIBRARY_OUTPUT_PATH='${build64.folder.resolved}'"/>
<arg value="-DBUILD_SHARED_LIBS=OFF"/>
<arg value="-DBUILD_MULTITHREADING=ON"/>
<arg value="-DBUILD_EXTRAS:BOOL=OFF"/>
<arg value="-DBUILD_DEMOS:BOOL=OFF"/>
<arg value="-DCMAKE_BUILD_TYPE=Release"/>
<arg value="-DCMAKE_C_FLAGS=-m64 -fpermissive"/>
<arg value="-DCMAKE_CXX_FLAGS=-m64 -fpermissive"/>
<arg value="-DCMAKE_LD_FLAGS=-m64"/>
<arg value="."/> <arg value="."/>
<arg value="-G"/> <arg value="-G"/>
<arg value="MinGW Makefiles"/> <arg value="MinGW Makefiles"/>

Loading…
Cancel
Save