O3
This commit is contained in:
parent
7b73c86113
commit
6db338d79b
3 changed files with 22 additions and 6 deletions
14
compile.sh
14
compile.sh
|
|
@ -7,15 +7,23 @@ if [ "$1" = "--debug" ]; then
|
|||
shift
|
||||
fi
|
||||
|
||||
OPTIMIZE_FLAG=""
|
||||
if [ "$1" = "--optimize" ]; then
|
||||
OPTIMIZE_FLAG="-O3"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: ./compile.sh [--debug] <sui_source.sui> [output_name]"
|
||||
echo "Usage: ./compile.sh [--debug] [--optimize] <sui_source.sui> [output_name]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --debug Generate debug printf statements in the C output"
|
||||
echo " --debug Generate debug printf statements in the C output"
|
||||
echo " --optimize Compile with -O3 optimization"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " ./compile.sh tests/structs.sui"
|
||||
echo " ./compile.sh --debug tests/structs.sui"
|
||||
echo " ./compile.sh --optimize tests/structs.sui"
|
||||
echo " ./compile.sh tests/structs.sui my_program"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -59,7 +67,7 @@ ODE_LIBS=$(pkg-config --libs ode 2>/dev/null || echo "-lode -lm")
|
|||
|
||||
# Compile C to executable with raylib and ODE support
|
||||
echo "Compiling C code and linking with libsuicmez, raylib, and ODE..."
|
||||
gcc "$C_FILE" libsuicmez/libsuicmez.c libsuicmez/suicmez_gc.c $RAYLIB_CFLAGS $RAYLIB_LIBS $ODE_CFLAGS $ODE_LIBS -lm -o "$OUTPUT_BINARY" || exit 1
|
||||
gcc $OPTIMIZE_FLAG "$C_FILE" libsuicmez/libsuicmez.c libsuicmez/suicmez_gc.c $RAYLIB_CFLAGS $RAYLIB_LIBS $ODE_CFLAGS $ODE_LIBS -lm -o "$OUTPUT_BINARY" || exit 1
|
||||
|
||||
echo "✓ Successfully created: $OUTPUT_BINARY"
|
||||
echo " Run with: ./$OUTPUT_BINARY"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue