From 16bfe6536b32f6a83fcbf53bd445d222d74fa638 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 2 Aug 2022 23:46:04 +0200 Subject: [PATCH] [meson] use cpp.get_argument_syntax not cpp.get_id To account for both MSVC and clang-cl. Fixes https://github.com/harfbuzz/harfbuzz/issues/3756 --- meson.build | 4 ++-- src/meson.build | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index df4443fb2..e4a38d3f0 100644 --- a/meson.build +++ b/meson.build @@ -21,7 +21,7 @@ pkgmod = import('pkgconfig') cpp = meson.get_compiler('cpp') null_dep = dependency('', required: false) -if cpp.get_id() == 'msvc' +if cpp.get_argument_syntax() == 'msvc' # Ignore several spurious warnings for things HarfBuzz does very commonly. # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once @@ -118,7 +118,7 @@ if not get_option('cairo').disabled() cairo_ft_dep = dependency('cairo-ft', required: false) if (not cairo_dep.found() and - cpp.get_id() == 'msvc' and + cpp.get_argument_syntax() == 'msvc' and cpp.has_header('cairo.h')) cairo_dep = cpp.find_library('cairo', required: false) if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face', diff --git a/src/meson.build b/src/meson.build index cd41f5f4d..5948174d9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -478,7 +478,7 @@ defs_list = [harfbuzz_def] version = '0.@0@.0'.format(hb_version_int) extra_hb_cpp_args = [] -if cpp.get_id() == 'msvc' +if cpp.get_argument_syntax() == 'msvc' if get_option('default_library') != 'static' extra_hb_cpp_args += '-DHB_DLL_EXPORT' endif @@ -548,7 +548,7 @@ libharfbuzz_subset_dep = declare_dependency( if get_option('tests').enabled() # TODO: MSVC gives the following, # error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool" - if cpp.get_id() != 'msvc' + if cpp.get_argument_syntax() != 'msvc' noinst_programs = { 'main': 'main.cc', 'test-basics': 'test.cc', @@ -587,7 +587,7 @@ if get_option('tests').enabled() 'test-bimap': ['test-bimap.cc', 'hb-static.cc'], } foreach name, source : compiled_tests - if cpp.get_id() == 'msvc' and source.contains('hb-static.cc') + if cpp.get_argument_syntax() == 'msvc' and source.contains('hb-static.cc') # TODO: MSVC doesn't like tests having hb-static.cc, fix them continue endif @@ -790,7 +790,7 @@ if get_option('tests').enabled() endforeach env.set('HBHEADERS', ' '.join(HBHEADERS)) - if cpp.get_id() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable + if cpp.get_argument_syntax() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable dist_check_script += ['check-libstdc++', 'check-static-inits', 'check-symbols'] endif