From d525b466ec142c3c3f1598ca1aaf52042563540f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 21 May 2020 15:12:38 -0700 Subject: [PATCH] Use C++11 for macOS and CS:GO. --- AMBuildScript | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index 0c1f5d0b..0e12f9c0 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -551,10 +551,27 @@ class SMConfig(object): compiler.defines += ['NO_HOOK_MALLOC', 'NO_MALLOC_OVERRIDE'] if builder.target.platform == 'linux': - if sdk.name in ['csgo', 'blade']: - compiler.linkflags.remove('-static-libstdc++') - compiler.linkflags += ['-lstdc++'] - compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0'] + if sdk.name in ['csgo', 'blade']: + compiler.linkflags.remove('-static-libstdc++') + compiler.linkflags += ['-lstdc++'] + compiler.defines += ['_GLIBCXX_USE_CXX11_ABI=0'] + elif builder.target.platform == 'mac': + if sdk.name in ['csgo']: + # Switch libc++ to libstdc++ for protobuf linkage. + compiler.cxxflags.remove('-stdlib=libc++') + compiler.linkflags.remove('-stdlib=libc++') + compiler.linkflags.remove('-lc++') + + compiler.cxxflags += ['-stdlib=libstdc++'] + compiler.linkflags += ['-stdlib=libstdc++'] + compiler.linkflags += ['-lstdc++'] + + if 'c++1y' in compiler.cxxflags: + compiler.cxxflags.remove('-std=c++1y') + compiler.cxxflags += ['-std=c++11'] + elif 'c++14' in compiler.cxxflags: + compiler.cxxflags.remove('-std=c++14') + compiler.cxxflags += ['-std=c++11'] for path in paths: compiler.cxxincludes += [os.path.join(sdk.path, *path)]