From bef2a79edeee424e0f3f56c7b54a71b3621f473c Mon Sep 17 00:00:00 2001 From: Cong Liu Date: Fri, 9 Sep 2016 14:13:35 +0800 Subject: [PATCH] move conditions using 'component' to 'target_defaults' 'component' was defined within NW.js building procedure. However it wasn't defined until including 'common.gypi' when building addons. Conditions within 'variables' cannot use variable within the same level. Moving conditions to 'target_defaults' will make 'component' defined before evaluating the conditions, to prevent addon building failures. fixed nwjs/nw-gyp#96 --- common.gypi | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/common.gypi b/common.gypi index 928990ec6d6..6bb4644b542 100644 --- a/common.gypi +++ b/common.gypi @@ -36,15 +36,6 @@ 'icu_use_data_file_flag%': 0, 'conditions': [ - ['OS=="win" and component=="shared_library"', { - # See http://msdn.microsoft.com/en-us/library/aa652367.aspx - 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL) - 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL) - }, { - # See http://msdn.microsoft.com/en-us/library/aa652367.aspx - 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) - 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) - }], ['OS == "win"', { 'os_posix': 0, 'v8_postmortem_support%': 'false', @@ -74,6 +65,19 @@ 'target_defaults': { 'default_configuration': 'Release', + 'variables': { + 'conditions': [ + ['OS=="win" and component=="shared_library"', { + # See http://msdn.microsoft.com/en-us/library/aa652367.aspx + 'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL) + 'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL) + }, { + # See http://msdn.microsoft.com/en-us/library/aa652367.aspx + 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static) + 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static) + }], + ], + }, 'configurations': { 'Debug': { 'variables': {