Skip to content

Commit

Permalink
Bug 1296530 - Replace include_when with include, and remove include_w…
Browse files Browse the repository at this point in the history
…hen. r=chmanchester

--HG--
extra : rebase_source : e2efd38b3875dde3dae996405838e9ca20475c32
  • Loading branch information
glandium committed Oct 13, 2016
1 parent 5983667 commit e5ba3fd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build/moz.configure/compilers-util.configure
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def compiler_class(compiler):
@checking_fn
def func(compiler, flags, extra_flags):
flags = flags or []
flags += extra_flags
flags += extra_flags or []
flags.append('-c')

if try_invoke_compiler(
Expand Down
8 changes: 1 addition & 7 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,14 @@ set_config('HAVE_YASM', have_yasm)
# Until the YASM variable is not necessary in old-configure.
add_old_configure_assignment('YASM', have_yasm)

@dependable
def extra_toolchain_flags():
# This value will be overriden for android builds, where
# extra flags are required to do basic checks.
return []

# Android NDK
# ==============================================================

@depends('--disable-compile-environment', build_project, gonkdir, '--help')
def compiling_android(compile_env, build_project, gonkdir, _):
return compile_env and (gonkdir or build_project in ('mobile/android', 'js'))

include_when('android-ndk.configure', when=compiling_android)
include('android-ndk.configure', when=compiling_android)

# MacOS deployment target version
# ==============================================================
Expand Down
10 changes: 0 additions & 10 deletions build/moz.configure/util.configure
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,3 @@ def depends_when(*args, **kwargs):
return fn(*args)
return wrapper
return decorator

# Includes a file when the given condition evaluates to a truthy value.
@template
def include_when(filename, when):
# Assume, for now, our condition already depends on --help.
@depends(when, '--help')
def conditional_include(value, _):
if value:
return filename
include(conditional_include)
2 changes: 1 addition & 1 deletion js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
def ctypes_and_compile_environment(ctypes, compile_environment, _):
return ctypes and compile_environment

include_when('ffi.configure', when=ctypes_and_compile_environment)
include('ffi.configure', when=ctypes_and_compile_environment)
16 changes: 8 additions & 8 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ include('build/moz.configure/pkg.configure')
# requiring this file in unit tests.
add_old_configure_assignment('PKG_CONFIG', pkg_config)

include_when('build/moz.configure/toolchain.configure',
when='--enable-compile-environment')
include_when('build/moz.configure/memory.configure',
when='--enable-compile-environment')
include_when('build/moz.configure/headers.configure',
when='--enable-compile-environment')
include_when('build/moz.configure/warnings.configure',
when='--enable-compile-environment')
include('build/moz.configure/toolchain.configure',
when='--enable-compile-environment')
include('build/moz.configure/memory.configure',
when='--enable-compile-environment')
include('build/moz.configure/headers.configure',
when='--enable-compile-environment')
include('build/moz.configure/warnings.configure',
when='--enable-compile-environment')

include(include_project_configure)

Expand Down

0 comments on commit e5ba3fd

Please sign in to comment.