-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-dist-macos.sh
executable file
·46 lines (38 loc) · 1.09 KB
/
build-dist-macos.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
#!/usr/bin/env bash
# Build OSX from current directory.
echo "Building libkafe for macOS"
mkdir -p build/osx/
cd build/osx
if [[ -z "${KAFE_CC}" ]]; then
if [ -f "/opt/homebrew/opt/llvm/bin/clang" ]; then
export CC=/opt/homebrew/opt/llvm/bin/clang
else
export CC=/usr/local/opt/llvm/bin/clang
fi
echo "Will look for C compiler at ${CC}"
else
echo "Using preset C compiler from environment - KAFE_CC - ${KAFE_CC}"
export CC=${KAFE_CC}
fi
if [[ -z "${KAFE_CXX}" ]]; then
if [ -f "/opt/homebrew/opt/llvm/bin/clang++" ]; then
export CXX=/opt/homebrew/opt/llvm/bin/clang++
else
export CXX=/usr/local/opt/llvm/bin/clang++
fi
echo "Will look for C++ compiler at ${CXX}"
else
echo "Using preset C++ compiler from environment - KAFE_CXX - ${KAFE_CXX}"
export CXX=${KAFE_CXX}
fi
if [ ! -f "${CC}" ]; then
echo "Fail: C compiler not found. Declare explicitly using KAFE_CC environment variable"
exit 1
fi
if [ ! -f "${CXX}" ]; then
echo "Fail: C++ compiler not found. Declare explicitly using KAFE_CXX environment variable"
exit 1
fi
set -xe
cmake ../..
make