From e29963551152b2094211cf8455c5b026e8aff566 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 15 Sep 2024 00:14:51 +0200 Subject: [PATCH] Allow to explicitly request C++11/17 --- wscript | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index f6d13854d6..5122e9a469 100644 --- a/wscript +++ b/wscript @@ -566,10 +566,16 @@ int main() { return 0; }''', cxx_flags.append('--stdlib=libc++') linker_flags.append('--stdlib=libc++') - if conf.options.cxx17 or conf.env['build_host'] in [ 'bigsur', 'monterey', 'ventura', 'sonoma' ]: + if conf.options.cxx17: conf.check_cxx(cxxflags=["-std=c++17"]) cxx_flags.append('-std=c++17') - elif conf.options.cxx11 or conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra', 'high_sierra', 'mojave', 'catalina' ]: + elif conf.options.cxx11: + conf.check_cxx(cxxflags=["-std=c++11"]) + cxx_flags.append('-std=c++11') + elif conf.env['build_host'] in [ 'bigsur', 'monterey', 'ventura', 'sonoma' ]: + conf.check_cxx(cxxflags=["-std=c++17"]) + cxx_flags.append('-std=c++17') + elif conf.env['build_host'] in [ 'mavericks', 'yosemite', 'el_capitan', 'sierra', 'high_sierra', 'mojave', 'catalina' ]: conf.check_cxx(cxxflags=["-std=c++11"]) cxx_flags.append('-std=c++11')