Tweaking the build to turn on various debug options in GCC and enable -Wall -Werror on only our executable configs because turning them on globally causes most of the dependencies to fail. One thing to note is if you try to move the -D_GLIBCXX options from the project() to the executable() then you get segfaults inside the libc++ and other places. This is because the ABI changes when you enable these options, so you have to recompile _all_ dependencies with these options.
This commit is contained in:
parent
4c3049df14
commit
ea3dd204a1
5 changed files with 22 additions and 19 deletions
22
meson.build
22
meson.build
|
@ -1,12 +1,17 @@
|
|||
project('raycaster', 'cpp',
|
||||
default_options: ['cpp_std=c++20'])
|
||||
version: '0.1.0',
|
||||
default_options: [
|
||||
'cpp_std=c++20',
|
||||
'cpp_args=-D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1',
|
||||
])
|
||||
|
||||
exe_defaults = ['warning_level=2', 'werror=true']
|
||||
cc = meson.get_compiler('cpp')
|
||||
|
||||
tracy = dependency('tracy', static: true)
|
||||
catch2 = dependency('catch2-with-main')
|
||||
fmt = dependency('fmt')
|
||||
freetype = dependency('freetype2')
|
||||
fmt = dependency('fmt', allow_fallback: true)
|
||||
freetype2 = dependency('freetype2')
|
||||
json = dependency('nlohmann_json')
|
||||
opengl32 = cc.find_library('opengl32', required: true)
|
||||
winmm = cc.find_library('winmm', required: true)
|
||||
|
@ -23,17 +28,17 @@ if get_option('tracy_enable') and get_option('buildtype') != 'debugoptimized'
|
|||
endif
|
||||
|
||||
dependencies = [
|
||||
fmt, json, opengl32, freetype,
|
||||
fmt, json, opengl32, freetype2,
|
||||
winmm, gdi32, sfml_audio, sfml_graphics,
|
||||
sfml_main, sfml_network, sfml_system,
|
||||
sfml_window
|
||||
sfml_window, tracy
|
||||
]
|
||||
|
||||
executable('runtests', [
|
||||
'dbc.cpp',
|
||||
'matrix.cpp',
|
||||
'tests/base.cpp',
|
||||
],
|
||||
], override_options: exe_defaults,
|
||||
dependencies: dependencies + [catch2])
|
||||
|
||||
executable('zedcaster', [
|
||||
|
@ -45,6 +50,8 @@ executable('zedcaster', [
|
|||
'stats.cpp',
|
||||
'main.cpp'
|
||||
],
|
||||
cpp_args: cpp_args,
|
||||
override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
||||
executable('amtcaster', [
|
||||
|
@ -53,6 +60,5 @@ executable('amtcaster', [
|
|||
'amt/texture.cpp',
|
||||
'amt/raycaster.cpp',
|
||||
'amt/main.cpp'
|
||||
],
|
||||
cpp_args: ['-std=c++23'],
|
||||
], override_options: exe_defaults,
|
||||
dependencies: dependencies)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue