-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·71 lines (54 loc) · 1.79 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
#!/bin/bash
usage() {
echo Usage: build [Build type: Debug/Release/RelWithDebInfo] [Enable SIMD: True/False] [Enable Tests: True/False] [Dynamic linking: True/False]
exit 1
}
if [ "$1" != Release ] && [ "$1" != Debug ] && [ "$1" != RelWithDebInfo ]; then usage; fi
if [ "$2" != True ] && [ "$2" != False ]; then usage; fi
if [ "$3" != True ] && [ "$3" != False ]; then usage; fi
if [ "$4" != True ] && [ "$4" != False ]; then usage; fi
RED='\033[0;31m'
NC='\033[0m'
if ! conan create packages/dxc -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create DXC failed${NC}\n"
exit 1
fi
if ! conan create packages/spirv_reflect -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create spirv_reflect failed${NC}\n"
exit 1
fi
if ! conan create packages/nvapi -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create nvapi failed${NC}\n"
exit 1
fi
if ! conan create packages/openal_soft -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create openal_soft failed${NC}\n"
exit 1
fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
if ! conan create packages/xdg_shell -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create xdg_shell failed${NC}\n"
exit 1
fi
if ! conan create packages/xdg_decoration -s build_type=$1 --build=missing; then
printf "${RED}-- Conan create xdg_decoration failed${NC}\n"
exit 1
fi
fi
if ! conan build . -s build_type=$1 -o enableSIMD=$2 -o enableTests=$3 -o dynamicLinkingGraphics=$4 ${@:5}; then
printf "${RED}-- Conan build failed${NC}\n"
exit 1
fi
# Run tests
if [ "$3" == True ]; then
cd build/$1/bin
if ! ./OxC3_test ; then
printf "${RED}-- OxC3_test failed${NC}\n"
exit 1
fi
if ! bash ../../../tools/test.sh ; then
printf "${RED}-- test.sh failed${NC}\n"
exit 1
fi
cd ../../..
fi