From d8c97ef10051ef4746445b1e50955d795cde4257 Mon Sep 17 00:00:00 2001 From: Guilherme Janczak Date: Sun, 5 Jan 2025 20:51:43 +0000 Subject: [PATCH] don't hardcode /Qspectre based on compiler --- meson.build | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 80bdbdf..f9ffdfd 100644 --- a/meson.build +++ b/meson.build @@ -22,13 +22,12 @@ args = ['-D_GNU_SOURCE'] cc = meson.get_compiler('c') -if cc.get_id() == 'msvc' - # Spectre mitigations are off by default under MSVC for some ungodly reason. - args += '/Qspectre' +# Spectre mitigations are off by default under MSVC for some ungodly reason. +args += cc.get_supported_arguments('/Qspectre') +if host_machine.system() == 'windows' # https://docs.microsoft.com/en-us/cpp/c-runtime-library/multithreaded-libraries-performance?view=msvc-170#maximizing-performance args += '-D_CRT_DISABLE_PERFCRIT_LOCKS' endif - add_project_arguments(args, language: 'c') subdir('compat')