Skip to content

Commit d3c511b

Browse files
committed
raylib: test commit, this will be squashed later
correctly detect msvc vs msys envrionment
1 parent f9b1d74 commit d3c511b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

subprojects/packagefiles/raylib/examples/meson.build

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ foreach category, files : examples_list
199199

200200
specific_compile_args = []
201201

202-
if host_machine.system() == 'windows' and not host_is_msys2
202+
if is_msvc_or_similar
203203
# detect wrong dllimport / dllexport declarations and therefore wrong build or public compile arguments
204204
if file in uses_raygui_incorrectly
205205
#some files use ragui, and that also uses the same defines (USE_LIBTYPE_SHARED and BUILD_LIBTYPE_SHARED) as raylib, so it clashes here, this needs to be removed, after upstream fixes this!
@@ -211,7 +211,7 @@ foreach category, files : examples_list
211211

212212

213213
# this example is not supported on windows
214-
if file == 'core/core_loading_thread' and host_machine.system() == 'windows' and not host_is_msys2
214+
if file == 'core/core_loading_thread' and is_msvc_or_similar
215215
continue
216216
endif
217217

@@ -243,7 +243,7 @@ endforeach
243243
if target_platform == 'GLFW'
244244
special_compile_args = example_compile_args
245245

246-
if host_machine.system() == 'windows' and not host_is_msys2
246+
if is_msvc_or_similar
247247
# detect wrong dllimport / dllexport declarations and therefore wrong build or public compile arguments
248248
special_compile_args += '/we4273'
249249
endif

subprojects/packagefiles/raylib/meson.build

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ cc = meson.get_compiler('c')
4949

5050
compile_args += cc.get_supported_arguments('-fno-strict-aliasing')
5151

52-
# Detect if compiling in an MSYS2-based MinGW/Clang environment
53-
host_is_msys2 = host_machine.system() == 'windows' and cc.get_argument_syntax() == 'gcc'
52+
is_msvc_or_similar = host_machine.system() == 'windows' and (cpp.get_id() == 'msvc' or cpp.get_id() == 'clang-cl')
5453

5554
is_shared_lib = get_option('default_library') == 'shared'
5655

0 commit comments

Comments
 (0)