mirror of
https://github.com/xhacker-zzz/QmcWasm.git
synced 2024-12-05 00:42:17 +00:00
Compare commits
2 Commits
de40f3385a
...
a0cc200317
Author | SHA1 | Date | |
---|---|---|---|
|
a0cc200317 | ||
|
d7e718890f |
@ -26,7 +26,10 @@ const decrypted= (await DecryptQmcWasm(cipherText, extension)).data;
|
|||||||
|
|
||||||
### 自行构建
|
### 自行构建
|
||||||
|
|
||||||
在 Linux 环境下执行 `./build-wasm` 即可构建。构建结果将位于此项目根目录的npm子目录中。
|
#### Linux
|
||||||
|
在此项目根目录中执行 `./build-wasm` 即可构建。构建结果将位于此项目根目录的npm子目录中。
|
||||||
|
#### Windows
|
||||||
|
在此项目根目录中执行 `build-wasm.cmd` 即可构建。构建结果将位于此项目根目录的npm子目录中。
|
||||||
|
|
||||||
[音乐解锁Web]: https://git.unlock-music.dev/um/web
|
[音乐解锁Web]: https://git.unlock-music.dev/um/web
|
||||||
[音乐解锁]: https://unlock-music.dev/
|
[音乐解锁]: https://unlock-music.dev/
|
||||||
|
40
build-wasm.cmd
Normal file
40
build-wasm.cmd
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal
|
||||||
|
|
||||||
|
set "CURR_DIR=%CD%"
|
||||||
|
|
||||||
|
set "BUILD_TYPE=%1"
|
||||||
|
if "%BUILD_TYPE%"=="" set "BUILD_TYPE=Release"
|
||||||
|
|
||||||
|
md build\wasm 2>nul
|
||||||
|
if not exist build\emsdk (
|
||||||
|
git clone https://github.com/emscripten-core/emsdk.git build\emsdk
|
||||||
|
)
|
||||||
|
|
||||||
|
pushd build\emsdk
|
||||||
|
rem git pull
|
||||||
|
call emsdk.bat install 3.0.0
|
||||||
|
call emsdk.bat activate 3.0.0
|
||||||
|
call emsdk_env.bat
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd build\wasm
|
||||||
|
|
||||||
|
call emcmake cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ..\..
|
||||||
|
rem Check if Ninja binary exists
|
||||||
|
if not exist "ninja.exe" (
|
||||||
|
rem Install Ninja
|
||||||
|
curl -L https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -o ninja.zip
|
||||||
|
unzip ninja.zip
|
||||||
|
del ninja.zip
|
||||||
|
)
|
||||||
|
ninja.exe -f build.ninja -j 3
|
||||||
|
|
||||||
|
set "TARGET_FILES=QmcLegacy.js QmcWasm.js QmcWasm.wasm QmcWasmBundle.js %CURR_DIR%\LICENSE.txt"
|
||||||
|
|
||||||
|
for %%f in (%TARGET_FILES%) do (
|
||||||
|
copy "%%f" "%CURR_DIR%\npm"
|
||||||
|
)
|
||||||
|
popd
|
||||||
|
|
||||||
|
endlocal
|
Loading…
Reference in New Issue
Block a user