Skip to content

Commit

Permalink
Bug 1275419 - Deprecate --enable-build-backend and add --build-backen…
Browse files Browse the repository at this point in the history
…ds. r=chmanchester

--enable-build-backend was taking a list of additional backends to add
to the defaults. Changes to allow to disable some of the defaults is not
possible in a straightforward way, so introduce a new
--build-backends option that sets the exact set of wanted backends,
but also allows to add and remove from the defaults with + or -.

--build-backends=+CompileDB is equivalent to
--enable-build-backend=CompileDB.

--build-backends=-VisualStudio disables the VS backend when it's
automatically enabled.
  • Loading branch information
glandium committed May 26, 2016
1 parent a9ebf01 commit 1e6a070
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,37 @@ def build_backends_choices(help):
return tuple(backends)


option('--enable-build-backend', nargs='+', choices=build_backends_choices,
help='Enable additional build backends')
@deprecated_option('--enable-build-backend', nargs='+',
choices=build_backends_choices)
def build_backend(backends):
if backends:
return tuple('+%s' % b for b in backends)

@depends('--enable-build-backend', '--enable-artifact-builds', target,
compile_environment)
def build_backend(backends, artifact_builds, target, compile_environment):
imply_option('--build-backends', build_backend)


@depends('--enable-artifact-builds', '--disable-compile-environment', '--help')
@imports('sys')
def build_backend_defaults(artifact_builds, compile_environment, _):
if artifact_builds:
all_backends = ['FasterMake+RecursiveMake']
else:
all_backends = ['RecursiveMake', 'FasterMake']
if target.os == 'WINNT' and compile_environment:
# Normally, we'd use target.os == 'WINNT', but a dependency on target
# would require target to depend on --help, as well as host and shell,
# and this is not a can of worms we can open at the moment.
if sys.platform == 'win32' and compile_environment:
all_backends.append('VisualStudio')
all_backends.extend(backends)
return unique_list(all_backends)
return tuple(all_backends)

option('--build-backends', nargs='+', default=build_backend_defaults,
choices=build_backends_choices, help='Build backends to generate')

@depends('--build-backends')
def build_backends(backends):
return backends

set_config('BUILD_BACKENDS', build_backend)
set_config('BUILD_BACKENDS', build_backends)


# Awk detection
Expand Down

0 comments on commit 1e6a070

Please sign in to comment.