From e1872e6bfb71ee8817b4aa829fcde9bb1752a9dc Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Thu, 16 Feb 2023 16:04:47 +0800 Subject: [PATCH] may rename (WebAssembly/wasi-sdk#297) --- script/release.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/release.js b/script/release.js index 4827d597..87c2cd1b 100644 --- a/script/release.js +++ b/script/release.js @@ -82,10 +82,17 @@ async function main () { sysroot ], cwd) + let WASI_THREADS_CMAKE_TOOLCHAIN_FILE = '' if (fs.existsSync(path.join(wasiSdkPath, 'share/cmake/wasi-sdk-pthread.cmake'))) { + WASI_THREADS_CMAKE_TOOLCHAIN_FILE = `${WASI_SDK_PATH}/share/cmake/wasi-sdk-pthread.cmake` + } else if (fs.existsSync(path.join(wasiSdkPath, 'share/cmake/wasi-sdk-threads.cmake'))) { + WASI_THREADS_CMAKE_TOOLCHAIN_FILE = `${WASI_SDK_PATH}/share/cmake/wasi-sdk-threads.cmake` + } + + if (WASI_THREADS_CMAKE_TOOLCHAIN_FILE) { await spawn('cmake', [ ...generatorOptions, - `-DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH}/share/cmake/wasi-sdk-pthread.cmake`, + `-DCMAKE_TOOLCHAIN_FILE=${WASI_THREADS_CMAKE_TOOLCHAIN_FILE}`, `-DWASI_SDK_PREFIX=${WASI_SDK_PATH}`, '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_VERBOSE_MAKEFILE=1',