@@ -38,7 +38,7 @@ def rebuild_addons(args):
38
38
39
39
# Copy node.lib.
40
40
if args .is_win :
41
- node_lib_dir = os .path .join (headers_dir , 'Release' )
41
+ node_lib_dir = os .path .join (headers_dir , args . config )
42
42
os .makedirs (node_lib_dir )
43
43
shutil .copy2 (os .path .join (args .out_dir , 'node.lib' ),
44
44
os .path .join (node_lib_dir , 'node.lib' ))
@@ -89,17 +89,17 @@ def node_gyp_rebuild(test_dir):
89
89
executor .map (node_gyp_rebuild , test_dirs )
90
90
91
91
def get_default_out_dir (args ):
92
- default_out_dir = os .path .join ('out' , 'Release' )
92
+ default_out_dir = os .path .join ('out' , args . config )
93
93
if not args .is_win :
94
94
# POSIX platforms only have one out dir.
95
95
return default_out_dir
96
96
# On Windows depending on the args of GYP and configure script, the out dir
97
- # could be 'out/Release' or just 'Release'.
97
+ # could be 'out/Release', 'out/Debug' or just 'Release' or 'Debug '.
98
98
if os .path .exists (default_out_dir ):
99
99
return default_out_dir
100
- if os .path .exists ('Release' ):
101
- return 'Release'
102
- raise RuntimeError ('Can not find out dir, did you run configure ?' )
100
+ if os .path .exists (args . config ):
101
+ return args . config
102
+ raise RuntimeError ('Cannot find out dir, did you run build ?' )
103
103
104
104
def main ():
105
105
if sys .platform == 'cygwin' :
@@ -124,6 +124,8 @@ def main():
124
124
default = 'deps/npm/node_modules/node-gyp/bin/node-gyp.js' )
125
125
parser .add_argument ('--is-win' , help = 'build for Windows target' ,
126
126
action = 'store_true' , default = (sys .platform == 'win32' ))
127
+ parser .add_argument ('--config' , help = 'build config (Release or Debug)' ,
128
+ default = 'Release' )
127
129
args , unknown_args = parser .parse_known_args ()
128
130
129
131
if not args .out_dir :
0 commit comments