Revert "Introduce a pbproxy library to solve macOS linker issues."
This reverts commit e5ddbd9886.
This commit is contained in:
+34
-72
@@ -4,43 +4,42 @@ import os
|
||||
project = builder.LibraryProject('sourcemod')
|
||||
|
||||
project.sources += [
|
||||
'MenuStyle_Valve.cpp',
|
||||
'logic_bridge.cpp',
|
||||
'smn_entities.cpp',
|
||||
'sm_stringutil.cpp',
|
||||
'MenuVoting.cpp',
|
||||
'smn_events.cpp',
|
||||
'frame_hooks.cpp',
|
||||
'smn_nextmap.cpp',
|
||||
'sourcemm_api.cpp',
|
||||
'ChatTriggers.cpp',
|
||||
'smn_player.cpp',
|
||||
'sourcemod.cpp',
|
||||
'concmd_cleaner.cpp',
|
||||
'HalfLife2.cpp',
|
||||
'NextMap.cpp',
|
||||
'ConCmdManager.cpp',
|
||||
'ConVarManager.cpp',
|
||||
'ConsoleDetours.cpp',
|
||||
'CoreConfig.cpp',
|
||||
'EventManager.cpp',
|
||||
'GameHooks.cpp',
|
||||
'HalfLife2.cpp',
|
||||
'Logger.cpp',
|
||||
'MenuManager.cpp',
|
||||
'MenuStyle_Base.cpp',
|
||||
'MenuStyle_Radio.cpp',
|
||||
'MenuStyle_Valve.cpp',
|
||||
'MenuVoting.cpp',
|
||||
'NextMap.cpp',
|
||||
'PlayerManager.cpp',
|
||||
'TimerSys.cpp',
|
||||
'UserMessages.cpp',
|
||||
'concmd_cleaner.cpp',
|
||||
'frame_hooks.cpp',
|
||||
'logic_bridge.cpp',
|
||||
'pb_handle.cpp',
|
||||
'sm_autonatives.cpp',
|
||||
'sm_stringutil.cpp',
|
||||
'smn_commandline.cpp',
|
||||
'smn_console.cpp',
|
||||
'smn_entities.cpp',
|
||||
'smn_events.cpp',
|
||||
'CoreConfig.cpp',
|
||||
'Logger.cpp',
|
||||
'smn_halflife.cpp',
|
||||
'smn_console.cpp',
|
||||
'UserMessages.cpp',
|
||||
'MenuManager.cpp',
|
||||
'smn_hudtext.cpp',
|
||||
'smn_keyvalues.cpp',
|
||||
'smn_nextmap.cpp',
|
||||
'smn_player.cpp',
|
||||
'smn_usermsgs.cpp',
|
||||
'MenuStyle_Base.cpp',
|
||||
'smn_keyvalues.cpp',
|
||||
'smn_vector.cpp',
|
||||
'sourcemm_api.cpp',
|
||||
'sourcemod.cpp',
|
||||
'EventManager.cpp',
|
||||
'MenuStyle_Radio.cpp',
|
||||
'sm_autonatives.cpp',
|
||||
'ConsoleDetours.cpp',
|
||||
'smn_commandline.cpp',
|
||||
'GameHooks.cpp',
|
||||
]
|
||||
|
||||
for sdk_name in SM.sdks:
|
||||
@@ -59,20 +58,18 @@ for sdk_name in SM.sdks:
|
||||
builder.sourcePath
|
||||
]
|
||||
|
||||
pb_includes = []
|
||||
if sdk.name == 'csgo':
|
||||
pb_includes = [
|
||||
compiler.cxxincludes += [
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf')
|
||||
]
|
||||
elif sdk.name == 'blade':
|
||||
pb_includes = [
|
||||
compiler.cxxincludes += [
|
||||
os.path.join(sdk.path, 'common', 'protobuf-2.5.0', 'src'),
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf')
|
||||
]
|
||||
compiler.cxxincludes += pb_includes
|
||||
|
||||
if compiler.like('msvc'):
|
||||
compiler.defines += ['_ALLOW_KEYWORD_MACROS']
|
||||
@@ -88,9 +85,9 @@ for sdk_name in SM.sdks:
|
||||
compiler.linkflags += ['-Wl,--exclude-libs=libprotobuf.a']
|
||||
elif compiler.target.platform == 'mac':
|
||||
if compiler.target.arch == 'x86':
|
||||
lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf-libcxx.a')
|
||||
lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
|
||||
elif compiler.target.arch == 'x86_64':
|
||||
lib_path = os.path.join(sdk.path, 'lib', 'osx64', 'release', 'libprotobuf-libcxx.a')
|
||||
lib_path = os.path.join(sdk.path, 'lib', 'osx64', 'release', 'libprotobuf.a')
|
||||
elif compiler.target.platform == 'windows':
|
||||
msvc_ver = compiler.version
|
||||
vs_year = ''
|
||||
@@ -121,53 +118,18 @@ for sdk_name in SM.sdks:
|
||||
'vprof_tool.cpp',
|
||||
]
|
||||
|
||||
pb_sources = []
|
||||
if sdk.name == 'csgo':
|
||||
pb_sources = [
|
||||
binary.sources += [
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'csgo', 'protobuf', 'cstrike15_usermessage_helpers.cpp'),
|
||||
]
|
||||
elif sdk.name == 'blade':
|
||||
pb_sources = [
|
||||
binary.sources += [
|
||||
os.path.join(sdk.path, 'public', 'engine', 'protobuf', 'netmessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessages.pb.cc'),
|
||||
os.path.join(sdk.path, 'public', 'game', 'shared', 'berimbau', 'protobuf', 'berimbau_usermessage_helpers.cpp'),
|
||||
]
|
||||
if len(pb_sources):
|
||||
binary.sources += pb_sources
|
||||
binary.compiler.cxxdefines += ['PROTOBUF_ENABLE']
|
||||
|
||||
if cxx.target.platform == 'mac' and sdk.name in ['csgo']:
|
||||
# We need a proxy library since the game uses libstdc++.
|
||||
pb_binary = SM.HL2Library(builder, cxx, 'pbproxy.' + sdk.ext, sdk)
|
||||
pb_binary.sources += pb_sources
|
||||
pb_binary.sources += ['pb_proxy.cpp']
|
||||
pb_binary.compiler.cxxincludes += pb_includes
|
||||
|
||||
# Switch from libc++ to libstdc++.
|
||||
pb_binary.compiler.cxxflags.remove('-stdlib=libc++')
|
||||
pb_binary.compiler.linkflags.remove('-lc++')
|
||||
pb_binary.compiler.linkflags.remove('-stdlib=libc++')
|
||||
pb_binary.compiler.cxxflags.append('-stdlib=libstdc++')
|
||||
pb_binary.compiler.linkflags.append('-lstdc++')
|
||||
pb_binary.compiler.linkflags.append('-stdlib=libstdc++')
|
||||
if '-std=c++1y' in pb_binary.compiler.cxxflags:
|
||||
pb_binary.compiler.cxxflags.remove('-std=c++1y')
|
||||
elif '-std=c++14' in pb_binary.compiler.cxxflags:
|
||||
pb_binary.compiler.cxxflags.remove('-std=c++14')
|
||||
|
||||
if cxx.target.arch == 'x86':
|
||||
pb_lib_path = os.path.join(sdk.path, 'lib', 'osx32', 'release', 'libprotobuf.a')
|
||||
elif cxx.target.arch == 'x86_64':
|
||||
pb_lib_path = os.path.join(sdk.path, 'lib', 'osx64', 'release', 'libprotobuf.a')
|
||||
pb_binary.compiler.linkflags.append(pb_lib_path)
|
||||
|
||||
SM.binaries += [builder.Add(pb_binary)]
|
||||
|
||||
binary.compiler.cxxdefines += [
|
||||
'PROTOBUF_PROXY_ENABLE',
|
||||
'PROTOBUF_PROXY_BINARY_NAME="pbproxy.{}"'.format(sdk.ext),
|
||||
]
|
||||
|
||||
SM.binaries += builder.Add(project)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user