@@ -46,10 +46,12 @@ function getEnv (target) {
46
46
env . CC_target = 'emcc'
47
47
env . CXX_target = 'em++'
48
48
} else if ( target === 'wasi' ) {
49
+ if ( ! process . env . WASI_SDK_PATH ) return env
49
50
env . AR_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'ar' ) )
50
51
env . CC_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang' ) )
51
52
env . CXX_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang++' ) )
52
53
} else if ( target === 'wasm' ) {
54
+ if ( ! process . env . WASI_SDK_PATH ) return env
53
55
env . AR_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'ar' ) )
54
56
env . CC_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang' ) )
55
57
env . CXX_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang++' ) )
@@ -72,16 +74,17 @@ function quote (path) {
72
74
if ( path . includes ( ' ' ) ) {
73
75
return `"${ path } "`
74
76
}
77
+ return path
75
78
}
76
79
77
80
describe ( 'windows-cross-compile' , function ( ) {
78
81
it ( 'build simple node-api addon' , async function ( ) {
79
82
if ( process . platform !== 'win32' ) {
80
- return this . skip ( 'This test is only for windows ' )
83
+ return this . skip ( 'This test is only for Windows ' )
81
84
}
82
- const env = getEnv ( 'win-clang ' )
85
+ const env = getEnv ( 'wasm ' )
83
86
if ( ! gracefulFs . existsSync ( env . CC_target ) ) {
84
- return this . skip ( 'Visual Studio Clang is not installed ' )
87
+ return this . skip ( 'CC_target does not exist ' )
85
88
}
86
89
87
90
// handle bash whitespace
0 commit comments