3 # Compilers, and cache wrapper
4 # ----------------------------
7 compiler_cache
="ccache"
9 # Autodetect ccache unavailible
10 if ! [ -x "$( command -v $compiler_cache )" ]; then
19 compiler_prefix
="x86_64-w64-mingw32-"
22 echo "CXR_GNU_LINUX=0" > platform.py
25 target_os_gnu_linux
(){
30 asan
="-fsanitize=address"
32 echo "CXR_GNU_LINUX=1" > platform.py
36 cmd
="$compiler_prefix$@"
42 error
"Compile failed"
47 # Commandline arguments
48 # ---------------------
49 if [[ $1 == "windows" ]]; then
55 # Actual compiler commands
57 # <compiler> optimisation level, output type
66 compile
$C -O1 -ggdb -fPIC -shared \
67 -Wall -Wno-unused-variable -Wno-unused-function -std=c99
-pedantic \
68 -DCXR_SO -DCXR_DEBUG -DCXR_VALVE_MAP_FILE -DCXR_VALVE_BIN \
75 -o nbvtf
/obj
/librgbcx.o
83 compile
$CXX -O3 -fPIC -c \
84 -DUSE_LIBRGBCX -DNBVTF_AS_SO \
86 -o nbvtf
/obj
/libnbvtf.o
88 compile
$CXX -O3 -shared \
89 nbvtf
/obj
/librgbcx.o nbvtf
/obj
/libnbvtf.o \
93 -Wno-unused-variable -Wno-unused-function $asan -Werror=vla \
94 nbvtf
/obj
/tovtf.o nbvtf
/obj
/librgbcx.o \
98 # This is for testing with asan on linux
99 compile
$C -ggdb -O0 -Wall \
100 -Wno-unused-variable -Wno-unused-function $asan -Werror=vla \
101 -DCXR_SO -DCXR_DEBUG -DCXR_VALVE_MAP_FILE \