Enabling cross compiling if supported by the current system.

This commit is contained in:
Faerbit 2014-11-24 02:10:25 +01:00
parent 32f6944397
commit 59b3d68b33
2 changed files with 21 additions and 7 deletions

View File

@ -118,11 +118,18 @@ FILE(GLOB_RECURSE HEADER_FILES_BULLET ${CMAKE_SOURCE_DIR}/extern/bullet/src/*.h)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extern/bullet/src)
SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_BULLET})
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletDynamics/libBulletDynamics.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletCollision/libBulletCollision.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/LinearMath/libLinearMath.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletSoftBody/libBulletSoftBody.a)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libBulletDynamics.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libBulletCollision.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libLinearMath.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libBulletSoftBody.a)
SET (LIBRARIES -static ${LIBRARIES} -static-libgcc -static-libstdc++)
else()
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletDynamics/libBulletDynamics.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletCollision/libBulletCollision.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/LinearMath/libLinearMath.a)
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletSoftBody/libBulletSoftBody.a)
endif()
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})

View File

@ -8,6 +8,13 @@ then
exit
fi
cmake="cmake"
if [[ $1 == "windows" ]]
then
cmake=x86_64-w64-mingw32-cmake
fi
currentDir=$(pwd)
threads=$(($(nproc)+1))
@ -16,7 +23,7 @@ threads=$(($(nproc)+1))
cd extern/bullet/
mkdir -p build
cd build
cmake -DBUILD_DEMOS=0 -DBUILD_EXTRAS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
$cmake -DBUILD_DEMOS=0 -DBUILD_EXTRAS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
make -j$threads
cd $currentDir
@ -25,5 +32,5 @@ cd $currentDir
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
$cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
make -j$threads