64-bit support for CSGO on Linux and macOS (#705)
This commit is contained in:
@@ -38,6 +38,12 @@ folder_list = [
|
||||
'cfg/sourcemod',
|
||||
]
|
||||
|
||||
if 'x64' in SM.archs:
|
||||
folder_list.extend([
|
||||
'addons/sourcemod/bin/x64',
|
||||
'addons/sourcemod/extensions/x64',
|
||||
])
|
||||
|
||||
# Create the distribution folder hierarchy.
|
||||
folder_map = {}
|
||||
for folder in folder_list:
|
||||
@@ -46,11 +52,41 @@ for folder in folder_list:
|
||||
|
||||
# Copy binaries.
|
||||
for cxx_task in SM.binaries:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin'])
|
||||
binpath = cxx_task.binary.path
|
||||
if '.x64' + os.sep in binpath and not 'sourcemod_mm' in binpath:
|
||||
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:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])
|
||||
builder.AddCopy(SM.spcomp.binary, folder_map['addons/sourcemod/scripting'])
|
||||
if '.x64' + os.sep in cxx_task.binary.path:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions/x64'])
|
||||
else:
|
||||
builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])
|
||||
|
||||
def lipo(binaries, outFolder):
|
||||
bins = []
|
||||
binPaths = []
|
||||
for bin in binaries:
|
||||
bins.append(bin.binary)
|
||||
binPaths.append(os.path.join(builder.buildPath, bin.binary.path))
|
||||
argv = ['lipo', '-create']
|
||||
binary = os.path.basename(binPaths[0])
|
||||
outputPath = os.path.join(builder.buildPath, builder.buildFolder, outFolder, binary)
|
||||
builder.AddCommand(
|
||||
argv = argv + binPaths + ['-output', outputPath],
|
||||
inputs = bins,
|
||||
outputs = [os.path.join(outFolder, binary)],
|
||||
)
|
||||
|
||||
if builder.target.platform == 'mac' and len(SM.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:
|
||||
file = os.path.basename(bin_task.binary.path) + '64'
|
||||
builder.AddCopy(bin_task.binary, os.path.normpath('addons/sourcemod/scripting/' + file))
|
||||
else:
|
||||
builder.AddCopy(bin_task.binary, folder_map['addons/sourcemod/scripting'])
|
||||
|
||||
if SM.use_auto_versioning():
|
||||
# Copy version_auto.inc.
|
||||
@@ -61,7 +97,7 @@ if SM.use_auto_versioning():
|
||||
# Export PDB files. We write to a file in the build folder which is pretty
|
||||
# verboten, but it's okay if it's in the root since AMBuild will never try
|
||||
# to rmdir the root.
|
||||
full_binary_list = SM.binaries + SM.extensions + [SM.spcomp]
|
||||
full_binary_list = SM.binaries + SM.extensions + SM.spcomp_bins
|
||||
with open(os.path.join(builder.buildPath, 'pdblog.txt'), 'w') as fp:
|
||||
for task in full_binary_list:
|
||||
fp.write(task.debug.path + '\n')
|
||||
|
||||
Reference in New Issue
Block a user