Skip to content

Commit 0ded7b1

Browse files
Cong Liurogerwang
authored andcommitted
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
1 parent f4d27e7 commit 0ded7b1

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

common.gypi

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@
3636
'icu_use_data_file_flag%': 0,
3737

3838
'conditions': [
39-
['OS=="win" and component=="shared_library"', {
40-
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
41-
'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
42-
'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
43-
}, {
44-
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
45-
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
46-
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
47-
}],
4839
['OS == "win"', {
4940
'os_posix': 0,
5041
'v8_postmortem_support%': 'false',
@@ -74,6 +65,19 @@
7465

7566
'target_defaults': {
7667
'default_configuration': 'Release',
68+
'variables': {
69+
'conditions': [
70+
['OS=="win" and component=="shared_library"', {
71+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
72+
'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
73+
'win_debug_RuntimeLibrary%': '3', # 3 = /MDd (debug DLL)
74+
}, {
75+
# See http://msdn.microsoft.com/en-us/library/aa652367.aspx
76+
'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
77+
'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
78+
}],
79+
],
80+
},
7781
'configurations': {
7882
'Debug': {
7983
'variables': {

0 commit comments

Comments
 (0)