Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/40861 )

Change subject: scons: Use conf to determine if some flags are supported.
......................................................................

scons: Use conf to determine if some flags are supported.

Use conf rather than checking for particular combinations of OS and/or
compiler versions. This *should* be just as correct, and not require
keeping track of what versions of the tools particular flags were added.

Change-Id: Icaa4c273fe89801e2808e6a814ce476700fd6956
---
M SConstruct
1 file changed, 3 insertions(+), 10 deletions(-)



diff --git a/SConstruct b/SConstruct
index 8a7b48e..868cf5b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -324,10 +324,7 @@
         main.Append(CCFLAGS=['-I/usr/local/include'])
         main.Append(CXXFLAGS=['-I/usr/local/include'])

-    # On Mac OS X/Darwin the default linker doesn't support the
-    # option --as-needed
-    if sys.platform != "darwin":
-        main.Append(LINKFLAGS='-Wl,--as-needed')
+    conf.CheckLinkFlag('-Wl,--as-needed')
     if GetOption('gold_linker'):
         main.Append(LINKFLAGS='-fuse-ld=gold')

@@ -398,12 +395,8 @@
                          # interchangeably.
                          '-Wno-mismatched-tags',
                          ])
-    if sys.platform != "darwin" and \
-       compareVersions(clang_version, "10.0") >= 0:
-        main.Append(CCFLAGS=['-Wno-c99-designator'])
-
-    if compareVersions(clang_version, "8.0") >= 0:
-        main.Append(CCFLAGS=['-Wno-defaulted-function-deleted'])
+    conf.CheckCxxFlag('-Wno-c99-designator')
+    conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

     main.Append(TCMALLOC_CCFLAGS=['-fno-builtin'])


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40861
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icaa4c273fe89801e2808e6a814ce476700fd6956
Gerrit-Change-Number: 40861
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to