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')
|
||||
|
||||
@@ -46,14 +46,22 @@ if ($^O =~ /darwin/) {
|
||||
push(@conf_argv, '--hl2sdk-root=/Volumes/hgshare');
|
||||
push(@conf_argv, '--mms-path=/Users/builds/slaves/common/mmsource-1.10');
|
||||
push(@conf_argv, '--mysql-path=/Users/builds/slaves/common/mysql-5.0');
|
||||
push(@conf_argv, '--mysql64-path=/Users/builds/slaves/common/mysql-5.0-x86_64');
|
||||
} elsif ($^O =~ /linux/) {
|
||||
push(@conf_argv, '--hl2sdk-root=/hgshare');
|
||||
push(@conf_argv, '--mms-path=/home/builds/common/mmsource-1.10');
|
||||
push(@conf_argv, '--mysql-path=/home/builds/common/mysql-5.0');
|
||||
push(@conf_argv, '--mysql64-path=/home/builds/common/mysql-5.0-x86_64');
|
||||
} elsif ($^O =~ /MSWin/) {
|
||||
push(@conf_argv, '--hl2sdk-root=H:\\');
|
||||
}
|
||||
|
||||
if ($^O !~ /MSWin/) {
|
||||
push(@conf_argv, '--target-arch=x86,x64');
|
||||
} else {
|
||||
push(@conf_argv, '--target-arch=x86');
|
||||
}
|
||||
|
||||
my $conf_args = join(' ', @conf_argv);
|
||||
|
||||
if ($argn > 0 && $^O !~ /MSWin/) {
|
||||
|
||||
+29
-12
@@ -24,6 +24,25 @@ if [ ! -d "sourcemod" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
getmysql ()
|
||||
{
|
||||
if [ ! -d $mysqlfolder ]; then
|
||||
if [ `command -v wget` ]; then
|
||||
wget $mysqlurl -O $mysqlfolder.$archive_ext
|
||||
elif [ `command -v curl` ]; then
|
||||
curl -o $mysqlfolder.$archive_ext $mysqlurl
|
||||
else
|
||||
echo "Failed to locate wget or curl. Install one of these programs to download MySQL."
|
||||
exit 1
|
||||
fi
|
||||
$decomp $mysqlfolder.$archive_ext
|
||||
mv $mysqlver $mysqlfolder
|
||||
rm $mysqlfolder.$archive_ext
|
||||
fi
|
||||
}
|
||||
|
||||
# 32-bit MySQL
|
||||
mysqlfolder=mysql-5.0
|
||||
if [ $ismac -eq 1 ]; then
|
||||
mysqlver=mysql-5.5.28-osx10.5-x86
|
||||
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext
|
||||
@@ -36,20 +55,18 @@ else
|
||||
mysqlver=mysql-5.6.15-linux-glibc2.5-i686
|
||||
mysqlurl=https://cdn.mysql.com/archives/mysql-5.6/$mysqlver.$archive_ext
|
||||
fi
|
||||
getmysql
|
||||
|
||||
if [ ! -d "mysql-5.0" ]; then
|
||||
if [ `command -v wget` ]; then
|
||||
wget $mysqlurl -O mysql.$archive_ext
|
||||
elif [ `command -v curl` ]; then
|
||||
curl -o mysql.$archive_ext $mysqlurl
|
||||
else
|
||||
echo "Failed to locate wget or curl. Install one of these programs to download MySQL."
|
||||
exit 1
|
||||
fi
|
||||
$decomp mysql.$archive_ext
|
||||
mv $mysqlver mysql-5.0
|
||||
rm mysql.$archive_ext
|
||||
# 64-bit MySQL
|
||||
mysqlfolder=mysql-5.0-x86_64
|
||||
if [ $ismac -eq 1 ]; then
|
||||
mysqlver=mysql-5.5.28-osx10.5-x86_64
|
||||
mysqlurl=https://cdn.mysql.com/archives/mysql-5.5/$mysqlver.$archive_ext
|
||||
elif [ $iswin -eq 0 ]; then
|
||||
mysqlver=mysql-5.6.15-linux-glibc2.5-x86_64
|
||||
mysqlurl=https://cdn.mysql.com/archives/mysql-5.6/$mysqlver.$archive_ext
|
||||
fi
|
||||
getmysql
|
||||
|
||||
checkout ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user