Revert "Remove arch loops from build scripts. (#889)"

This reverts commit 7ed329c11f.
This commit is contained in:
Asher Baker 2018-10-04 17:59:40 +00:00
parent 22b43e3869
commit 1ca4517f46
12 changed files with 339 additions and 328 deletions

View File

@ -639,40 +639,32 @@ for arch in SM.archs:
SP.libsourcepawn[arch]
]
NonSDKBuilds = [
BuildScripts = [
'loader/AMBuilder',
'core/AMBuilder',
'core/logic/AMBuilder',
'extensions/bintools/AMBuilder',
'extensions/clientprefs/AMBuilder',
'extensions/curl/AMBuilder',
'extensions/geoip/AMBuilder',
'extensions/regex/AMBuilder',
'extensions/sqlite/AMBuilder',
'extensions/topmenus/AMBuilder',
'extensions/updater/AMBuilder',
'loader/AMBuilder',
]
if SM.mysql_root:
NonSDKBuilds += [
'extensions/mysql/AMBuilder',
]
for arch in SM.archs:
builder.Build(NonSDKBuilds, { 'SM': SM, 'arch': arch })
SDKBuilds = [
'core/AMBuilder',
'extensions/cstrike/AMBuilder',
'extensions/geoip/AMBuilder',
'extensions/mysql/AMBuilder',
'extensions/regex/AMBuilder',
'extensions/sdkhooks/AMBuilder',
'extensions/sdktools/AMBuilder',
'extensions/sqlite/AMBuilder',
'extensions/tf2/AMBuilder',
'extensions/topmenus/AMBuilder',
'extensions/updater/AMBuilder',
]
builder.Build(SDKBuilds, { 'SM': SM })
if builder.backend == 'amb2':
OtherScripts = [
BuildScripts += [
'plugins/AMBuilder',
'tools/buildbot/PackageScript',
]
builder.Build(OtherScripts, { 'SM': SM })
builder.Build(BuildScripts, { 'SM': SM })
if builder.options.breakpad_dump:
builder.Build('tools/buildbot/BreakpadSymbols', { 'SM': SM })

View File

@ -1,8 +1,9 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.Library(builder, 'sourcemod.logic', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.Library(builder, 'sourcemod.logic', arch)
binary.compiler.cxxincludes += [
builder.sourcePath,
os.path.join(builder.sourcePath, 'core', 'logic'),
os.path.join(builder.sourcePath, 'public'),
@ -10,24 +11,24 @@ binary.compiler.cxxincludes += [
os.path.join(builder.sourcePath, 'public', 'amtl', 'amtl'),
os.path.join(builder.sourcePath, 'public', 'amtl'),
os.path.join(SM.mms_root, 'core', 'sourcehook')
]
binary.compiler.defines += [
]
binary.compiler.defines += [
'SM_DEFAULT_THREADER',
'SM_LOGIC'
]
]
if builder.target.platform == 'linux':
if builder.target.platform == 'linux':
binary.compiler.postlink += ['-lpthread', '-lrt']
elif builder.target.platform == 'mac':
elif builder.target.platform == 'mac':
binary.compiler.cflags += ['-Wno-deprecated-declarations']
binary.compiler.postlink += ['-framework', 'CoreServices']
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.sources += [
binary.sources += [
'common_logic.cpp',
'smn_adt_array.cpp',
'smn_sorting.cpp',
@ -84,14 +85,14 @@ binary.sources += [
'smn_halflife.cpp',
'FrameIterator.cpp',
'DatabaseConfBuilder.cpp',
]
]
if arch == 'x64':
if arch == 'x64':
binary.sources += ['PseudoAddrManager.cpp']
if builder.target.platform == 'windows':
if builder.target.platform == 'windows':
binary.sources += ['thread/WinThreads.cpp']
else:
else:
binary.sources += ['thread/PosixThreads.cpp']
SM.binaries += [builder.Add(binary)]
SM.binaries += [builder.Add(binary)]

View File

@ -1,28 +1,30 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'bintools.ext', arch)
binary.compiler.defines += ['HOOKING_ENABLED']
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'bintools.ext', arch)
binary.compiler.defines += ['HOOKING_ENABLED']
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
os.path.join(builder.sourcePath, 'public', 'jit'),
os.path.join(builder.sourcePath, 'public', 'jit', 'x86'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.sources += [
binary.sources += [
'extension.cpp',
'CallMaker.cpp',
'CallWrapper.cpp',
'../../public/smsdk_ext.cpp'
]
]
if arch == 'x64':
if arch == 'x64':
binary.sources += ['jit_call_x64.cpp']
else:
else:
binary.sources += ['jit_call.cpp']
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,22 +1,24 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'clientprefs.ext', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'clientprefs.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.sources += [
binary.sources += [
'extension.cpp',
'cookie.cpp',
'menus.cpp',
'natives.cpp',
'query.cpp',
'../../public/smsdk_ext.cpp'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -2,26 +2,27 @@
import os
libcurl = builder.Build('curl-src/lib/AMBuilder')
binary = SM.ExtLibrary(builder, 'webternet.ext', arch)
binary.compiler.includes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'webternet.ext', arch)
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
]
binary.compiler.defines += ['CURL_STATICLIB']
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
binary.compiler.defines += ['CURL_STATICLIB']
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.compiler.postlink += [libcurl[arch].binary]
if builder.target.platform == 'linux':
binary.compiler.postlink += [libcurl[arch].binary]
if builder.target.platform == 'linux':
binary.compiler.postlink += ['-lrt']
elif builder.target.platform == 'windows':
elif builder.target.platform == 'windows':
binary.compiler.postlink += ['ws2_32.lib']
binary.sources += [
binary.sources += [
'extension.cpp',
'curlapi.cpp',
'../../public/smsdk_ext.cpp'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,18 +1,20 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'geoip.ext', arch)
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'geoip.ext', arch)
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
if builder.target.platform == 'windows':
if builder.target.platform == 'windows':
binary.compiler.postlink += ['wsock32.lib']
binary.sources += [
binary.sources += [
'extension.cpp',
'GeoIP.c',
'../../public/smsdk_ext.cpp'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,33 +1,35 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'dbi.mysql.ext', arch)
binary.compiler.cxxincludes += [
if SM.mysql_root:
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'dbi.mysql.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mysql_root[arch], 'include'),
os.path.join(SM.mms_root, 'core', 'sourcehook')
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
if builder.target.platform == 'linux' or builder.target.platform == 'mac':
if builder.target.platform == 'linux' or builder.target.platform == 'mac':
binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'libmysqlclient_r.a'),
'-lz',
'-lpthread',
'-lm',
]
if builder.target.platform == 'linux':
if builder.target.platform == 'linux':
binary.compiler.postlink += ['-lrt']
elif builder.target.platform == 'windows':
elif builder.target.platform == 'windows':
binary.compiler.defines += ['WIN32_LEAN_AND_MEAN']
binary.compiler.postlink += [
os.path.join(SM.mysql_root[arch], 'lib', 'mysqlclient.lib'),
'wsock32.lib'
]
binary.sources += [
binary.sources += [
'../../public/smsdk_ext.cpp',
'mysql/MyBasicResults.cpp',
'mysql/MyBoundResults.cpp',
@ -35,11 +37,12 @@ binary.sources += [
'mysql/MyDriver.cpp',
'mysql/MyStatement.cpp',
'extension.cpp'
]
]
if binary.compiler.family == 'msvc' and binary.compiler.version >= 1900:
if binary.compiler.family == 'msvc' and binary.compiler.version >= 1900:
binary.sources += [ 'msvc15hack.c' ]
binary.compiler.linkflags += ['legacy_stdio_definitions.lib', 'legacy_stdio_wide_specifiers.lib']
binary.compiler.defines += ['HAVE_STRUCT_TIMESPEC']
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,33 +1,35 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'regex.ext', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'regex.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
if builder.target.platform == 'linux':
if builder.target.platform == 'linux':
if arch == 'x86':
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
elif arch == 'x64':
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_linux64', 'libpcre.a')
elif builder.target.platform == 'windows':
elif builder.target.platform == 'windows':
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_win', 'pcre.lib')
elif builder.target.platform == 'mac':
elif builder.target.platform == 'mac':
if arch == 'x86':
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin', 'libpcre.a')
elif arch == 'x64':
path = os.path.join(builder.sourcePath, 'extensions', 'regex', 'lib_darwin64', 'libpcre.a')
binary.compiler.postlink += [binary.Dep(path)]
binary.compiler.postlink += [binary.Dep(path)]
binary.sources += [
binary.sources += [
'extension.cpp',
'CRegEx.cpp',
'../../public/smsdk_ext.cpp'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,25 +1,26 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'dbi.sqlite.ext', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'dbi.sqlite.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.compiler.defines += [
binary.compiler.defines += [
'SQLITE_OMIT_LOAD_EXTENSION',
'SQLITE_THREADSAFE',
'SQLITE_USE_URI',
'SQLITE_ALLOW_URI_AUTHORITY',
]
if builder.target.platform == 'linux':
]
if builder.target.platform == 'linux':
binary.compiler.postlink += ['-ldl', '-lpthread']
binary.sources += [
binary.sources += [
'../../public/smsdk_ext.cpp',
'extension.cpp',
'driver/SqDatabase.cpp',
@ -27,6 +28,7 @@ binary.sources += [
'driver/SqQuery.cpp',
'driver/SqResults.cpp',
'sqlite-source/sqlite3.c'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,21 +1,22 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'topmenus.ext', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'topmenus.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.sources += [
binary.sources += [
'extension.cpp',
'smn_topmenus.cpp',
'TopMenu.cpp',
'TopMenuManager.cpp',
'../../public/smsdk_ext.cpp',
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,21 +1,23 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os
binary = SM.ExtLibrary(builder, 'updater.ext', arch)
binary.compiler.cxxincludes += [
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'updater.ext', arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core', 'sourcehook'),
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.sources += [
binary.sources += [
'extension.cpp',
'MemoryDownloader.cpp',
'Updater.cpp',
'md5.cpp',
'../../public/smsdk_ext.cpp'
]
]
SM.extensions += [builder.Add(binary)]
SM.extensions += [builder.Add(binary)]

View File

@ -1,30 +1,31 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
import os.path
if builder.target.platform in ['windows', 'mac']:
for arch in SM.archs:
if builder.target.platform in ['windows', 'mac']:
name = 'sourcemod_mm'
extra_ldflags = []
elif builder.target.platform == 'linux':
elif builder.target.platform == 'linux':
name = 'sourcemod_mm_i486'
extra_ldflags = ['-ldl']
if arch == 'x64':
if arch == 'x64':
name = 'sourcemod_mm.x64'
binary = SM.Library(builder, name, arch)
binary.compiler.cxxincludes += [
binary = SM.Library(builder, name, arch)
binary.compiler.cxxincludes += [
os.path.join(SM.mms_root, 'core'),
os.path.join(SM.mms_root, 'sourcehook')
]
binary.compiler.defines += ['META_NO_HL2SDK']
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
]
binary.compiler.defines += ['META_NO_HL2SDK']
if binary.compiler.family == 'gcc' or binary.compiler.family == 'clang':
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.compiler.linkflags += extra_ldflags
binary.sources = [
binary.compiler.linkflags += extra_ldflags
binary.sources = [
'loader.cpp'
]
]
nodes = builder.Add(binary)
SM.binaries += [nodes]
nodes = builder.Add(binary)
SM.binaries += [nodes]