Update to AMBuild 2.2.

This is a pretty big diff because SourceMod had lots of multi-arch
workarounds that can now go away. I've also changed 'x64' to 'x86_64' in
many places since this is how AMBuild normalizes it, and it's far too
late to pick the shorter string, so we might as well suck it up.

The --target-archs parameter has been replaced with --targets. It works
the same way.

The default behavior for SDK inclusion is now "present" instead of
"all" since this lowers the burden of storing many SDKs. Official builds
will still be made with --sdks=all.
This commit is contained in:
David Anderson
2020-08-18 23:09:43 -07:00
parent 1b86c8564d
commit 785c6aa1cf
26 changed files with 289 additions and 235 deletions
+5 -5
View File
@@ -2,8 +2,8 @@
import os
libcurl = builder.Build('curl-src/lib/AMBuilder')
for arch in SM.archs:
binary = SM.ExtLibrary(builder, 'webternet.ext', arch)
for cxx in builder.targets:
binary = SM.ExtLibrary(builder, cxx, 'webternet.ext')
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
]
@@ -12,10 +12,10 @@ for arch in SM.archs:
binary.compiler.cxxflags += ['-fno-rtti']
elif binary.compiler.family == 'msvc':
binary.compiler.cxxflags += ['/GR-']
binary.compiler.postlink += [libcurl[arch].binary]
if builder.target.platform == 'linux':
binary.compiler.postlink += [libcurl[binary.compiler.target.arch].binary]
if binary.compiler.target.platform == 'linux':
binary.compiler.postlink += ['-lrt']
elif builder.target.platform == 'windows':
elif binary.compiler.target.platform == 'windows':
binary.compiler.postlink += ['ws2_32.lib']
binary.sources += [
+6 -6
View File
@@ -4,25 +4,25 @@ import os, platform
builder.SetBuildFolder('libcurl')
rvalue = {}
for arch in SM.archs:
binary = SM.StaticLibrary(builder, 'curl', arch)
for cxx in builder.targets:
binary = SM.StaticLibrary(builder, cxx, 'curl')
binary.compiler.includes += [
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'lib'),
os.path.join(builder.sourcePath, 'extensions', 'curl', 'curl-src', 'include')
]
if builder.target.platform == 'mac':
if binary.compiler.target.platform == 'mac':
mac_version, ignore, ignore = platform.mac_ver()
mac_tuple = mac_version.split('.')
if int(mac_tuple[0]) >= 10 and int(mac_tuple[1]) >= 9:
binary.compiler.defines += ['BUILTIN_STRLCAT']
elif builder.target.platform == 'windows':
elif binary.compiler.target.platform == 'windows':
binary.compiler.defines += [
'BUILDING_LIBCURL',
'CURL_STATICLIB',
'CURL_DISABLE_LDAP',
]
elif builder.target.platform == 'linux':
elif binary.compiler.target.platform == 'linux':
binary.compiler.defines += ['_GNU_SOURCE']
if binary.compiler.family == 'clang':
@@ -96,5 +96,5 @@ for arch in SM.archs:
'url.c',
'version.c'
]
rvalue[arch] = builder.Add(binary)
rvalue[binary.compiler.target.arch] = builder.Add(binary)