Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit e5ba3fd

Browse files
committed
Bug 1296530 - Replace include_when with include, and remove include_when. r=chmanchester
--HG-- extra : rebase_source : e2efd38b3875dde3dae996405838e9ca20475c32
1 parent 5983667 commit e5ba3fd

5 files changed

Lines changed: 11 additions & 27 deletions

File tree

build/moz.configure/compilers-util.configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def compiler_class(compiler):
4747
@checking_fn
4848
def func(compiler, flags, extra_flags):
4949
flags = flags or []
50-
flags += extra_flags
50+
flags += extra_flags or []
5151
flags.append('-c')
5252

5353
if try_invoke_compiler(

build/moz.configure/toolchain.configure

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,14 @@ set_config('HAVE_YASM', have_yasm)
6262
# Until the YASM variable is not necessary in old-configure.
6363
add_old_configure_assignment('YASM', have_yasm)
6464

65-
@dependable
66-
def extra_toolchain_flags():
67-
# This value will be overriden for android builds, where
68-
# extra flags are required to do basic checks.
69-
return []
70-
7165
# Android NDK
7266
# ==============================================================
7367

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

78-
include_when('android-ndk.configure', when=compiling_android)
72+
include('android-ndk.configure', when=compiling_android)
7973

8074
# MacOS deployment target version
8175
# ==============================================================

build/moz.configure/util.configure

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,3 @@ def depends_when(*args, **kwargs):
405405
return fn(*args)
406406
return wrapper
407407
return decorator
408-
409-
# Includes a file when the given condition evaluates to a truthy value.
410-
@template
411-
def include_when(filename, when):
412-
# Assume, for now, our condition already depends on --help.
413-
@depends(when, '--help')
414-
def conditional_include(value, _):
415-
if value:
416-
return filename
417-
include(conditional_include)

js/moz.configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@ add_old_configure_assignment('JS_HAS_CTYPES', js_has_ctypes)
235235
def ctypes_and_compile_environment(ctypes, compile_environment, _):
236236
return ctypes and compile_environment
237237

238-
include_when('ffi.configure', when=ctypes_and_compile_environment)
238+
include('ffi.configure', when=ctypes_and_compile_environment)

moz.configure

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ include('build/moz.configure/pkg.configure')
108108
# requiring this file in unit tests.
109109
add_old_configure_assignment('PKG_CONFIG', pkg_config)
110110

111-
include_when('build/moz.configure/toolchain.configure',
112-
when='--enable-compile-environment')
113-
include_when('build/moz.configure/memory.configure',
114-
when='--enable-compile-environment')
115-
include_when('build/moz.configure/headers.configure',
116-
when='--enable-compile-environment')
117-
include_when('build/moz.configure/warnings.configure',
118-
when='--enable-compile-environment')
111+
include('build/moz.configure/toolchain.configure',
112+
when='--enable-compile-environment')
113+
include('build/moz.configure/memory.configure',
114+
when='--enable-compile-environment')
115+
include('build/moz.configure/headers.configure',
116+
when='--enable-compile-environment')
117+
include('build/moz.configure/warnings.configure',
118+
when='--enable-compile-environment')
119119

120120
include(include_project_configure)
121121

0 commit comments

Comments
 (0)