summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-04-03 20:02:00 +0200
committerPeter Fors <peter.fors@mindkiller.com>2025-04-03 20:02:00 +0200
commit6274071e3857c1640cc5aef804cb86509ab312f9 (patch)
tree1a4e56b3c3b4bfb4d8f0d2f588487d6e227c3b27 /build.sh
parent971e51eebbf088f1ac590da1fc57e803eb1ee8cf (diff)
Move to glfw
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/build.sh b/build.sh
index 60de1d1..348700d 100755
--- a/build.sh
+++ b/build.sh
@@ -4,13 +4,14 @@
PROJECT_NAME="mknes" # Change this for each new project
# Base configuration common to all builds
-CFLAGS="-std=gnu11 "
+CFLAGS="-std=gnu++23 "
CFLAGS+="-mavx2 -mbmi2 -mtune=native -mfunction-return=keep -mindirect-branch=keep "
CFLAGS+="-fwrapv -ffast-math -fno-trapping-math -fwhole-program "
CFLAGS+="-fno-stack-protector -fno-PIE -no-pie -fno-strict-aliasing -ffunction-sections -fdata-sections "
+CFLAGS+="-fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-non-call-exceptions "
CFLAGS+="-Wall -Wextra "
CFLAGS+="-Wno-unused-parameter -Wno-sign-compare -Wno-trigraphs -Wno-maybe-uninitialized "
-CFLAGS+="-Wno-unused-variable -Wno-unused-const-variable -Wno-unused-function "
+CFLAGS+="-Wno-unused-variable -Wno-unused-const-variable -Wno-unused-function -Wno-write-strings "
LDFLAGS="-Wl,--gc-sections "
@@ -19,7 +20,7 @@ INCLUDE_PATHS="-Ibase -I.."
# Linux-specific includes and libraries
LINUX_INCLUDE="-I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2"
-LINUX_LIBS="-lpipewire-0.3 -lXi -lX11 -lGL -lm -ldl -pthread"
+LINUX_LIBS="-lpipewire-0.3 -lXi -lX11 -lGL -lm -ldl -pthread -lglfw"
# Windows-specific includes and libraries
# WINDOWS_INCLUDE=""
@@ -56,8 +57,8 @@ esac
#env -C org_assets ../../bin/mks_time ./process.sh
# Make sure the <basecode> shaders are up to date if you are experimenting with them.
-#env -C ../base ../bin/shader2h 140 vertex_shader vertex_shader.glsl
-#env -C ../base ../bin/shader2h 140 fragment_shader shader.h fragment_shader.glsl
+shader2h 330 vertex_shader vertex_shader.glsl
+shader2h 330 fragment_shader shader.h fragment_shader.glsl
# Make sure the compilation stops if any error happens.
set -e
@@ -65,7 +66,7 @@ set -e
# Build Linux version
(
# ../bin/ctime -begin .${PROJECT_NAME}_linux
- gcc $CFLAGS ${PROJECT_NAME}.c -o ${PROJECT_NAME} $INCLUDE_PATHS $LINUX_INCLUDE $LDFLAGS $LINUX_LIBS
+ g++ $CFLAGS ${PROJECT_NAME}.c -o ${PROJECT_NAME} $INCLUDE_PATHS $LINUX_INCLUDE $LDFLAGS $LINUX_LIBS
# ../bin/ctime -end .${PROJECT_NAME}_linux $?
) &