Bug 1386876 - Allow dictionary variables to be passed to gyp_dir_attrs. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Mon, 11 Sep 2017 11:36:46 -0700
changeset 662679 562b0ea038287db1aa841d8db7d3f631ff286df4
parent 662678 40dbde701504661c0b537073ba6bbd305c76e7a9
child 662680 2de74e37233164513adc7145871ea56b3fb76166
push id79159
push userhikezoe@mozilla.com
push dateMon, 11 Sep 2017 23:25:15 +0000
reviewersglandium
bugs1386876
milestone57.0a1
Bug 1386876 - Allow dictionary variables to be passed to gyp_dir_attrs. r=glandium MozReview-Commit-ID: HTfZLqM9Mdd
python/mozbuild/mozbuild/frontend/gyp_reader.py
--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py
+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py
@@ -329,16 +329,18 @@ def process_gyp_result(gyp_result, gyp_d
         context['COMPILE_FLAGS']['STL'] = []
 
         for key, value in gyp_dir_attrs.sandbox_vars.items():
             if context.get(key) and isinstance(context[key], list):
                 # If we have a key from sanbox_vars that's also been
                 # populated here we use the value from sandbox_vars as our
                 # basis rather than overriding outright.
                 context[key] = value + context[key]
+            elif context.get(key) and isinstance(context[key], dict):
+                context[key].update(value)
             else:
                 context[key] = value
 
         yield context
 
 
 # A version of gyp.Load that doesn't return the generator (because module objects
 # aren't Pickle-able, and we don't use it anyway).