Bring build scripts to AMBuild 2.2

This commit is contained in:
Kenzzer
2023-02-18 23:39:16 +01:00
parent 0c6274058e
commit 2824a307e4
8 changed files with 789 additions and 640 deletions
+18 -33
View File
@@ -1,38 +1,23 @@
# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os, sys
for i in SM.sdkInfo:
sdk = SM.sdkInfo[i]
if AMBuild.target['platform'] not in sdk['platform']:
continue
projectname = 'connect'
compiler = SM.DefaultHL2Compiler('extension', i)
project = builder.LibraryProject(projectname + '.ext')
project.sources = [
'extension.cpp',
'asm/asm.c',
'CDetour/detours.cpp',
'sdk/smsdk_ext.cpp'
]
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'extension'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'extension', 'sdk'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD14'], 'public'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD14'], 'extensions'))
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['SOURCEMOD14'], 'public', 'sourcepawn'))
for sdk_name in Extension.sdks:
sdk = Extension.sdks[sdk_name]
if compiler.cc.name == 'gcc':
compiler['CFLAGS'].append('-Wno-parentheses')
if i != 'ep1':
compiler['CDEFINES'].append('HOOKING_ENABLED')
name = 'connect.ext.' + sdk['ext']
extension = AMBuild.AddJob(name)
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
SM.PreSetupHL2Job(extension, binary, i)
binary.AddSourceFiles('extension', [
'extension.cpp',
'asm/asm.c',
'CDetour/detours.cpp',
'sdk/smsdk_ext.cpp'
])
SM.PostSetupHL2Job(extension, binary, i)
SM.AutoVersion('extension', binary)
SM.ExtractDebugInfo(extension, binary)
binary.SendToJob()
for cxx in builder.targets:
if not cxx.target.arch in sdk.platformSpec[cxx.target.platform]:
continue
binary = Extension.HL2ExtConfig(project, builder, cxx, projectname + '.ext.' + sdk.ext, sdk)
Extension.extensions = builder.Add(project)