From 4c0b57d1f24b2193770c3be02bf3099dc5b69f8b Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 30 Oct 2024 17:51:30 +0800 Subject: [PATCH] cleanup --- .github/workflows/web-interface-check.yml | 19 +++++++++++-------- .../generate_compile_commands_emscripten.sh | 2 +- native/cocos/editor-support/spine/Json.cpp | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/web-interface-check.yml b/.github/workflows/web-interface-check.yml index 1c375f16152..3f4d39d8db5 100644 --- a/.github/workflows/web-interface-check.yml +++ b/.github/workflows/web-interface-check.yml @@ -80,16 +80,11 @@ jobs: - name: Apply emscripten patches run: | - echo "Save bind.cpp ..." + echo "--------------------------------- Save bind.cpp ---------------------------------" cp $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp.bak - echo "Apply embind bind.cpp patches ..." + echo "--------------------------------- Apply embind bind.cpp patches ---------------------------------" cp -f ./engine-HEAD/.github/workflows/emscripten-patches/embind/bind.cpp $EMSDK/upstream/emscripten/system/lib/embind/ - echo "Apply patches DONE!" - cat $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp - echo "Restore patches ..." - rm $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp - mv $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp.bak $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp - echo "Restore patches DONE!" + echo "--------------------------------- Apply patches DONE! ---------------------------------" cat $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp - name: Install ninja @@ -148,6 +143,14 @@ jobs: npm install node ./.github/workflows/package-size-check.js + - name: Restore patches + run: | + echo "-------------------------- Restore patches ---------------------------------" + rm $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp + mv $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp.bak $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp + echo "-------------------------- Restore patches DONE! ---------------------------------" + cat $EMSDK/upstream/emscripten/system/lib/embind/bind.cpp + - uses: LouisBrunner/diff-action@v2.0.0 with: old: ./engine/bin/.declarations/cc.d.ts diff --git a/native/cocos/editor-support/spine-wasm/scripts/generate_compile_commands_emscripten.sh b/native/cocos/editor-support/spine-wasm/scripts/generate_compile_commands_emscripten.sh index 1d79370dc9a..2934ab7812d 100755 --- a/native/cocos/editor-support/spine-wasm/scripts/generate_compile_commands_emscripten.sh +++ b/native/cocos/editor-support/spine-wasm/scripts/generate_compile_commands_emscripten.sh @@ -14,7 +14,7 @@ mkdir build cd build cp ../CMakeLists.header.txt ./CMakeLists.txt emcmake cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja \ - -DCMAKE_CXX_FLAGS="-I${EMSDK}/upstream/emscripten/system/include -I${EMSDK}/upstream/include/c++/v1" + -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -I${EMSDK}/upstream/emscripten/system/include -I${EMSDK}/upstream/include/c++/v1" cp ./compile_commands.json ../.. cd .. diff --git a/native/cocos/editor-support/spine/Json.cpp b/native/cocos/editor-support/spine/Json.cpp index 59c6b3c8147..752c3888321 100644 --- a/native/cocos/editor-support/spine/Json.cpp +++ b/native/cocos/editor-support/spine/Json.cpp @@ -49,7 +49,7 @@ THE SOFTWARE. #endif #ifdef __EMSCRIPTEN__ -bool parseHex(const char *str, unsigned int *result_) { +static bool parseHex(const char *str, unsigned int *result_) { auto &result = *result_; result = 0; for (int i = 0; i < 4; ++i) {