@@ -46,10 +46,12 @@ function getEnv (target) {
4646 env . CC_target = 'emcc'
4747 env . CXX_target = 'em++'
4848 } else if ( target === 'wasi' ) {
49+ if ( ! process . env . WASI_SDK_PATH ) return env
4950 env . AR_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'ar' ) )
5051 env . CC_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang' ) )
5152 env . CXX_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang++' ) )
5253 } else if ( target === 'wasm' ) {
54+ if ( ! process . env . WASI_SDK_PATH ) return env
5355 env . AR_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'ar' ) )
5456 env . CC_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang' ) )
5557 env . CXX_target = path . resolve ( __dirname , '..' , process . env . WASI_SDK_PATH , 'bin' , executable ( 'clang++' ) )
@@ -72,16 +74,17 @@ function quote (path) {
7274 if ( path . includes ( ' ' ) ) {
7375 return `"${ path } "`
7476 }
77+ return path
7578}
7679
7780describe ( 'windows-cross-compile' , function ( ) {
7881 it ( 'build simple node-api addon' , async function ( ) {
7982 if ( process . platform !== 'win32' ) {
80- return this . skip ( 'This test is only for windows ' )
83+ return this . skip ( 'This test is only for Windows ' )
8184 }
82- const env = getEnv ( 'win-clang ' )
85+ const env = getEnv ( 'wasm ' )
8386 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 ' )
8588 }
8689
8790 // handle bash whitespace
0 commit comments