meson: Use cc.get_argument_syntax instead cc.get_id when possible.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17065>
This commit is contained in:
Yonggang Luo 2022-04-21 14:06:17 +08:00 committed by Marge Bot
parent 1173c0f33a
commit 2d934ac110
3 changed files with 7 additions and 7 deletions

View File

@ -1108,7 +1108,7 @@ elif host_machine.system() == 'windows'
'-DPIPE_SUBSYSTEM_WINDOWS_USER',
'-D_USE_MATH_DEFINES', # XXX: scons didn't use this for mingw
]
if cc.get_id() == 'msvc'
if cc.get_argument_syntax() == 'msvc'
pre_args += [
'-DVC_EXTRALEAN',
'-D_CRT_SECURE_NO_WARNINGS',
@ -1141,7 +1141,7 @@ endif
c_msvc_compat_args = []
no_override_init_args = []
cpp_msvc_compat_args = []
if cc.get_id() == 'msvc'
if cc.get_argument_syntax() == 'msvc'
_trial = [
'/wd4018', # signed/unsigned mismatch
'/wd4056', # overflow in floating-point constant arithmetic
@ -1203,7 +1203,7 @@ else
]
# MinGW chokes on format specifiers and I can't get it all working
if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows')
if not (cc.get_argument_syntax() == 'gcc' and host_machine.system() == 'windows')
_trial_c += ['-Werror=format', '-Wformat-security']
_trial_cpp += ['-Werror=format', '-Wformat-security']
endif
@ -1247,7 +1247,7 @@ endif
# set linker arguments
if host_machine.system() == 'windows'
if cc.get_id() == 'msvc'
if cc.get_argument_syntax() == 'msvc'
add_project_link_arguments(
'/fixed:no',
'/dynamicbase',
@ -1282,7 +1282,7 @@ if host_machine.system() == 'windows'
endif
endif
if host_machine.cpu_family().startswith('x86') and cc.get_id() != 'msvc'
if host_machine.cpu_family().startswith('x86') and cc.get_argument_syntax() != 'msvc'
pre_args += '-DUSE_SSE41'
with_sse41 = true
sse41_args = ['-msse4.1']

View File

@ -1,7 +1,7 @@
inc_d3d10umd = include_directories('.')
_c_args_d3d10umd = []
if cc.get_id() == 'gcc'
if cc.get_argument_syntax() == 'gcc'
_c_args_d3d10umd += '-Wno-unknown-pragmas'
endif

View File

@ -58,7 +58,7 @@ sha1_h = custom_target(
)
subdir('gtest')
if cc.get_id() == 'msvc'
if cc.get_argument_syntax() == 'msvc'
subdir('getopt')
else
idep_getopt = null_dep