Force C++17

This commit is contained in:
ownedbywuigi 2026-04-23 07:49:40 +01:00
commit d8cb54ee92

View file

@ -340,12 +340,12 @@ def check_compiler(compiler, language, target):
if info.type in ('clang-cl', 'clang', 'gcc'):
append_flag('-std=gnu99')
# Note: MSVC, while supporting C++11, still reports 199711L for __cplusplus.
# Note: MSVC, while supporting newer standards, still reports 199711L for __cplusplus.
# Note: this is a strict version check because we used to always add
# -std=gnu++11.
# -std=gnu++17.
if info.language == 'C++':
if info.type in ('clang', 'gcc') and info.language_version != 201103:
append_flag('-std=gnu++11')
if info.type in ('clang', 'gcc') and info.language_version != 201703:
append_flag('-std=gnu++17')
# MSVC 2015 headers include C++14 features, but don't guard them
# with appropriate checks.
if info.type == 'clang-cl' and info.language_version != 201402: