Debian Codegraph @

test cases/common/289 importstd/meson.build

raw
1 project('importstd', 'cpp', default_options: {'cpp_importstd': 'true',
2 'cpp_std': 'c++latest,c++23,c++20'})
3
4 cpp = meson.get_compiler('cpp')
5
6 cpp_id = cpp.get_id()
7 cpp_version = cpp.version()
8 is_windows = host_machine.system() == 'windows'
9
10 # gcc 16 on Windows fails with "undefined reference to 'std::__open_terminal(_iobuf*)'"
11 # clang 22 + mingw-w64 on Windows fails with "fatal error: module 'std' not found"
12 if not is_windows and cpp_id == 'gcc' and cpp_version.version_compare('>=15.3')
13 # Versions between 15.0 and 15.2 are too unreliable to test.
14 # The same version number of GCC works in some distros
15 # but fails in others.
16 istd_supported = true
17 elif cpp_id == 'msvc' and cpp_version.version_compare('>=19.44.35219')
18 istd_supported = get_option('backend') == 'ninja'
19 else
20 istd_supported = false
21 endif
22
23 if istd_supported
24 useistd = executable('useistd', 'useistd.cpp')
25 test('useistd', useistd)
26
27 else
28 message('Compiler not yet supported, import std test not run.')
29 endif