Bug 1651680 - Support --enable-strip/--enable-install-strip on mingw. r=nalexander, a=RyanVM
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Aug 2020 02:53:34 +0000
changeset 600007 3ce564d77e5f4acd0f53241c0652af470ed2ffdb
parent 600006 0af3b12bc9a079c6ea1237e45a461b8752c59c8f
child 600008 4926d2fb2493288033f49d141704ec14bf1dc074
push id58
push userryanvm@gmail.com
push dateThu, 13 Aug 2020 21:28:01 +0000
treeherdermozilla-esr78@4926d2fb2493 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, RyanVM
bugs1651680
milestone78.2.0
Bug 1651680 - Support --enable-strip/--enable-install-strip on mingw. r=nalexander, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D86649
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -666,31 +666,40 @@ add_old_configure_assignment('enable_dtr
 
 
 js_option('--disable-icf', help='Disable Identical Code Folding')
 
 add_old_configure_assignment(
     'MOZ_DISABLE_ICF', '1', when=depends('--enable-icf')(lambda x: not x))
 
 
-@depends(compile_environment, target)
-def may_strip(compile_environment, target):
-    return compile_environment and target.kernel != 'WINNT'
+js_option('--enable-strip', when=compile_environment,
+          help='Enable stripping of libs & executables')
 
-js_option('--enable-strip', when=may_strip, help='Enable stripping of libs & executables')
+# This should be handled as a `when` once bug 1617793 is fixed.
+@depends('--enable-strip', c_compiler, when=compile_environment)
+def enable_strip(strip, c_compiler):
+    if strip and c_compiler.type != 'clang-cl':
+        return True
 
-set_config('ENABLE_STRIP', True, when='--enable-strip')
+set_config('ENABLE_STRIP', enable_strip)
 
-js_option('--disable-install-strip', when=may_strip,
+js_option('--disable-install-strip', when=compile_environment,
           help='Enable stripping of libs & executables when packaging')
 
-set_config('PKG_STRIP', True, when='--enable-install-strip')
+# This should be handled as a `when` once bug 1617793 is fixed.
+@depends('--enable-install-strip', c_compiler, when=compile_environment)
+def enable_install_strip(strip, c_compiler):
+    if strip and c_compiler.type != 'clang-cl':
+        return True
+
+set_config('PKG_STRIP', enable_install_strip)
 
 
-@depends('--enable-strip', '--enable-install-strip', when=may_strip)
+@depends('--enable-strip', '--enable-install-strip', when=compile_environment)
 def strip(strip, install_strip):
     return strip or install_strip
 
 js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
 
 @depends('STRIP_FLAGS', profiling, target, when=strip)
 def strip_flags(flags, profiling, target):
     if flags: