Bug 1296530 - Replace include_when with include, and remove include_when. r=chmanchester

--HG--
extra : rebase_source : e2efd38b3875dde3dae996405838e9ca20475c32
This commit is contained in:
Mike Hommey 2016-10-13 17:15:24 +09:00
parent 5983667dd8
commit e5ba3fd67a
5 changed files with 11 additions and 27 deletions

View File

@ -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(

View File

@ -62,12 +62,6 @@ 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
# ==============================================================
@ -75,7 +69,7 @@ def extra_toolchain_flags():
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
# ==============================================================

View File

@ -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)

View File

@ -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)

View File

@ -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)