mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-07 02:18:30 +00:00
Update manifests; statically link libstdc++ now.
This commit is contained in:
parent
e11a90b5db
commit
9dd5144128
@ -256,6 +256,7 @@ class MMSConfig(object):
|
|||||||
cxx.linkflags += ['-static-libgcc']
|
cxx.linkflags += ['-static-libgcc']
|
||||||
elif cxx.family == 'clang':
|
elif cxx.family == 'clang':
|
||||||
cxx.linkflags += ['-lgcc_eh']
|
cxx.linkflags += ['-lgcc_eh']
|
||||||
|
cxx.linkflags += ['-static-libstdc++']
|
||||||
elif cxx.target.platform == 'mac':
|
elif cxx.target.platform == 'mac':
|
||||||
cxx.defines += ['OSX', '_OSX', 'POSIX']
|
cxx.defines += ['OSX', '_OSX', 'POSIX']
|
||||||
|
|
||||||
@ -271,8 +272,10 @@ class MMSConfig(object):
|
|||||||
]
|
]
|
||||||
|
|
||||||
cxx.linkflags += [
|
cxx.linkflags += [
|
||||||
|
'-stdlib=libc++',
|
||||||
'-lc++',
|
'-lc++',
|
||||||
]
|
]
|
||||||
|
cxx.cxxflags += ['-stdlib=libc++']
|
||||||
elif cxx.target.platform == 'windows':
|
elif cxx.target.platform == 'windows':
|
||||||
cxx.defines += ['WIN32', '_WINDOWS']
|
cxx.defines += ['WIN32', '_WINDOWS']
|
||||||
|
|
||||||
@ -289,54 +292,6 @@ class MMSConfig(object):
|
|||||||
os.path.join(builder.sourcePath, 'versionlib'),
|
os.path.join(builder.sourcePath, 'versionlib'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def HL2Compiler(self, context, cxx, sdk):
|
|
||||||
compiler = cxx.clone()
|
|
||||||
compiler.cxxincludes += [
|
|
||||||
os.path.join(context.currentSourcePath),
|
|
||||||
os.path.join(context.currentSourcePath, 'sourcehook'),
|
|
||||||
os.path.join(context.sourcePath, 'loader'),
|
|
||||||
]
|
|
||||||
|
|
||||||
defines = []
|
|
||||||
for other_sdk in self.sdk_manifests:
|
|
||||||
defines += ['SE_{}={}'.format(other_sdk['define'], other_sdk['code'])]
|
|
||||||
|
|
||||||
compiler.defines += defines
|
|
||||||
compiler.defines += ['SOURCE_ENGINE={}'.format(sdk['code'])]
|
|
||||||
|
|
||||||
if sdk['name'] in ['sdk2013', 'bms', 'pvkii'] and compiler.like('gcc'):
|
|
||||||
# The 2013 SDK already has these in public/tier0/basetypes.h
|
|
||||||
compiler.defines.remove('stricmp=strcasecmp')
|
|
||||||
compiler.defines.remove('_stricmp=strcasecmp')
|
|
||||||
compiler.defines.remove('_snprintf=snprintf')
|
|
||||||
compiler.defines.remove('_vsnprintf=vsnprintf')
|
|
||||||
|
|
||||||
if compiler.family == 'msvc':
|
|
||||||
compiler.defines += ['COMPILER_MSVC']
|
|
||||||
if compiler.target.arch == 'x86':
|
|
||||||
compiler.defines += ['COMPILER_MSVC32']
|
|
||||||
elif compiler.target.arch == 'x86_64':
|
|
||||||
compiler.defines += ['COMPILER_MSVC64']
|
|
||||||
|
|
||||||
if compiler.version >= 1900:
|
|
||||||
compiler.linkflags += ['legacy_stdio_definitions.lib']
|
|
||||||
else:
|
|
||||||
compiler.defines += ['COMPILER_GCC']
|
|
||||||
|
|
||||||
if compiler.target.arch == 'x86_64':
|
|
||||||
compiler.defines += ['X64BITS', 'PLATFORM_64BITS']
|
|
||||||
|
|
||||||
SdkHelpers.addLists(sdk, 'defines', compiler)
|
|
||||||
SdkHelpers.addLists(sdk, 'linkflags', compiler)
|
|
||||||
|
|
||||||
if sdk['name'] in ['dota', 'cs2']:
|
|
||||||
compiler.defines += ['META_IS_SOURCE2']
|
|
||||||
|
|
||||||
for path in sdk['include_paths']:
|
|
||||||
compiler.cxxincludes += [os.path.join(sdk['path'], path)]
|
|
||||||
|
|
||||||
return compiler
|
|
||||||
|
|
||||||
def AddVersioning(self, binary):
|
def AddVersioning(self, binary):
|
||||||
if binary.compiler.target.platform == 'windows':
|
if binary.compiler.target.platform == 'windows':
|
||||||
binary.sources += ['version.rc']
|
binary.sources += ['version.rc']
|
||||||
@ -378,33 +333,23 @@ class MMSConfig(object):
|
|||||||
return cxx.StaticLibrary(name)
|
return cxx.StaticLibrary(name)
|
||||||
|
|
||||||
def HL2Library(self, context, compiler, name, sdk):
|
def HL2Library(self, context, compiler, name, sdk):
|
||||||
compiler = self.HL2Compiler(context, compiler, sdk)
|
|
||||||
|
|
||||||
lib_folder = sdk[compiler.target.platform][compiler.target.arch]['lib_folder']
|
|
||||||
lib_folder = os.path.join(sdk['path'], lib_folder)
|
|
||||||
for lib in SdkHelpers.getLists(sdk, 'libs', compiler):
|
|
||||||
compiler.linkflags += [os.path.join(sdk['path'], lib_folder, lib)]
|
|
||||||
for lib in SdkHelpers.getLists(sdk, 'postlink_libs', compiler):
|
|
||||||
compiler.postlink += [os.path.join(sdk['path'], lib_folder, lib)]
|
|
||||||
|
|
||||||
binary = self.Library(compiler, name)
|
binary = self.Library(compiler, name)
|
||||||
compiler = binary.compiler
|
cxx = binary.compiler
|
||||||
|
|
||||||
if compiler.target.platform == 'linux':
|
cxx.cxxincludes += [
|
||||||
compiler.linkflags[0:0] = ['-lm']
|
os.path.join(context.currentSourcePath),
|
||||||
elif compiler.target.platform == 'mac':
|
os.path.join(context.currentSourcePath, 'sourcehook'),
|
||||||
binary.compiler.linkflags.append('-liconv')
|
os.path.join(context.sourcePath, 'loader'),
|
||||||
|
]
|
||||||
|
|
||||||
dynamic_libs = SdkHelpers.getLists(sdk, 'dynamic_libs', compiler)
|
defines = []
|
||||||
for library in dynamic_libs:
|
for other_sdk in self.sdk_manifests:
|
||||||
source_path = os.path.join(lib_folder, library)
|
cxx.defines += ['SE_{}={}'.format(other_sdk['define'], other_sdk['code'])]
|
||||||
output_path = os.path.join(binary.localFolder, library)
|
|
||||||
|
|
||||||
context.AddFolder(binary.localFolder)
|
if sdk['source2']:
|
||||||
output = context.AddSymlink(source_path, output_path)
|
cxx.defines += ['META_IS_SOURCE2']
|
||||||
|
|
||||||
binary.compiler.weaklinkdeps += [output]
|
SdkHelpers.configureCxx(context, binary, sdk)
|
||||||
binary.compiler.linkflags[0:0] = [library]
|
|
||||||
|
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit d771d65b44596b18dbb484dd868708ee5b1a7705
|
Subproject commit fa9ffa26e5c3a10870ce7364d5b73aa3a98ccd97
|
||||||
Loading…
Reference in New Issue
Block a user