Enabling cross compiling if supported by the current system.
This commit is contained in:
parent
1cc47fa4ab
commit
71cb8300bd
@ -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)
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extern/bullet/src)
|
||||||
SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_BULLET})
|
SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_BULLET})
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletDynamics/libBulletDynamics.a)
|
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libBulletDynamics.a)
|
||||||
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletCollision/libBulletCollision.a)
|
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libBulletCollision.a)
|
||||||
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/LinearMath/libLinearMath.a)
|
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/lib/libLinearMath.a)
|
||||||
SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/bullet/build/src/BulletSoftBody/libBulletSoftBody.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})
|
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})
|
||||||
|
11
build.sh
11
build.sh
@ -8,6 +8,13 @@ then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cmake="cmake"
|
||||||
|
|
||||||
|
if [[ $1 == "windows" ]]
|
||||||
|
then
|
||||||
|
cmake=x86_64-w64-mingw32-cmake
|
||||||
|
fi
|
||||||
|
|
||||||
currentDir=$(pwd)
|
currentDir=$(pwd)
|
||||||
threads=$(($(nproc)+1))
|
threads=$(($(nproc)+1))
|
||||||
|
|
||||||
@ -16,7 +23,7 @@ threads=$(($(nproc)+1))
|
|||||||
cd extern/bullet/
|
cd extern/bullet/
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd 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
|
make -j$threads
|
||||||
|
|
||||||
cd $currentDir
|
cd $currentDir
|
||||||
@ -25,5 +32,5 @@ cd $currentDir
|
|||||||
|
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
|
$cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
|
||||||
make -j$threads
|
make -j$threads
|
||||||
|
Loading…
Reference in New Issue
Block a user