Skip to content

Commit c2cd6eb

Browse files
authored
Merge pull request #1294 from boberfly/fix/gcc11_new_abi
SConstruct : VFX Platform 2023 uses new ABI with GCC 11.2.1
2 parents e942b79 + bcc1fd0 commit c2cd6eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

SConstruct

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,13 @@ if env["PLATFORM"] != "win32" :
11191119

11201120
elif env["PLATFORM"]=="posix" :
11211121
if "g++" in os.path.basename( env["CXX"] ) and not "clang++" in os.path.basename( env["CXX"] ) :
1122-
gccVersion = subprocess.check_output( [ env["CXX"], "-dumpversion" ], env=env["ENV"], universal_newlines=True )
1123-
gccVersion = gccVersion.strip()
1122+
gccVersion = subprocess.check_output( [ env["CXX"], "-dumpversion" ], env=env["ENV"], universal_newlines=True ).strip()
1123+
if "." not in gccVersion :
1124+
# GCC 7 onwards requires `-dumpfullversion` to get minor/patch, but this
1125+
# flag does not exist on earlier GCCs, where minor/patch was provided by `-dumpversion`.
1126+
gccVersion = subprocess.check_output( [ env["CXX"], "-dumpfullversion" ], env=env["ENV"], universal_newlines=True ).strip()
11241127
gccVersion = [ int( v ) for v in gccVersion.split( "." ) ]
1125-
if gccVersion >= [ 5, 1 ] :
1128+
if gccVersion >= [ 5, 1 ] and gccVersion < [ 11, 2 ] :
11261129
env.Append( CXXFLAGS = [ "-D_GLIBCXX_USE_CXX11_ABI=0" ] )
11271130

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

0 commit comments

Comments
 (0)