-
Notifications
You must be signed in to change notification settings - Fork 1
/
raylib-config
executable file
·53 lines (48 loc) · 1.13 KB
/
raylib-config
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
#!/bin/sh
set -eu
PROGNAME=$(basename "$0")
usage() {
cat <<EOF
Usage: ${PROGNAME} [desktop|web]
EOF
}
if [ "$#" -eq 0 ]; then
usage 1>&2
exit 1
fi
PLATFORM=
if [ "$1" = 'desktop' ]; then
PLATFORM='desktop'
elif [ "$1" = 'web' ]; then
PLATFORM='web'
else
echo "unknown platform: $1" 1>&2
exit 1
fi
shift
for arg in "$@"; do
case "${arg}" in
-h|--help)
usage
exit 0
;;
*)
echo "unknown option: ${arg}" 2>&1
exit 1
;;
esac
done
if [ "$PLATFORM" = 'desktop' ]; then
if [ $(uname -s) = 'Darwin' ]; then
# Frameworks are added as CFLAGS since sunder-compile does not
# support `-framework` as a command line argument.
echo "-L$(realpath $(dirname $0)) -lraylib -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL"
else
echo "-L$(realpath $(dirname $0)) -lraylib -lGL -lm -lpthread -ldl -lrt -lX11"
fi
elif [ "$PLATFORM" = 'web' ]; then
echo "-L$(realpath $(dirname $0)) -lraylib-web -sASSERTIONS -sASYNCIFY -sUSE_GLFW=3"
else
echo "unknown platform: ${PLATFORM}" 2>&1
exit 1
fi