-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·79 lines (68 loc) · 1.64 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·79 lines (68 loc) · 1.64 KB
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
#! /bin/sh
case $1 in
# wasm32)
# shift
# cross_args="--cross-file=cross/emscripten.txt --cross-file=cross/wasm32.txt"
# ;;
# wasm64)
# shift
# cross_args="--cross-file=cross/emscripten.txt --cross-file=cross/wasm64.txt"
# ;;
clang)
export CC=clang
export CXX=clang++
cross_args=
;;
gcc)
export CC=gcc
export CXX=g++
cross_args=
;;
homebrew-clang)
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
cross_args=
;;
*)
cross_args=
;;
esac
case $1 in
clang)
shift
export CC_FOR_BUILD=clang
export CXX_FOR_BUILD=clang++
meson setup --wipe $cross_args build $@ || exit 1
;;
gcc)
shift
export CC_FOR_BUILD=gcc
export CXX_FOR_BUILD=g++
meson setup --wipe $cross_args build $@ || exit 1
;;
homebrew-clang)
shift
export CC_FOR_BUILD=$(brew --prefix llvm)/bin/clang
export CXX_FOR_BUILD=$(brew --prefix llvm)/bin/clang++
meson setup --wipe $cross_args build $@ || exit 1
;;
msvc)
shift
meson setup --wipe $cross_args build --vsenv $@ || exit 1
;;
auto)
shift
meson setup --wipe $cross_args build $@ || exit 1
;;
*)
echo "./setup.sh <cross target> [native compiler] <setup args>"
echo "examples:"
echo "./setup.sh auto # let meson automatically find the compiler"
echo "./setup.sh msvc"
echo "./setup.sh msvc --buildtype release"
echo "./setup.sh gcc --buildtype debug"
echo "./setup.sh clang --buildtype debugoptimized"
echo "./setup.sh wasm32 gcc # cross compile to wasm32 host-machine, use gcc for build-machine binaries"
exit 1
;;
esac