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 Sep 18, 2016
1 parent afabd93 commit 36e758a
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 @@ -33,15 +33,6 @@


'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 @@ -71,6 +62,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 36e758a

Please sign in to comment.