Skip to content

Commit da248b0

Browse files
committed
ci: 使用 Ninja Generator 进行编译
1 parent cc506cb commit da248b0

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.github/workflows/qt-build-release-linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
host: 'linux'
2929
target: 'desktop'
3030
arch: 'linux_gcc_64'
31+
tools: 'tools_ninja'
3132
cache: true
3233

3334
- name: Set up Node.js
@@ -38,7 +39,7 @@ jobs:
3839
- name: Configure CMake
3940
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
4041
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
41-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/package
42+
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/package
4243

4344
- name: Build
4445
# Build your program with the given configuration

.github/workflows/qt-build-release-win.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
target: 'desktop'
3030
arch: 'win64_msvc2022_64'
3131
modules: 'qtactiveqt'
32+
tools: 'tools_ninja'
3233
cache: true
3334

3435
- name: Set up Node.js
@@ -45,10 +46,13 @@ jobs:
4546
$destinationPath = "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl"
4647
Start-Process powershell -ArgumentList "Copy-Item -Path '$sourcePath' -Destination '$destinationPath' -Force" -Verb runAs
4748
49+
- uses: ilammy/msvc-dev-cmd@v1
50+
if: ${{ matrix.os == 'windows-latest' }}
51+
4852
- name: Configure CMake
4953
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
5054
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
51-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
55+
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
5256

5357
- name: Build
5458
# Build your program with the given configuration

.github/workflows/qt-build-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ jobs:
4949
target: 'desktop'
5050
arch: ${{ matrix.arch }}
5151
modules: ${{ matrix.os == 'windows-latest' && 'qtactiveqt' || '' }}
52+
tools: 'tools_ninja'
5253
cache: true
5354

5455
- name: Set up Node.js
5556
uses: actions/setup-node@v4
5657
with:
5758
node-version: '20'
5859

60+
- uses: ilammy/msvc-dev-cmd@v1
61+
if: ${{ matrix.os == 'windows-latest' }}
62+
5963
- name: Configure CMake
6064
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
6165
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
62-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
66+
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWINGHEX_USE_FRAMELESS=ON -DWINGHEX_BUILD_TEST_PLUGIN=OFF -DWINGHEX_BUILD_SHARED_MEM_EXT=OFF -DWINGHEX_ANGEL_LSP=ON
6367

6468
- name: Build
6569
# Build your program with the given configuration

CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -790,15 +790,8 @@ if(WINGHEX_ANGEL_LSP)
790790
"[3] packaging with pkg/npm exec/npx"
791791
COMMAND ${PKG_CMD}
792792
COMMAND ${CMAKE_COMMAND} -E echo "[4] Packaging with pkg"
793-
COMMAND ${CMAKE_COMMAND} -E copy "${NODE_ROOT_SUBDIR}/package.json"
794-
"${BUILD_BIN_DIR}"
795-
COMMAND ${CMAKE_COMMAND} -E copy "${NODE_SUBDIR}/modIcon_win.js"
796-
"${BUILD_BIN_DIR}"
797-
COMMAND ${CMAKE_COMMAND} -E copy "${NODE_SUBDIR}/icon.ico"
798-
"${BUILD_BIN_DIR}"
799-
COMMAND ${NODE_EXE} "${BUILD_BIN_DIR}/modIcon_win.js"
800-
COMMAND ${CMAKE_COMMAND} -E remove "${BUILD_BIN_DIR}/modIcon_win.js"
801-
"${BUILD_BIN_DIR}/icon.ico" "${BUILD_BIN_DIR}/package.json"
793+
COMMAND ${NODE_EXE} "${NODE_SUBDIR}/modIcon_win.js"
794+
"--basedir=${BUILD_BIN_DIR}"
802795
COMMAND ${CMAKE_COMMAND} -E echo "[5] Modifying exe icon"
803796
VERBATIM)
804797
else()

0 commit comments

Comments
 (0)