Improve build target argument handling

This commit is contained in:
Mátyás Mustoha 2016-04-29 22:39:32 +02:00
parent 319f520e4d
commit 200af79c4b
2 changed files with 18 additions and 15 deletions

View file

@ -175,21 +175,23 @@ class MachCommands(CommandBase):
print("Please specify either --dev or --release.")
sys.exit(1)
targets = []
if target and android:
print("Please specify either --target or --android.")
sys.exit(1)
if release:
opts += ["--release"]
if target:
opts += ["--target", target]
targets.append(target)
if jobs is not None:
opts += ["-j", jobs]
if verbose:
opts += ["-v"]
if android:
opts += ["--target", self.config["android"]["target"]]
targets.append("arm-linux-androideabi")
target = self.config["android"]["target"]
self.ensure_bootstrapped(targets=targets)
if target:
opts += ["--target", target]
self.ensure_bootstrapped(target=target)
if debug_mozjs or self.config["build"]["debug-mozjs"]:
features += ["script/debugmozjs"]
@ -330,8 +332,8 @@ class MachCommands(CommandBase):
action='store_true',
help='Build in release mode')
def build_gonk(self, jobs=None, verbose=False, release=False):
targets = ["arm-linux-androideabi"]
self.ensure_bootstrapped(targets=targets)
target = "arm-linux-androideabi"
self.ensure_bootstrapped(target=target)
opts = []
if jobs is not None: