1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-02-20 13:54:14 +01:00

Add search paths for HL2SDKs.

This commit is contained in:
David Anderson 2014-05-26 22:41:20 -07:00
parent 477cdfa18b
commit f6d2cdf93d
3 changed files with 33 additions and 11 deletions

View File

@ -84,7 +84,10 @@ class MMSConfig(object):
for sdk_name in PossibleSDKs:
sdk = PossibleSDKs[sdk_name]
if builder.target_platform in sdk.platform:
sdk_path = ResolveEnvPath(sdk.envvar, sdk.folder)
if builder.options.hl2sdk_root:
sdk_path = os.path.join(builder.options.hl2sdk_root, sdk.folder)
else:
sdk_path = ResolveEnvPath(sdk.envvar, sdk.folder)
if sdk_path is None:
if use_all or sdk_name in sdk_list:
raise Exception('Could not find a valid path for {0}'.format(sdk.envvar))

View File

@ -1,19 +1,21 @@
# vim: set sts=2 ts=8 sw=2 tw=99 et:
import sys
try:
from ambuild2 import run
from ambuild2 import run
except:
try:
import ambuild
sys.stderr.write('It looks like you have AMBuild 1 installed, but this project uses AMBuild 2.\n')
sys.stderr.write('Upgrade to the latest version of AMBuild to continue.\n')
except:
sys.stderr.write('AMBuild must be installed to build this project.\n')
sys.stderr.write('http://www.alliedmods.net/ambuild\n')
sys.exit(1)
try:
import ambuild
sys.stderr.write('It looks like you have AMBuild 1 installed, but this project uses AMBuild 2.\n')
sys.stderr.write('Upgrade to the latest version of AMBuild to continue.\n')
except:
sys.stderr.write('AMBuild must be installed to build this project.\n')
sys.stderr.write('http://www.alliedmods.net/ambuild\n')
sys.exit(1)
run = run.PrepareBuild(sourcePath=sys.path[0])
run.default_build_folder = 'obj-' + run.target_platform
run.options.add_option('--hl2sdk-root', type=str, dest='hl2sdk_root', default=None,
help='Root search folder for HL2SDKs')
run.options.add_option('--enable-debug', action='store_const', const='1', dest='debug',
help='Enable debugging symbols')
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',

View File

@ -26,8 +26,25 @@ if (!(-f 'OUTPUT/.ambuild2/graph') || !(-f 'OUTPUT/.ambuild2/vars')) {
chdir('OUTPUT');
my ($result, $argn);
$argn = $#ARGV + 1;
print "Attempting to reconfigure...\n";
my $conf_args = '--enable-optimize --no-color --symbol-files';
my @conf_argv = (
'--enable-optimize',
'--no-color',
'--symbol-files'
);
if ($^O =~ /darwin/) {
push(@conf_argv, '--hl2sdk-root=/Volumes/hgshare');
} elsif ($^O =~ /linux/) {
push(@conf_argv, '--hl2sdk-root=/hgshare');
} elsif ($^O =~ /MSWin/) {
push(@conf_argv, '--hl2sdk-root=H:\\');
}
my $conf_args = join(' ', @conf_argv);
if ($argn > 0 && $^O !~ /MSWin/) {
$result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py $conf_args`;
} else {