forked from ProjectPhysX/OpenCL-Wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
12 lines (9 loc) · 773 Bytes
/
make.sh
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash
mkdir -p bin # create directory for executable
rm -f bin/OpenCL-Wrapper # prevent execution of old version if compiling fails
case "$(uname -a)" in # automatically detect operating system
Darwin*) g++ src/*.cpp -o bin/OpenCL-Wrapper -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL ;; # macOS
*Android) g++ src/*.cpp -o bin/OpenCL-Wrapper -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -framework OpenCL ;; # Android
* ) g++ src/*.cpp -o bin/OpenCL-Wrapper -std=c++17 -pthread -O -Wno-comment -I./src/OpenCL/include -L/system/vendor/lib64 -lOpenCL ;; # Linux
esac
if [[ $? == 0 ]]; then bin/OpenCL-Wrapper "$@"; fi # run executable only if last compilation was successful