Bug 1298536 - Allow flags passed to try_compile to be a depends function. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Wed, 31 Aug 2016 14:23:20 -0700
changeset 312362 a4df9ee747c39bbb79a17ef999fc64eb5c2c19c2
parent 312361 42ada9dc0ab3c9e872f56201a0a1c4f7eb685acc
child 312363 3f398fa60de08dc4c6c0076105c38135afac9ebd
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1298536
milestone51.0a1
Bug 1298536 - Allow flags passed to try_compile to be a depends function. r=glandium MozReview-Commit-ID: BH9oJPHei3r
build/moz.configure/compilers-util.configure
--- a/build/moz.configure/compilers-util.configure
+++ b/build/moz.configure/compilers-util.configure
@@ -38,24 +38,20 @@ def compiler_class(compiler):
 
             if check_msg:
                 def checking_fn(fn):
                     return checking(check_msg)(fn)
             else:
                 def checking_fn(fn):
                     return fn
 
-            def get_flags():
-                if flags:
-                    return flags[:]
-
-            @depends_when(self, extra_toolchain_flags, when=when)
+            @depends_when(self, dependable(flags), extra_toolchain_flags, when=when)
             @checking_fn
-            def func(compiler, extra_flags):
-                flags = get_flags() or []
+            def func(compiler, flags, extra_flags):
+                flags = flags or []
                 flags += extra_flags
                 flags.append('-c')
 
                 if try_invoke_compiler(
                     compiler.wrapper + [compiler.compiler] + compiler.flags,
                     compiler.language, source, flags,
                     onerror=onerror) is not None:
                     return True