Bug 1405982 - Rename the method "build_not_win_mac" to "is_linker_option_enabled" match what it is doing r=glandium
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 10 Oct 2017 12:01:32 +0200
changeset 385664 370a4a2a78980dea15b6a3f0801f902a62602741
parent 385663 dd04bc03bb5ef42e178e9ecaeb202f78281f0f26
child 385665 9267711b1ddfef1a88f518983933ba3a6779e6bf
push id32664
push userarchaeopteryx@coole-files.de
push dateThu, 12 Oct 2017 09:34:55 +0000
treeherdermozilla-central@a32c32d9631c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1405982
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1405982 - Rename the method "build_not_win_mac" to "is_linker_option_enabled" match what it is doing r=glandium MozReview-Commit-ID: 3Kv9z79Cct8
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1197,29 +1197,27 @@ def developer_options(value):
 
 add_old_configure_assignment('DEVELOPER_OPTIONS', developer_options)
 set_config('DEVELOPER_OPTIONS', developer_options)
 
 # Linker detection
 # ==============================================================
 
 @depends(target)
-def build_not_win_mac(target):
+def is_linker_option_enabled(target):
     if target.kernel not in ('Darwin', 'WINNT', 'SunOS'):
         return True
 
 
 option('--enable-gold',
        env='MOZ_FORCE_GOLD',
        help='Enable GNU Gold Linker when it is not already the default',
-       when=build_not_win_mac)
+       when=is_linker_option_enabled)
 
-imply_option('--enable-linker',
-             depends_if('--enable-gold', when=build_not_win_mac)(lambda x: 'gold'),
-             when=build_not_win_mac)
+imply_option('--enable-linker', 'gold', when='--enable-gold')
 
 @imports('os')
 @imports('shutil')
 def enable_gnu_linker(enable_gold_option, c_compiler, developer_options, build_env,
                       toolchain_flags, linker_name):
     # Used to check the kind of linker
     version_check = ['-Wl,--version']
     cmd_base = c_compiler.wrapper + [c_compiler.compiler] + c_compiler.flags
@@ -1285,20 +1283,20 @@ def enable_gnu_linker(enable_gold_option
     # For other platforms without gold or the GNU linker
     return namespace(
         KIND='other'
     )
 
 js_option('--enable-linker', nargs=1,
           choices=('bfd', 'gold', 'lld', 'other'),
           help='Select the linker',
-          when=build_not_win_mac)
+          when=is_linker_option_enabled)
 
 @depends('--enable-linker', c_compiler, developer_options, check_build_environment,
-         extra_toolchain_flags, when=build_not_win_mac)
+         extra_toolchain_flags, when=is_linker_option_enabled)
 @checking('for linker', lambda x: x.KIND)
 def select_linker(linker, c_compiler, developer_options, build_env, toolchain_flags):
     linker = linker[0] if linker else 'other'
     if linker in ('gold', 'bfd', 'other'):
         return enable_gnu_linker(linker == 'gold', c_compiler, developer_options,
                                  build_env, toolchain_flags, linker)
     if linker == 'lld':
         version_check = ['-Wl,--version']