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:
@@ -38,7 +38,7 @@ folder_list = [
|
||||
'cfg/sourcemod',
|
||||
]
|
||||
|
||||
if 'x64' in SM.archs:
|
||||
if 'x86_64' in SM.target_archs:
|
||||
folder_list.extend([
|
||||
'addons/sourcemod/bin/x64',
|
||||
'addons/sourcemod/extensions/x64',
|
||||
@@ -52,16 +52,22 @@ for folder in folder_list:
|
||||
|
||||
# Copy binaries.
|
||||
for cxx_task in SM.binaries:
|
||||
binpath = cxx_task.binary.path
|
||||
if '.x64' + os.sep in binpath and not 'sourcemod_mm' in binpath:
|
||||
if cxx_task.target.arch == 'x86_64':
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin/x64'])
|
||||
else:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin'])
|
||||
for cxx_task in SM.extensions:
|
||||
if '.x64' + os.sep in cxx_task.binary.path:
|
||||
if cxx_task.target.arch == 'x86_64':
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions/x64'])
|
||||
else:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])
|
||||
for cxx_task in SM.spvm:
|
||||
if cxx_task.target.arch == 'x86':
|
||||
dest_path = os.path.join('addons/sourcemod/bin',
|
||||
'sourcepawn.jit.x86' + os.path.splitext(cxx_task.binary.path)[1])
|
||||
builder.AddCopy(cxx_task.binary, dest_path)
|
||||
elif cxx_task.target.arch == 'x86_64':
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin/x64'])
|
||||
|
||||
def lipo(binaries, outFolder):
|
||||
bins = []
|
||||
@@ -78,11 +84,11 @@ def lipo(binaries, outFolder):
|
||||
outputs = [os.path.join(outFolder, binary)],
|
||||
)
|
||||
|
||||
if builder.target.platform == 'mac' and len(SM.archs) > 1:
|
||||
if builder.host.platform == 'mac' and len(SM.target_archs) > 1:
|
||||
lipo(SM.spcomp_bins, 'addons/sourcemod/scripting')
|
||||
else:
|
||||
for bin_task in SM.spcomp_bins:
|
||||
if '.x64' + os.sep in bin_task.binary.path:
|
||||
if bin_task.target.arch == 'x86_64':
|
||||
file = os.path.basename(bin_task.binary.path) + '64'
|
||||
builder.AddCopy(bin_task.binary, os.path.normpath('addons/sourcemod/scripting/' + file))
|
||||
else:
|
||||
@@ -510,7 +516,7 @@ CopyFiles('plugins/playercommands', 'addons/sourcemod/scripting/playercommands',
|
||||
]
|
||||
)
|
||||
|
||||
if builder.target.platform == 'windows':
|
||||
if builder.host.platform == 'windows':
|
||||
CopyFiles('tools/batchtool', 'addons/sourcemod/scripting', ['compile.exe'])
|
||||
else:
|
||||
CopyFiles('plugins', 'addons/sourcemod/scripting', ['compile.sh'])
|
||||
|
||||
@@ -53,10 +53,11 @@ if ($^O =~ /darwin/) {
|
||||
}
|
||||
|
||||
if ($^O !~ /MSWin/) {
|
||||
push(@conf_argv, '--target-arch=x86,x64');
|
||||
push(@conf_argv, '--targets=x86,x86_64');
|
||||
} else {
|
||||
push(@conf_argv, '--target-arch=x86');
|
||||
push(@conf_argv, '--targets=x86');
|
||||
}
|
||||
push(@conf_argv, '--sdks=all');
|
||||
|
||||
my $conf_args = join(' ', @conf_argv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user