mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-26 19:54:14 +01:00
Make various AMBuild script changes to support 64-bit builds for CSGO.
This commit is contained in:
parent
1c3a32d921
commit
a805d4470f
120
AMBuildScript
120
AMBuildScript
@ -18,16 +18,21 @@ class SDK(object):
|
|||||||
else:
|
else:
|
||||||
self.platformSpec = platform
|
self.platformSpec = platform
|
||||||
|
|
||||||
def shouldBuild(self, target):
|
def shouldBuild(self, target, archs):
|
||||||
if target.platform not in self.platformSpec:
|
if target.platform not in self.platformSpec:
|
||||||
return False
|
return False
|
||||||
if target.arch not in self.platformSpec[target.platform]:
|
if not len([i for i in self.platformSpec[target.platform] if i in archs]):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
WinOnly = ['windows']
|
WinOnly = ['windows']
|
||||||
WinLinux = ['windows', 'linux']
|
WinLinux = ['windows', 'linux']
|
||||||
WinLinuxMac = ['windows', 'linux', 'mac']
|
WinLinuxMac = ['windows', 'linux', 'mac']
|
||||||
|
CSGO = {
|
||||||
|
'windows': ['x86'],
|
||||||
|
'linux': ['x86', 'x86_64'],
|
||||||
|
'mac': ['x86_64']
|
||||||
|
}
|
||||||
Source2 = {
|
Source2 = {
|
||||||
'windows': ['x86', 'x86_64'],
|
'windows': ['x86', 'x86_64'],
|
||||||
'linux': ['x86_64'],
|
'linux': ['x86_64'],
|
||||||
@ -48,7 +53,7 @@ PossibleSDKs = {
|
|||||||
'swarm': SDK('HL2SDK-SWARM', '2.swarm', '16', 'ALIENSWARM', WinOnly, 'swarm'),
|
'swarm': SDK('HL2SDK-SWARM', '2.swarm', '16', 'ALIENSWARM', WinOnly, 'swarm'),
|
||||||
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
|
'bgt': SDK('HL2SDK-BGT', '2.bgt', '4', 'BLOODYGOODTIME', WinOnly, 'bgt'),
|
||||||
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
|
'eye': SDK('HL2SDK-EYE', '2.eye', '5', 'EYE', WinOnly, 'eye'),
|
||||||
'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', WinLinuxMac, 'csgo'),
|
'csgo': SDK('HL2SDKCSGO', '2.csgo', '20', 'CSGO', CSGO, 'csgo'),
|
||||||
'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', Source2, 'dota'),
|
'dota': SDK('HL2SDKDOTA', '2.dota', '21', 'DOTA', Source2, 'dota'),
|
||||||
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
|
'portal2': SDK('HL2SDKPORTAL2', '2.portal2', '17', 'PORTAL2', [], 'portal2'),
|
||||||
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'),
|
'blade': SDK('HL2SDKBLADE', '2.blade', '18', 'BLADE', WinLinux, 'blade'),
|
||||||
@ -72,6 +77,24 @@ def ResolveEnvPath(env, folder):
|
|||||||
oldhead = head
|
oldhead = head
|
||||||
head, tail = os.path.split(head)
|
head, tail = os.path.split(head)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def SetArchFlags(compiler, arch, platform):
|
||||||
|
if compiler.behavior == 'gcc':
|
||||||
|
if arch == 'x86':
|
||||||
|
compiler.cflags += ['-m32']
|
||||||
|
compiler.linkflags += ['-m32']
|
||||||
|
if platform == 'mac':
|
||||||
|
compiler.linkflags = ['-arch', 'i386']
|
||||||
|
elif arch == 'x86_64':
|
||||||
|
compiler.cflags += ['-m64', '-fPIC']
|
||||||
|
compiler.linkflags += ['-m64']
|
||||||
|
if platform == 'mac':
|
||||||
|
compiler.linkflags = ['-arch', 'x86_64']
|
||||||
|
elif compiler.like('msvc'):
|
||||||
|
if builder.target.arch == 'x86':
|
||||||
|
compiler.linkflags += ['/MACHINE:X86']
|
||||||
|
elif builder.target.arch == 'x86_64':
|
||||||
|
compiler.linkflags += ['/MACHINE:X64']
|
||||||
|
|
||||||
class MMSConfig(object):
|
class MMSConfig(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -79,6 +102,7 @@ class MMSConfig(object):
|
|||||||
self.binaries = []
|
self.binaries = []
|
||||||
self.generated_headers = None
|
self.generated_headers = None
|
||||||
self.versionlib = None
|
self.versionlib = None
|
||||||
|
self.archs = builder.target.arch.split(',')
|
||||||
|
|
||||||
def use_auto_versioning(self):
|
def use_auto_versioning(self):
|
||||||
if builder.backend != 'amb2':
|
if builder.backend != 'amb2':
|
||||||
@ -109,7 +133,7 @@ class MMSConfig(object):
|
|||||||
|
|
||||||
for sdk_name in PossibleSDKs:
|
for sdk_name in PossibleSDKs:
|
||||||
sdk = PossibleSDKs[sdk_name]
|
sdk = PossibleSDKs[sdk_name]
|
||||||
if sdk.shouldBuild(builder.target):
|
if sdk.shouldBuild(builder.target, self.archs):
|
||||||
if builder.options.hl2sdk_root:
|
if builder.options.hl2sdk_root:
|
||||||
sdk_path = os.path.join(builder.options.hl2sdk_root, sdk.folder)
|
sdk_path = os.path.join(builder.options.hl2sdk_root, sdk.folder)
|
||||||
else:
|
else:
|
||||||
@ -129,7 +153,7 @@ class MMSConfig(object):
|
|||||||
def configure(self):
|
def configure(self):
|
||||||
builder.AddConfigureFile('pushbuild.txt')
|
builder.AddConfigureFile('pushbuild.txt')
|
||||||
|
|
||||||
if builder.target.arch not in ['x86', 'x86_64']:
|
if not set(self.archs).issubset(['x86', 'x86_64']):
|
||||||
raise Exception('Unknown target architecture: {0}'.format(builder.target.arch))
|
raise Exception('Unknown target architecture: {0}'.format(builder.target.arch))
|
||||||
|
|
||||||
cxx = builder.DetectCxx()
|
cxx = builder.DetectCxx()
|
||||||
@ -154,13 +178,6 @@ class MMSConfig(object):
|
|||||||
'-msse',
|
'-msse',
|
||||||
]
|
]
|
||||||
|
|
||||||
if builder.target.arch == 'x86':
|
|
||||||
cxx.cflags += ['-m32']
|
|
||||||
cxx.linkflags += ['-m32']
|
|
||||||
elif builder.target.arch == 'x86_64':
|
|
||||||
cxx.cflags += ['-m64', '-fPIC']
|
|
||||||
cxx.linkflags += ['-m64']
|
|
||||||
|
|
||||||
cxx.cxxflags += [ '-std=c++11' ]
|
cxx.cxxflags += [ '-std=c++11' ]
|
||||||
if (cxx.version >= 'gcc-4.0') or cxx.family == 'clang':
|
if (cxx.version >= 'gcc-4.0') or cxx.family == 'clang':
|
||||||
cxx.cflags += ['-fvisibility=hidden']
|
cxx.cflags += ['-fvisibility=hidden']
|
||||||
@ -178,7 +195,7 @@ class MMSConfig(object):
|
|||||||
cxx.cflags += ['-mfpmath=sse']
|
cxx.cflags += ['-mfpmath=sse']
|
||||||
if cxx.family == 'clang':
|
if cxx.family == 'clang':
|
||||||
cxx.cxxflags += ['-Wno-implicit-exception-spec-mismatch']
|
cxx.cxxflags += ['-Wno-implicit-exception-spec-mismatch']
|
||||||
if cxx.version >= 'clang-3.6':
|
if cxx.version >= 'clang-3.6' or cxx.version >= 'apple-clang-7.0':
|
||||||
cxx.cxxflags += ['-Wno-inconsistent-missing-override']
|
cxx.cxxflags += ['-Wno-inconsistent-missing-override']
|
||||||
if cxx.version >= 'apple-clang-5.1' or cxx.version >= 'clang-3.4':
|
if cxx.version >= 'apple-clang-5.1' or cxx.version >= 'clang-3.4':
|
||||||
cxx.cxxflags += ['-Wno-deprecated-register']
|
cxx.cxxflags += ['-Wno-deprecated-register']
|
||||||
@ -201,11 +218,6 @@ class MMSConfig(object):
|
|||||||
'/Zi',
|
'/Zi',
|
||||||
]
|
]
|
||||||
cxx.cxxflags += ['/TP']
|
cxx.cxxflags += ['/TP']
|
||||||
|
|
||||||
if builder.target.arch == 'x86':
|
|
||||||
cxx.linkflags += ['/MACHINE:X86']
|
|
||||||
elif builder.target.arch == 'x86_64':
|
|
||||||
cxx.linkflags += ['/MACHINE:X64']
|
|
||||||
|
|
||||||
cxx.linkflags += [
|
cxx.linkflags += [
|
||||||
'/SUBSYSTEM:WINDOWS',
|
'/SUBSYSTEM:WINDOWS',
|
||||||
@ -254,11 +266,10 @@ class MMSConfig(object):
|
|||||||
cxx.linkflags += ['-lgcc_eh']
|
cxx.linkflags += ['-lgcc_eh']
|
||||||
elif builder.target.platform == 'mac':
|
elif builder.target.platform == 'mac':
|
||||||
cxx.defines += ['OSX', '_OSX', 'POSIX']
|
cxx.defines += ['OSX', '_OSX', 'POSIX']
|
||||||
cxx.cflags += ['-mmacosx-version-min=10.5']
|
cxx.cflags += ['-mmacosx-version-min=10.9']
|
||||||
cxx.linkflags += [
|
cxx.linkflags += [
|
||||||
'-mmacosx-version-min=10.5',
|
'-mmacosx-version-min=10.9',
|
||||||
'-arch', 'i386',
|
'-lc++',
|
||||||
'-lstdc++',
|
|
||||||
]
|
]
|
||||||
elif builder.target.platform == 'windows':
|
elif builder.target.platform == 'windows':
|
||||||
cxx.defines += ['WIN32', '_WINDOWS']
|
cxx.defines += ['WIN32', '_WINDOWS']
|
||||||
@ -275,7 +286,7 @@ class MMSConfig(object):
|
|||||||
os.path.join(builder.sourcePath, 'versionlib'),
|
os.path.join(builder.sourcePath, 'versionlib'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def HL2Compiler(self, context, sdk):
|
def HL2Compiler(self, context, sdk, arch):
|
||||||
compiler = context.cxx.clone()
|
compiler = context.cxx.clone()
|
||||||
compiler.cxxincludes += [
|
compiler.cxxincludes += [
|
||||||
os.path.join(context.currentSourcePath),
|
os.path.join(context.currentSourcePath),
|
||||||
@ -309,17 +320,17 @@ class MMSConfig(object):
|
|||||||
|
|
||||||
if compiler.family == 'msvc':
|
if compiler.family == 'msvc':
|
||||||
compiler.defines += ['COMPILER_MSVC']
|
compiler.defines += ['COMPILER_MSVC']
|
||||||
if builder.target.arch == 'x86':
|
if arch == 'x86':
|
||||||
compiler.defines += ['COMPILER_MSVC32']
|
compiler.defines += ['COMPILER_MSVC32']
|
||||||
elif builder.target.arch == 'x86_64':
|
elif arch == 'x86_64':
|
||||||
compiler.defines += ['COMPILER_MSVC64']
|
compiler.defines += ['COMPILER_MSVC64']
|
||||||
|
|
||||||
if compiler.version >= 1900:
|
if compiler.version >= 1900:
|
||||||
compiler.linkflags += ['legacy_stdio_definitions.lib']
|
compiler.linkflags += ['legacy_stdio_definitions.lib']
|
||||||
else:
|
else:
|
||||||
compiler.defines += ['COMPILER_GCC']
|
compiler.defines += ['COMPILER_GCC']
|
||||||
|
|
||||||
if sdk.name == 'dota' and builder.target.arch == 'x86_64':
|
if arch == 'x86_64':
|
||||||
compiler.defines += ['X64BITS', 'PLATFORM_64BITS']
|
compiler.defines += ['X64BITS', 'PLATFORM_64BITS']
|
||||||
|
|
||||||
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota']:
|
if sdk.name in ['css', 'hl2dm', 'dods', 'sdk2013', 'bms', 'tf2', 'l4d', 'nucleardawn', 'l4d2', 'dota']:
|
||||||
@ -335,7 +346,7 @@ class MMSConfig(object):
|
|||||||
|
|
||||||
return compiler
|
return compiler
|
||||||
|
|
||||||
def AddVersioning(self, binary):
|
def AddVersioning(self, binary, arch):
|
||||||
if builder.target.platform == 'windows':
|
if builder.target.platform == 'windows':
|
||||||
binary.sources += ['version.rc']
|
binary.sources += ['version.rc']
|
||||||
binary.compiler.rcdefines += [
|
binary.compiler.rcdefines += [
|
||||||
@ -348,20 +359,20 @@ class MMSConfig(object):
|
|||||||
'-current_version', self.productVersion
|
'-current_version', self.productVersion
|
||||||
]
|
]
|
||||||
if self.use_auto_versioning():
|
if self.use_auto_versioning():
|
||||||
binary.compiler.linkflags += [self.versionlib]
|
binary.compiler.linkflags += [self.versionlib[arch]]
|
||||||
binary.compiler.sourcedeps += MMS.generated_headers
|
binary.compiler.sourcedeps += MMS.generated_headers
|
||||||
if builder.options.breakpad_dump:
|
if builder.options.breakpad_dump:
|
||||||
binary.compiler.symbol_files = 'separate'
|
binary.compiler.symbol_files = 'separate'
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
def LibraryBuilder(self, compiler, name):
|
def LibraryBuilder(self, compiler, name, arch):
|
||||||
binary = compiler.Library(name)
|
binary = compiler.Library(name)
|
||||||
self.AddVersioning(binary)
|
self.AddVersioning(binary, arch)
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
def ProgramBuilder(self, compiler, name):
|
def ProgramBuilder(self, compiler, name, arch):
|
||||||
binary = compiler.Program(name)
|
binary = compiler.Program(name)
|
||||||
self.AddVersioning(binary)
|
self.AddVersioning(binary, arch)
|
||||||
if '-static-libgcc' in binary.compiler.linkflags:
|
if '-static-libgcc' in binary.compiler.linkflags:
|
||||||
binary.compiler.linkflags.remove('-static-libgcc')
|
binary.compiler.linkflags.remove('-static-libgcc')
|
||||||
if '-lgcc_eh' in binary.compiler.linkflags:
|
if '-lgcc_eh' in binary.compiler.linkflags:
|
||||||
@ -369,17 +380,30 @@ class MMSConfig(object):
|
|||||||
if binary.compiler.like('gcc'):
|
if binary.compiler.like('gcc'):
|
||||||
binary.compiler.linkflags += ['-lstdc++']
|
binary.compiler.linkflags += ['-lstdc++']
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
|
def StaticLibraryBuilder(self, compiler, name):
|
||||||
|
binary = compiler.StaticLibrary(name)
|
||||||
|
return binary;
|
||||||
|
|
||||||
def Library(self, context, name):
|
def Library(self, context, name, arch):
|
||||||
compiler = context.cxx.clone()
|
compiler = context.cxx.clone()
|
||||||
return self.LibraryBuilder(compiler, name)
|
SetArchFlags(compiler, arch, builder.target.platform)
|
||||||
|
return self.LibraryBuilder(compiler, name, arch)
|
||||||
|
|
||||||
def Program(self, context, name):
|
def Program(self, context, name, arch):
|
||||||
compiler = context.cxx.clone()
|
compiler = context.cxx.clone()
|
||||||
return self.ProgramBuilder(compiler, name)
|
SetArchFlags(compiler, arch, builder.target.platform)
|
||||||
|
return self.ProgramBuilder(compiler, name, arch)
|
||||||
|
|
||||||
|
def StaticLibrary(self, context, name, arch):
|
||||||
|
compiler = context.cxx.clone()
|
||||||
|
SetArchFlags(compiler, arch, builder.target.platform)
|
||||||
|
return self.StaticLibraryBuilder(compiler, name)
|
||||||
|
|
||||||
def HL2Library(self, context, name, sdk):
|
def HL2Library(self, context, name, sdk, arch):
|
||||||
compiler = self.HL2Compiler(context, sdk)
|
compiler = self.HL2Compiler(context, sdk, arch)
|
||||||
|
|
||||||
|
SetArchFlags(compiler, arch, builder.target.platform)
|
||||||
|
|
||||||
if builder.target.platform == 'linux':
|
if builder.target.platform == 'linux':
|
||||||
if sdk.name == 'episode1':
|
if sdk.name == 'episode1':
|
||||||
@ -391,19 +415,27 @@ class MMSConfig(object):
|
|||||||
elif builder.target.platform == 'mac':
|
elif builder.target.platform == 'mac':
|
||||||
if sdk.name in ['sdk2013', 'bms']:
|
if sdk.name in ['sdk2013', 'bms']:
|
||||||
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'osx32')
|
lib_folder = os.path.join(sdk.path, 'lib', 'public', 'osx32')
|
||||||
|
elif arch == 'x86_64':
|
||||||
|
lib_folder = os.path.join(sdk.path, 'lib', 'osx64')
|
||||||
else:
|
else:
|
||||||
lib_folder = os.path.join(sdk.path, 'lib', 'mac')
|
lib_folder = os.path.join(sdk.path, 'lib', 'mac')
|
||||||
|
|
||||||
if builder.target.platform in ['linux', 'mac']:
|
if builder.target.platform in ['linux', 'mac']:
|
||||||
if sdk.name in ['sdk2013', 'bms']:
|
if sdk.name in ['sdk2013', 'bms'] or arch == 'x86_64':
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1.a'))]
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1.a'))]
|
||||||
else:
|
else:
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a'))]
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'tier1_i486.a'))]
|
||||||
|
|
||||||
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
|
if sdk.name in ['blade', 'insurgency', 'csgo', 'dota']:
|
||||||
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
if arch == 'x86_64':
|
||||||
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces.a'))]
|
||||||
|
else:
|
||||||
|
compiler.postlink += [compiler.Dep(os.path.join(lib_folder, 'interfaces_i486.a'))]
|
||||||
|
|
||||||
binary = self.LibraryBuilder(compiler, name)
|
binary = self.LibraryBuilder(compiler, name, arch)
|
||||||
|
|
||||||
|
if arch == 'x86_64':
|
||||||
|
binary.localFolder = name + ".x64"
|
||||||
|
|
||||||
dynamic_libs = []
|
dynamic_libs = []
|
||||||
if builder.target.platform == 'linux':
|
if builder.target.platform == 'linux':
|
||||||
@ -422,9 +454,9 @@ class MMSConfig(object):
|
|||||||
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
|
if sdk.name in ['swarm', 'blade', 'insurgency', 'csgo', 'dota']:
|
||||||
libs.append('interfaces')
|
libs.append('interfaces')
|
||||||
for lib in libs:
|
for lib in libs:
|
||||||
if builder.target.arch == 'x86':
|
if arch == 'x86':
|
||||||
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
lib_path = os.path.join(sdk.path, 'lib', 'public', lib) + '.lib'
|
||||||
elif builder.target.arch == 'x86_64':
|
elif arch == 'x86_64':
|
||||||
lib_path = os.path.join(sdk.path, 'lib', 'public', 'win64', lib) + '.lib'
|
lib_path = os.path.join(sdk.path, 'lib', 'public', 'win64', lib) + '.lib'
|
||||||
binary.compiler.linkflags.append(binary.Dep(lib_path))
|
binary.compiler.linkflags.append(binary.Dep(lib_path))
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# vim: set sts=2 ts=8 sw=2 tw=99 et:
|
# vim: set sts=2 ts=8 sw=2 tw=99 et:
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
from ambuild2 import run
|
from ambuild2 import run, util
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
import ambuild
|
import ambuild
|
||||||
@ -13,7 +13,7 @@ except:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def make_objdir_name(p):
|
def make_objdir_name(p):
|
||||||
return 'obj-linux-' + p.target_arch
|
return 'obj-' + util.Platform() + '-' + p.target_arch
|
||||||
|
|
||||||
parser = run.BuildParser(sourcePath=sys.path[0], api='2.1')
|
parser = run.BuildParser(sourcePath=sys.path[0], api='2.1')
|
||||||
parser.default_arch = 'x86'
|
parser.default_arch = 'x86'
|
||||||
|
@ -2,30 +2,34 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
for sdk_name in MMS.sdks:
|
for sdk_name in MMS.sdks:
|
||||||
sdk = MMS.sdks[sdk_name]
|
for arch in MMS.archs:
|
||||||
|
sdk = MMS.sdks[sdk_name]
|
||||||
|
|
||||||
name = 'metamod.' + sdk.ext
|
if not arch in sdk.platformSpec[builder.target.platform]:
|
||||||
binary = MMS.HL2Library(builder, name, sdk)
|
continue
|
||||||
|
|
||||||
binary.sources += [
|
name = 'metamod.' + sdk.ext
|
||||||
'metamod.cpp',
|
binary = MMS.HL2Library(builder, name, sdk, arch)
|
||||||
'metamod_console.cpp',
|
|
||||||
'metamod_oslink.cpp',
|
|
||||||
'metamod_plugins.cpp',
|
|
||||||
'metamod_util.cpp',
|
|
||||||
'provider/console.cpp',
|
|
||||||
'provider/provider_ep2.cpp',
|
|
||||||
'sourcehook/sourcehook.cpp',
|
|
||||||
'sourcehook/sourcehook_impl_chookidman.cpp',
|
|
||||||
'sourcehook/sourcehook_impl_chookmaninfo.cpp',
|
|
||||||
'sourcehook/sourcehook_impl_cproto.cpp',
|
|
||||||
'sourcehook/sourcehook_impl_cvfnptr.cpp',
|
|
||||||
'gamedll_bridge.cpp',
|
|
||||||
'vsp_bridge.cpp'
|
|
||||||
]
|
|
||||||
|
|
||||||
# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?"
|
binary.sources += [
|
||||||
if builder.target.arch == 'x86':
|
'metamod.cpp',
|
||||||
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp']
|
'metamod_console.cpp',
|
||||||
nodes = builder.Add(binary)
|
'metamod_oslink.cpp',
|
||||||
MMS.binaries += [nodes]
|
'metamod_plugins.cpp',
|
||||||
|
'metamod_util.cpp',
|
||||||
|
'provider/console.cpp',
|
||||||
|
'provider/provider_ep2.cpp',
|
||||||
|
'sourcehook/sourcehook.cpp',
|
||||||
|
'sourcehook/sourcehook_impl_chookidman.cpp',
|
||||||
|
'sourcehook/sourcehook_impl_chookmaninfo.cpp',
|
||||||
|
'sourcehook/sourcehook_impl_cproto.cpp',
|
||||||
|
'sourcehook/sourcehook_impl_cvfnptr.cpp',
|
||||||
|
'gamedll_bridge.cpp',
|
||||||
|
'vsp_bridge.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
|
# Source2 hack. TODO: check this more deterministically, "are we doing an x64 build?"
|
||||||
|
if arch == 'x86':
|
||||||
|
binary.sources += ['sourcehook/sourcehook_hookmangen.cpp']
|
||||||
|
nodes = builder.Add(binary)
|
||||||
|
MMS.binaries += [nodes]
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
def configure_library(name, linux_defines):
|
def configure_library(name, linux_defines, arch):
|
||||||
binary = MMS.Library(builder, name)
|
libname = name
|
||||||
|
binary = MMS.Library(builder, libname, arch)
|
||||||
binary.compiler.cxxincludes += [os.path.join(builder.sourcePath, 'core', 'sourcehook')]
|
binary.compiler.cxxincludes += [os.path.join(builder.sourcePath, 'core', 'sourcehook')]
|
||||||
binary.sources += [
|
binary.sources += [
|
||||||
'loader.cpp',
|
'loader.cpp',
|
||||||
@ -10,6 +11,8 @@ def configure_library(name, linux_defines):
|
|||||||
'serverplugin.cpp',
|
'serverplugin.cpp',
|
||||||
'utility.cpp',
|
'utility.cpp',
|
||||||
]
|
]
|
||||||
|
if arch == 'x86_64':
|
||||||
|
binary.localFolder = name + ".x64"
|
||||||
|
|
||||||
if builder.target.platform == 'linux':
|
if builder.target.platform == 'linux':
|
||||||
binary.compiler.defines += linux_defines
|
binary.compiler.defines += linux_defines
|
||||||
@ -17,11 +20,11 @@ def configure_library(name, linux_defines):
|
|||||||
nodes = builder.Add(binary)
|
nodes = builder.Add(binary)
|
||||||
MMS.binaries += [nodes]
|
MMS.binaries += [nodes]
|
||||||
|
|
||||||
libname = 'server'
|
for arch in MMS.archs:
|
||||||
if builder.target.platform == 'linux' and builder.target.arch == 'x86_64':
|
if builder.target.platform == 'linux':
|
||||||
libname = 'libserver'
|
if arch == 'x86_64':
|
||||||
|
configure_library('libserver', ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"'], arch)
|
||||||
|
elif arch == 'x86':
|
||||||
|
configure_library('server_i486', ['LIB_PREFIX=""', 'LIB_SUFFIX="_i486.so"'], arch)
|
||||||
|
|
||||||
configure_library(libname, ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"'])
|
configure_library('server', ['LIB_PREFIX="lib"', 'LIB_SUFFIX=".so"'], arch)
|
||||||
|
|
||||||
if builder.target.platform == 'linux' and builder.target.arch == 'x86':
|
|
||||||
configure_library('server_i486', ['LIB_PREFIX=""', 'LIB_SUFFIX="_i486.so"'])
|
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
# vim: sts=2 ts=8 sw=2 tw=99 et ft=python:
|
# vim: sts=2 ts=8 sw=2 tw=99 et ft=python:
|
||||||
|
|
||||||
lib = builder.cxx.StaticLibrary("version")
|
rvalue = {}
|
||||||
lib.compiler.defines.remove('MMS_USE_VERSIONLIB')
|
for arch in MMS.archs:
|
||||||
lib.compiler.sourcedeps += MMS.generated_headers
|
libname = 'version'
|
||||||
lib.sources += [
|
lib = MMS.StaticLibrary(builder, libname, arch)
|
||||||
'versionlib.cpp'
|
lib.compiler.defines.remove('MMS_USE_VERSIONLIB')
|
||||||
]
|
lib.compiler.sourcedeps += MMS.generated_headers
|
||||||
|
lib.sources += [
|
||||||
|
'versionlib.cpp'
|
||||||
|
]
|
||||||
|
if arch == 'x86_64':
|
||||||
|
lib.localFolder = libname + '.x64'
|
||||||
|
|
||||||
cmd = builder.Add(lib)
|
cmd = builder.Add(lib)
|
||||||
|
|
||||||
rvalue = cmd.binary
|
rvalue[arch] = cmd.binary
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user