Skip to content

Commit d525b46

Browse files
committed
Use C++11 for macOS and CS:GO.
1 parent 333227f commit d525b46

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

AMBuildScript

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,27 @@ class SMConfig(object):
551551
compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE']
552552

553553
if builder.target.platform == 'linux':
554-
if sdk.name in ['csgo', 'blade']:
555-
compiler.linkflags.remove('-static-libstdc++')
556-
compiler.linkflags += ['-lstdc++']
557-
compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0']
554+
if sdk.name in ['csgo', 'blade']:
555+
compiler.linkflags.remove('-static-libstdc++')
556+
compiler.linkflags += ['-lstdc++']
557+
compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0']
558+
elif builder.target.platform == 'mac':
559+
if sdk.name in ['csgo']:
560+
# Switch libc++ to libstdc++ for protobuf linkage.
561+
compiler.cxxflags.remove('-stdlib=libc++')
562+
compiler.linkflags.remove('-stdlib=libc++')
563+
compiler.linkflags.remove('-lc++')
564+
565+
compiler.cxxflags += ['-stdlib=libstdc++']
566+
compiler.linkflags += ['-stdlib=libstdc++']
567+
compiler.linkflags += ['-lstdc++']
568+
569+
if 'c++1y' in compiler.cxxflags:
570+
compiler.cxxflags.remove('-std=c++1y')
571+
compiler.cxxflags += ['-std=c++11']
572+
elif 'c++14' in compiler.cxxflags:
573+
compiler.cxxflags.remove('-std=c++14')
574+
compiler.cxxflags += ['-std=c++11']
558575

559576
for path in paths:
560577
compiler.cxxincludes += [os.path.join(sdk.path, *path)]

0 commit comments

Comments
 (0)