Skip to content

Commit

Permalink
move conditions using 'component' to 'target_defaults'
Browse files Browse the repository at this point in the history
'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
  • Loading branch information
Cong Liu authored and rogerwang committed Oct 27, 2016
1 parent c2e2cc1 commit bef2a79
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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': {
Expand Down

0 comments on commit bef2a79

Please sign in to comment.