2014-10-24 10:02:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-11-05 11:46:36 +00:00
|
|
|
if [[ $1 == "clean" ]]
|
|
|
|
then
|
|
|
|
rm -rf build
|
|
|
|
rm -rf binaries
|
|
|
|
rm -rf extern/bullet/build
|
2015-02-24 10:02:24 +00:00
|
|
|
cd extern/lua; make clean; cd ../..
|
2014-11-05 11:46:36 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2014-11-24 01:10:25 +00:00
|
|
|
cmake="cmake"
|
|
|
|
|
|
|
|
if [[ $1 == "windows" ]]
|
|
|
|
then
|
2014-11-26 22:57:33 +00:00
|
|
|
cmake="cmake -DCMAKE_SYSTEM_NAME='Windows' -DCMAKE_FIND_ROOT_PATH='/usr/bin:/usr/x86_64-w64-mingw32' -DCMAKE_CXX_COMPILER='x86_64-w64-mingw32-g++' -DCMAKE_C_COMPILER='x86_64-w64-mingw32-gcc'"
|
2014-11-24 01:10:25 +00:00
|
|
|
fi
|
|
|
|
|
2014-10-25 23:05:21 +00:00
|
|
|
currentDir=$(pwd)
|
2014-11-04 11:56:13 +00:00
|
|
|
threads=$(($(nproc)+1))
|
2014-10-24 10:02:24 +00:00
|
|
|
|
2015-01-15 16:26:37 +00:00
|
|
|
#building lua
|
|
|
|
|
|
|
|
cd extern/lua/
|
|
|
|
if [[ $1 == "windows" ]]
|
|
|
|
then
|
|
|
|
make mingw
|
|
|
|
else
|
|
|
|
make linux
|
|
|
|
fi
|
|
|
|
cd $currentDir
|
|
|
|
|
|
|
|
|
2014-10-24 10:02:24 +00:00
|
|
|
#building bullet
|
|
|
|
|
|
|
|
cd extern/bullet/
|
|
|
|
mkdir -p build
|
2014-10-25 23:05:21 +00:00
|
|
|
cd build
|
2014-11-24 18:54:13 +00:00
|
|
|
if hash ninja 2>/dev/null
|
2014-11-24 14:59:59 +00:00
|
|
|
then
|
|
|
|
$cmake -DBUILD_DEMOS=0 -DBUILD_EXTRAS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -GNinja ..
|
|
|
|
ninja
|
|
|
|
else
|
|
|
|
$cmake -DBUILD_DEMOS=0 -DBUILD_EXTRAS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
|
|
|
|
make -j$threads
|
|
|
|
fi
|
2014-10-24 10:02:24 +00:00
|
|
|
|
|
|
|
cd $currentDir
|
|
|
|
|
|
|
|
#Building app
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
2014-11-24 18:54:13 +00:00
|
|
|
if hash ninja 2>/dev/null
|
2014-11-24 14:59:59 +00:00
|
|
|
then
|
2014-12-01 12:16:04 +00:00
|
|
|
$cmake -DGLFW_BUILD_EXAMPLES=0 -DGLFW_BUILD_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -GNinja ..
|
2014-11-24 14:59:59 +00:00
|
|
|
ninja
|
|
|
|
else
|
2014-12-01 12:16:04 +00:00
|
|
|
$cmake -DGLFW_BUILD_EXAMPLES=0 -DGLFW_BUILD_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 ..
|
2014-11-24 14:59:59 +00:00
|
|
|
make -j$threads
|
|
|
|
fi
|