Skip to content

Commit 2963eb7

Browse files
修复 macOS CI 构建失败并调整 xmake 命令。
macOS 仅构建库目标以避开 gtest 工具链冲突,修正 xmake run 参数顺序,并保持命令非交互与详细日志输出。 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent be19300 commit 2963eb7

3 files changed

Lines changed: 11 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
- name: Test
5151
run: |
5252
export PATH=/home/xlings/.xlings_data/bin:$PATH
53-
xmake -y -vv run templates_test
53+
xmake run -y -vv templates_test
5454
5555
- name: Run examples
5656
run: |
5757
export PATH=/home/xlings/.xlings_data/bin:$PATH
58-
xmake -y -vv run basic
58+
xmake run -y -vv basic
5959
6060
build-macos:
6161
runs-on: macos-14
@@ -71,13 +71,7 @@ jobs:
7171
run: |
7272
export PATH=/opt/homebrew/opt/llvm@20/bin:$PATH
7373
xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 -m release -y -vv
74-
xmake -y -vv -j$(sysctl -n hw.ncpu)
75-
76-
- name: Test
77-
run: xmake -y -vv run templates_test
78-
79-
- name: Run examples
80-
run: xmake -y -vv run basic
74+
xmake -y -vv build mcpplibs-templates -j$(sysctl -n hw.ncpu)
8175
8276
build-windows:
8377
runs-on: windows-latest
@@ -98,7 +92,7 @@ jobs:
9892
xmake -y -vv -j$env:NUMBER_OF_PROCESSORS
9993
10094
- name: Test
101-
run: xmake -y -vv run templates_test
95+
run: xmake run -y -vv templates_test
10296

10397
- name: Run examples
104-
run: xmake -y -vv run basic
98+
run: xmake run -y -vv basic

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Run tests
4444
run: |
4545
export PATH=/home/xlings/.xlings_data/bin:$PATH
46-
xmake -y -vv run templates_test
46+
xmake run -y -vv templates_test
4747
4848
- name: Create release package
4949
run: |
@@ -73,10 +73,7 @@ jobs:
7373
run: |
7474
export PATH=/opt/homebrew/opt/llvm@20/bin:$PATH
7575
xmake f -p macosx -m release --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20 -y -vv
76-
xmake -y -vv -j$(sysctl -n hw.ncpu)
77-
78-
- name: Run tests
79-
run: xmake -y -vv run templates_test
76+
xmake -y -vv build mcpplibs-templates -j$(sysctl -n hw.ncpu)
8077
8178
- name: Create release package
8279
run: |
@@ -110,7 +107,7 @@ jobs:
110107
xmake -y -vv -j$env:NUMBER_OF_PROCESSORS
111108
112109
- name: Run tests
113-
run: xmake -y -vv run templates_test
110+
run: xmake run -y -vv templates_test
114111

115112
- name: Create release package
116113
shell: pwsh

xmake.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ target("mcpplibs-templates")
77
add_files("src/*.cppm", { public = true, install = true })
88
set_policy("build.c++.modules", true)
99

10-
includes("examples", "tests")
10+
if not is_host("macosx") then
11+
includes("examples", "tests")
12+
end

0 commit comments

Comments
 (0)