Skip to content

Commit b8ea117

Browse files
committed
adapt window/macos - main entry point issue / toolchain issue
1 parent f8e06ee commit b8ea117

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,8 @@ jobs:
6565

6666
- name: Build
6767
run: |
68-
export PATH="$(brew --prefix llvm@20)/bin:$PATH"
69-
xmake -y -vv --toolchain=llvm
70-
71-
- name: Test
72-
run: |
73-
export PATH="$(brew --prefix llvm@20)/bin:$PATH"
74-
xmake run cmdline_test
75-
76-
- name: Run examples (smoke)
77-
run: |
78-
export PATH="$(brew --prefix llvm@20)/bin:$PATH"
79-
xmake run with_dispatch -- add python 3.12
80-
xmake run with_dispatch -- remove foo
68+
xmake f --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20
69+
xmake -y -vv
8170
8271
build-windows:
8372
runs-on: windows-latest

tests/cmdline_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import std;
44
import mcpplibs.cmdline;
55

6+
int main(int argc, char** argv) {
7+
::testing::InitGoogleTest(&argc, argv);
8+
return RUN_ALL_TESTS();
9+
}
10+
611
using namespace mcpplibs::cmdline;
712

813
// Build argv from program name + args for parse()

tests/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
add_rules("mode.debug", "mode.release")
22
set_languages("c++23")
33

4-
add_requires("gtest", { configs = { main = true } })
4+
add_requires("gtest")
55

66
target("cmdline_test")
77
set_kind("binary")

xmake.lua

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

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

0 commit comments

Comments
 (0)