diff --git a/meson.build b/meson.build index 621e1b4..b697f42 100644 --- a/meson.build +++ b/meson.build @@ -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)