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

Change subject: scons: Simplify the clang version check.
......................................................................

scons: Simplify the clang version check.

Use the -dumpversion option which just prints the version with no other
text. This is what we were already doing for gcc and avoids having to
use any regular expressions.

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



diff --git a/SConstruct b/SConstruct
index 32ebb87..706653b 100755
--- a/SConstruct
+++ b/SConstruct
@@ -78,7 +78,6 @@
 # Global Python includes
 import atexit
 import os
-import re
 import sys

 from os import mkdir, environ
@@ -368,15 +367,10 @@
                                   '-fno-builtin-realloc', '-fno-builtin-free'])

 elif main['CLANG']:
-    clang_version_re = re.compile(".* version (\d+\.\d+)")
-    clang_version_match = clang_version_re.search(CXX_version)
-    if (clang_version_match):
-        clang_version = clang_version_match.groups()[0]
-        if compareVersions(clang_version, "3.9") < 0:
-            error('clang version 3.9 or newer required.\n'
-                  'Installed version:', clang_version)
-    else:
-        error('Unable to determine clang version.')
+ clang_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
+    if compareVersions(clang_version, "3.9") < 0:
+        error('clang version 3.9 or newer required.\n'
+              'Installed version:', clang_version)

     # clang has a few additional warnings that we disable.
     conf.CheckCxxFlag('-Wno-c99-designator')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40959
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: I7b9fa96c7c3c10701fef51f8c0b3b075cd2fb23c
Gerrit-Change-Number: 40959
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to