[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
This commit is contained in:
parent
ee18ae3b76
commit
16bfe6536b
|
@ -21,7 +21,7 @@ pkgmod = import('pkgconfig')
|
||||||
cpp = meson.get_compiler('cpp')
|
cpp = meson.get_compiler('cpp')
|
||||||
null_dep = dependency('', required: false)
|
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.
|
# 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 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
|
# 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)
|
cairo_ft_dep = dependency('cairo-ft', required: false)
|
||||||
|
|
||||||
if (not cairo_dep.found() and
|
if (not cairo_dep.found() and
|
||||||
cpp.get_id() == 'msvc' and
|
cpp.get_argument_syntax() == 'msvc' and
|
||||||
cpp.has_header('cairo.h'))
|
cpp.has_header('cairo.h'))
|
||||||
cairo_dep = cpp.find_library('cairo', required: false)
|
cairo_dep = cpp.find_library('cairo', required: false)
|
||||||
if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face',
|
if cairo_dep.found() and cpp.has_function('cairo_ft_font_face_create_for_ft_face',
|
||||||
|
|
|
@ -478,7 +478,7 @@ defs_list = [harfbuzz_def]
|
||||||
version = '0.@0@.0'.format(hb_version_int)
|
version = '0.@0@.0'.format(hb_version_int)
|
||||||
|
|
||||||
extra_hb_cpp_args = []
|
extra_hb_cpp_args = []
|
||||||
if cpp.get_id() == 'msvc'
|
if cpp.get_argument_syntax() == 'msvc'
|
||||||
if get_option('default_library') != 'static'
|
if get_option('default_library') != 'static'
|
||||||
extra_hb_cpp_args += '-DHB_DLL_EXPORT'
|
extra_hb_cpp_args += '-DHB_DLL_EXPORT'
|
||||||
endif
|
endif
|
||||||
|
@ -548,7 +548,7 @@ libharfbuzz_subset_dep = declare_dependency(
|
||||||
if get_option('tests').enabled()
|
if get_option('tests').enabled()
|
||||||
# TODO: MSVC gives the following,
|
# TODO: MSVC gives the following,
|
||||||
# error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool"
|
# error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool"
|
||||||
if cpp.get_id() != 'msvc'
|
if cpp.get_argument_syntax() != 'msvc'
|
||||||
noinst_programs = {
|
noinst_programs = {
|
||||||
'main': 'main.cc',
|
'main': 'main.cc',
|
||||||
'test-basics': 'test.cc',
|
'test-basics': 'test.cc',
|
||||||
|
@ -587,7 +587,7 @@ if get_option('tests').enabled()
|
||||||
'test-bimap': ['test-bimap.cc', 'hb-static.cc'],
|
'test-bimap': ['test-bimap.cc', 'hb-static.cc'],
|
||||||
}
|
}
|
||||||
foreach name, source : compiled_tests
|
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
|
# TODO: MSVC doesn't like tests having hb-static.cc, fix them
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
@ -790,7 +790,7 @@ if get_option('tests').enabled()
|
||||||
endforeach
|
endforeach
|
||||||
env.set('HBHEADERS', ' '.join(HBHEADERS))
|
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']
|
dist_check_script += ['check-libstdc++', 'check-static-inits', 'check-symbols']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue