<div dir="auto">Are we doing something that particularly requires C++17? AFAIK we haven't needed it yet and why wouldn't it also be needed with gcc? If the default on recent gcc versions is that, ok but we should be precise in case an older gcc with a different default is used.<div dir="auto"><br></div><div dir="auto">This may also eliminate some hoats.</div><div dir="auto"><br></div><div dir="auto">Just asking configuration management type questions.</div><div dir="auto"><br></div><div dir="auto">--jorl</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 21, 2023, 8:31 PM JJL772 <<a href="mailto:jeremy.lorelli.1337@gmail.com">jeremy.lorelli.1337@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
trace/wscript | 8 +++++++-<br>
1 file changed, 7 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/trace/wscript b/trace/wscript<br>
index a3dd5d5..0ae90f8 100644<br>
--- a/trace/wscript<br>
+++ b/trace/wscript<br>
@@ -33,11 +33,14 @@ def options(opt):<br>
def configure(conf):<br>
conf.load('compiler_c')<br>
conf.load('compiler_cxx')<br>
+ needs_cxx17 = False<br>
try:<br>
cppflags = conf.cmd_and_log(['llvm-config', '--cppflags'])<br>
ldflags = conf.cmd_and_log(['llvm-config', '--ldflags'])<br>
conf.env.append_value('CPPFLAGS', cppflags.split())<br>
conf.env.append_value('LDFLAGS', ldflags.split())<br>
+ # llvm 16+ requires C++17 to build<br>
+ needs_cxx17 = int(conf.cmd_and_log(['llvm-config', '--version']).split()[0]) >= 16<br>
except:<br>
pass<br>
if conf.check_cxx(lib = 'LLVM', mandatory=False):<br>
@@ -46,6 +49,7 @@ def configure(conf):<br>
conf.check_cxx(lib = 'z')<br>
conf.check_cxx(lib = 'ws2_32', mandatory=False)<br>
conf.check_cxx(cxxflags='-std=c++14', mandatory=False, define_name="HAVE_STD_CXX14")<br>
+ conf.check_cxx(cxxflags='-std=c++17', mandatory=needs_cxx17, define_name="HAVE_STD_CXX17")<br>
conf.write_config_header('config.h')<br>
<br>
def build(bld):<br>
@@ -63,7 +67,9 @@ def build(bld):<br>
cstd = '-std=c99'<br>
conf['cflags'] = [cstd] + ['-pipe', '-g'] + conf['optflags']<br>
cxxstd = '-std=c++11'<br>
- if bld.env.HAVE_STD_CXX14:<br>
+ if bld.env.HAVE_STD_CXX17:<br>
+ cxxstd = '-std=c++17'<br>
+ elif bld.env.HAVE_STD_CXX14:<br>
cxxstd = '-std=c++14'<br>
conf['cxxflags'] = [cxxstd] + ['-pipe', '-g'] + conf['optflags']<br>
conf['linkflags'] = ['-g']<br>
-- <br>
2.40.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>