Skip to content

Commit 0542c71

Browse files
committed
SConstruct : Avoid matching clang with "g++" in basename(CXX)
1 parent ab53e30 commit 0542c71

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SConstruct

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ if env["PLATFORM"] != "win32" :
11101110
env.Append( CXXFLAGS = [ "-Wno-unused-local-typedef", "-Wno-deprecated-declarations" ] )
11111111

11121112
elif env["PLATFORM"]=="posix" :
1113-
if "g++" in os.path.basename( env["CXX"] ) :
1113+
if "g++" in os.path.basename( env["CXX"] ) and not "clang++" in os.path.basename( env["CXX"] ) :
11141114
gccVersion = subprocess.check_output( [ env["CXX"], "-dumpversion" ], env=env["ENV"], universal_newlines=True )
11151115
gccVersion = gccVersion.strip()
11161116
gccVersion = [ int( v ) for v in gccVersion.split( "." ) ]
@@ -1119,14 +1119,14 @@ if env["PLATFORM"] != "win32" :
11191119

11201120
env.Append( CXXFLAGS = [ "-std=$CXXSTD", "-fvisibility=hidden" ] )
11211121

1122-
if "g++" in os.path.basename( env["CXX"] ) :
1123-
# Turn off the parts of `-Wextra` that we don't like.
1124-
env.Append( CXXFLAGS = [ "-Wno-cast-function-type", "-Wno-unused-parameter" ] )
1125-
11261122
if "clang++" in os.path.basename( env["CXX"] ) :
11271123
# Turn off the parts of `-Wall` and `-Wextra` that we don't like.
11281124
env.Append( CXXFLAGS = ["-Wno-unused-local-typedef", "-Wno-unused-parameter"] )
11291125

1126+
elif "g++" in os.path.basename( env["CXX"] ) :
1127+
# Turn off the parts of `-Wextra` that we don't like.
1128+
env.Append( CXXFLAGS = [ "-Wno-cast-function-type", "-Wno-unused-parameter" ] )
1129+
11301130
if env["ASAN"] :
11311131
env.Append(
11321132
CXXFLAGS = [ "-fsanitize=address" ],

0 commit comments

Comments
 (0)