@@ -16,6 +16,7 @@ if meson.version().version_compare('<0.60.0')
1616 )
1717endif
1818
19+ compile_args = []
1920
2021cpp = meson .get_compiler(' cpp' )
2122if cpp.get_id() == ' msvc'
@@ -27,13 +28,12 @@ elif cpp.get_id() == 'gcc'
2728 )
2829
2930 if host_machine .system() == ' windows'
31+ compile_args += [' -Wno-shadow' ]
3032 add_project_arguments (
3133 ' -Wno-shadow' ,
3234 ' -Wno-complain-wrong-lang' ,
3335 language : ' cpp' ,
3436 )
35-
36- add_global_arguments (' -Wno-shadow' , language : ' cpp' )
3737 endif
3838
3939elif cpp.get_id() == ' clang'
4444
4545deps = []
4646
47- if cpp.get_id() == ' gcc' and host_machine .system() == ' windows'
48- deps += dependency (
49- ' sdl2' ,
50- ' SDL2' ,
51- required : true ,
52- fallback : ' sdl2' ,
53- default_options : [
54- ' buildtype=release' ,
55- ' optimization=3' ,
56- ' strip=true' ,
57- ' b_ndebug=if-release' ,
58- ' cpp_args=-Wno-shadow' ,
59- ],
60- )
61- else
62- deps += dependency (' sdl2' , ' SDL2' , required : true , fallback : ' sdl2' )
63- endif
64-
47+ deps += dependency (' sdl2' , ' SDL2' , required : true , fallback : ' sdl2' )
6548deps += dependency (' sdl2_ttf' , ' SDL2_ttf' , required : true , fallback : ' sdl2_ttf' )
6649deps += dependency (' spdlog' , required : true , fallback : ' spdlog' )
6750deps += dependency (' nlohmann_json' , required : true , fallback : ' nlohmann_json' )
@@ -81,9 +64,7 @@ executable(
8164 src_files,
8265 include_directories : inc_dirs,
8366 dependencies : deps,
84- cpp_args : [
85-
86- ],
67+ cpp_args : compile_args,
8768 override_options : [
8869 ' warning_level=3' ,
8970 ' werror=true' ,
0 commit comments