working on getting right flags to compiler for OS
parent
2723d6df12
commit
613361ddb7
|
@ -1,7 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Building custom_4coders.so from $SOURCE ..."
|
||||
|
||||
# Find the code home folder
|
||||
|
||||
# NOTE(allen): Copied from stack exchange, hope it's reasonable -- readlink doesn't work on mac
|
||||
|
@ -38,6 +36,7 @@ done
|
|||
PHYS_DIR=`pwd -P`
|
||||
SOURCE=$PHYS_DIR/$TARGET_FILE
|
||||
|
||||
echo "Building custom_4coders.so from $SOURCE"
|
||||
FLAGS="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-writable-strings"
|
||||
g++ -I"$CODE_HOME" $FLAGS -std=gnu++0x "$SOURCE" -shared -o custom_4coder.so -fPIC
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
os="unknown"
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo "mac"
|
||||
elif [[ "$OSTYPE" == "linux-gnu" ]]; then
|
||||
echo "linux"
|
||||
fi
|
||||
|
|
@ -246,20 +246,28 @@ build_cl(u32 flags, char *code_path, char *code_file, char *out_path, char *out_
|
|||
}
|
||||
|
||||
#if defined(IS_LINUX)
|
||||
|
||||
# error IS_LINUX
|
||||
|
||||
# define GCC_OPTS \
|
||||
"-Wno-write-strings " \
|
||||
"-D_GNU_SOURCE -fPIC " \
|
||||
"-fno-threadsafe-statics -pthread"
|
||||
|
||||
#define GCC_LIBS \
|
||||
"-L/usr/local/lib -lX11 -lpthread -lm -lrt " \
|
||||
"-lGL -ldl -lXfixes -lfreetype -lfontconfig"
|
||||
|
||||
#elif defined(IS_MAC)
|
||||
|
||||
# define GCC_OPTS \
|
||||
"-Wno-write-strings -Wno-deprecated-declarations " \
|
||||
"-Wno-comment -Wno-switch -Wno-null-dereference "
|
||||
|
||||
#define GCC_LIBS \
|
||||
"-framework Cocoa -framework QuartzCore " \
|
||||
"-framework OpenGL -framework IOKit"
|
||||
|
||||
#else
|
||||
# error gcc options not set for this platform
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue