We need to disable strict aliasing, but it is weird anyways: https://blog.regehr.org/archives/1307
14 lines
326 B
Bash
Executable File
14 lines
326 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CC=${CC:-"gcc"}
|
|
CFLAGS=${CFLAGS:-"-Wall -Wextra -std=gnu18 -fno-strict-aliasing -g"}
|
|
LDFLAGS=${LDFLAGS:-"-lm"}
|
|
MAIN_FILE=${MAIN_FILE:-"main.c"}
|
|
|
|
# Write out compile_flags.txt for clangd
|
|
echo "${CFLAGS}" | tr ' ' '\n' > compile_flags.txt
|
|
|
|
mkdir -p build
|
|
|
|
${CC} ${CFLAGS} ${MAIN_FILE} -o build/raytracer ${LDFLAGS}
|