Port simple C++ build scripts to AMBuild 2 (bug 5997 part 1, r=ds).

This commit is contained in:
David Anderson
2013-12-30 17:50:56 -05:00
parent b749bbf42b
commit e1a820dcf9
19 changed files with 955 additions and 1134 deletions
+39 -46
View File
@@ -1,52 +1,45 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
for i in SM.sdkInfo:
sdk = SM.sdkInfo[i]
if AMBuild.target['platform'] not in sdk['platform']:
continue
for sdk_name in SM.sdks:
sdk = SM.sdks[sdk_name]
compiler = SM.DefaultHL2Compiler('extensions/sdktools', i)
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
binary = SM.HL2Library(builder, 'sdktools.ext.' + sdk.ext, sdk)
binary.compiler.cxxincludes += [
os.path.join(sdk.path, 'game', 'shared'),
os.path.join(builder.sourcePath, 'public', 'jit'),
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
]
if compiler.cc.name == 'gcc' or compiler.cc.name == 'clang':
compiler['CXXFLAGS'].append('-Wno-invalid-offsetof')
if sdk.name != 'ep1':
binary.compiler.defines += ['HOOKING_ENABLED']
if i != 'ep1':
compiler['CDEFINES'].append('HOOKING_ENABLED')
name = 'sdktools.ext.' + sdk['ext']
extension = AMBuild.AddJob(name)
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
SM.PreSetupHL2Job(extension, binary, i)
binary.AddSourceFiles('extensions/sdktools', [
'extension.cpp',
'inputnatives.cpp',
'output.cpp',
'outputnatives.cpp',
'tempents.cpp',
'tenatives.cpp',
'teamnatives.cpp',
'trnatives.cpp',
'vcaller.cpp',
'vcallbuilder.cpp',
'vdecoder.cpp',
'vglobals.cpp',
'vhelpers.cpp',
'vnatives.cpp',
'voice.cpp',
'vsound.cpp',
'clientnatives.cpp',
'hooks.cpp',
'gamerulesnatives.cpp',
'vstringtable.cpp',
'CDetour/detours.cpp',
'sdk/smsdk_ext.cpp',
'asm/asm.c'
])
SM.PostSetupHL2Job(extension, binary, i)
SM.AutoVersion('extensions/sdktools', binary)
SM.ExtractDebugInfo(extension, binary)
binary.SendToJob()
if binary.compiler.cxx.behavior is 'gcc':
binary.compiler.cxxflags += ['-Wno-invalid-offsetof']
binary.sources += [
'extension.cpp',
'inputnatives.cpp',
'output.cpp',
'outputnatives.cpp',
'tempents.cpp',
'tenatives.cpp',
'teamnatives.cpp',
'trnatives.cpp',
'vcaller.cpp',
'vcallbuilder.cpp',
'vdecoder.cpp',
'vglobals.cpp',
'vhelpers.cpp',
'vnatives.cpp',
'voice.cpp',
'vsound.cpp',
'clientnatives.cpp',
'hooks.cpp',
'gamerulesnatives.cpp',
'vstringtable.cpp',
'CDetour/detours.cpp',
'sdk/smsdk_ext.cpp',
'asm/asm.c'
]
SM.binaries += [builder.Add(binary)]