Skip to content

Commit

Permalink
don't hardcode /Qspectre based on compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
guijan committed Jan 5, 2025
1 parent 66b3db7 commit d8c97ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d8c97ef

Please sign in to comment.