Had to bring back the static options so that meson actually builds it as static.

This commit is contained in:
Zed A. Shaw 2026-04-03 12:15:25 -04:00
parent c14e244084
commit 514bfec0ea
2 changed files with 19 additions and 7 deletions

View file

@ -41,20 +41,20 @@ test: build
run: build test run: build test
ifeq '$(OS)' 'Windows_NT' ifeq '$(OS)' 'Windows_NT'
powershell "cp ./builddir/zedcaster.exe ." powershell "cp ./builddir/under_the_dome.exe ."
./zedcaster ./under_the_dome
else else
./builddir/zedcaster ./builddir/under_the_dome
endif endif
debug: build debug: build
gdb --nx -x .gdbinit --ex run --args builddir/runtests gdb --nx -x .gdbinit --ex run --args builddir/runtests
debug_run: build debug_run: build
gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/zedcaster gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/under_the_dome
debug_walk: build test debug_walk: build test
gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/zedcaster t gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/under_the_dome t
clean: clean:
meson compile --clean -C builddir meson compile --clean -C builddir

View file

@ -1,5 +1,5 @@
project('raycaster', 'cpp', project('under_the_dome', 'cpp',
version: '0.1.0', version: '0.1.0',
default_options: [ default_options: [
'cpp_std=c++23', 'cpp_std=c++23',
@ -22,6 +22,14 @@ cc = meson.get_compiler('cpp')
dependencies = [] dependencies = []
if build_machine.system() == 'windows' if build_machine.system() == 'windows'
add_global_link_arguments(
'-static-libgcc',
'-static-libstdc++',
'-static',
'-flto',
language: 'cpp',
)
sfml_main = subproject('sfml').get_variable('sfml_main_dep') sfml_main = subproject('sfml').get_variable('sfml_main_dep')
opengl32 = cc.find_library('opengl32', required: true) opengl32 = cc.find_library('opengl32', required: true)
winmm = cc.find_library('winmm', required: true) winmm = cc.find_library('winmm', required: true)
@ -33,6 +41,10 @@ if build_machine.system() == 'windows'
exe_defaults += ['werror=true'] exe_defaults += ['werror=true']
elif build_machine.system() == 'darwin' elif build_machine.system() == 'darwin'
add_global_link_arguments(
language: 'cpp',
)
opengl = dependency('OpenGL') opengl = dependency('OpenGL')
corefoundation = dependency('CoreFoundation') corefoundation = dependency('CoreFoundation')
carbon = dependency('Carbon') carbon = dependency('Carbon')
@ -97,7 +109,7 @@ executable('runtests', sources + tests,
override_options: exe_defaults, override_options: exe_defaults,
dependencies: dependencies + [catch2]) dependencies: dependencies + [catch2])
executable('zedcaster', executable('under_the_dome',
[ 'src/main.cpp' ], [ 'src/main.cpp' ],
cpp_args: cpp_args, cpp_args: cpp_args,
link_args: link_args, link_args: link_args,