From b7446aad89f8b346f424df899351c9a2703a9b45 Mon Sep 17 00:00:00 2001 From: s0600204 Date: Sat, 21 Oct 2023 22:57:35 +0100 Subject: [PATCH] Don't add a MSVC-style flag if not using MSVC on windows This fixes builds on Windows when, for instance, one is using `clang` on top of `MSys2`; and in a more generic way than the pre-existing solution. For expected return values of the `get_argument_syntax()` method, see https://mesonbuild.com/Reference-tables.html#compiler-ids --- rtmidi/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtmidi/meson.build b/rtmidi/meson.build index f96a95c2..42585d2a 100644 --- a/rtmidi/meson.build +++ b/rtmidi/meson.build @@ -26,7 +26,7 @@ endif if winmm_support defines += ['-D__WINDOWS_MM__'] - if meson.get_compiler('cpp').get_id() != 'gcc' + if meson.get_compiler('cpp').get_argument_syntax() == 'msvc' defines += ['/EHsc'] endif dependencies += [winmm_dep]