add debug build options

This commit is contained in:
Sky Johnson 2025-06-13 09:29:56 -05:00
parent bb49ac9275
commit 0729179401

View File

@ -4,11 +4,22 @@ add_project_arguments('-Wno-unused-parameter', language: 'cpp')
zlib = dependency('zlib')
threads = dependency('threads')
if get_option('buildtype') == 'debug'
cpp_flags = ['-O0', '-g', '-Wall', '-Wextra']
link_flags = []
elif get_option('buildtype') == 'debugoptimized'
cpp_flags = ['-O1', '-g', '-Wall', '-Wextra']
link_flags = []
else
cpp_flags = ['-O3', '-march=native', '-flto', '-Wall', '-Wextra', '-DNDEBUG']
link_flags = ['-flto', '-s']
endif
server = executable('server',
'main.cpp',
dependencies: [zlib, threads],
cpp_args: ['-O3', '-march=native', '-flto', '-Wall', '-Wextra', '-DNDEBUG'],
link_args: ['-flto', '-s']
cpp_args: cpp_flags,
link_args: link_flags
)
run_target('run', command: server)