-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·92 lines (85 loc) · 1.69 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
WINDOWS=1
OSX=1
RELEASE=0
ANDROID_NDK=""
VK_SDK="$(pwd)/common/windows/VulkanSDK"
CLEAN=1
PROFILE=0
while [[ $# -gt 0 ]]; do
case $1 in
-w|--windows)
WINDOWS=0
shift # past argument
;;
-o|--osx)
OSX=0
shift
;;
-r|--release)
RELEASE=1
shift
;;
--vk)
VK_SDK=$2
shift
shift
;;
-c|--continue)
CLEAN=0
shift
;;
-p|--profile)
PROFILE=1
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
if [[ $CLEAN -eq 1 ]];
then
if [ -d build ];
then
rm -rf build
fi
mkdir build
STATUS=0
if [[ $WINDOWS -eq 0 ]];
then
export VULKAN_SDK=$VK_SDK/Windows
export VULKAN_LIBRARY="$VK_SDK/Windows/Lib"
export VULKAN_INCLUDE_DIR="$VK_SDK/Windows/Include"
if [ ! -f "$VK_SDK/Windows/Lib" ]; then ln -s "$VK_SDK/Windows/Lib" "$VK_SDK/Windows/lib"; fi
if [ ! -f "$VK_SDK/Include" ]; then ln -s "$VK_SDK/Include" "$VK_SDK/Windows/Include"; fi
if [ ! -f "$VK_SDK/Windows/Include" ]; then ln -s "$VK_SDK/Windows/Include" "$VK_SDK/Windows/include"; fi
cd build
pwd
cmake .. -D WINDOWS=ON -D RELEASE=$RELEASE -D CMAKE_TOOLCHAIN_FILE=../windows.cmake && make -j 4
STATUS=$?
cd ..
cp common/windows/*.dll build/
elif [[ $OSX -eq 0 ]];
then
cd build
cmake .. -D OSX=ON -D RELEASE=$RELEASE -D CMAKE_TOOLCHAIN_FILE=../osx.cmake && make -j 4
STATUS=$?
cd ..
else
cd build
cmake -D PROFILE=$PROFILE -D RELEASE=$RELEASE .. && make -j 4
STATUS=$?
cd ..
fi
else
cd build && make -j 4
STATUS=$?
cd ..
fi
exit $STATUS