@@ -14,6 +14,7 @@ This skill adds a new library from `https://github.com/mcpplibs/<name>` to the m
1414- xmake package docs: https://xmake.io/mirror/manual/package_dependencies.html
1515- mcpplibs org: https://github.com/mcpplibs
1616- index repo: https://github.com/mcpplibs/mcpplibs-index
17+ - xlings CI reference (cross-platform C++23 toolchain): https://github.com/d2learn/xlings/tree/main/.github/workflows
1718
1819## Step 1: Gather Library Info
1920
@@ -110,7 +111,18 @@ Add an `includes()` line to `tests/xmake.lua`:
110111includes (" <first-letter>/<package-name>" )
111112```
112113
113- ## Step 6: Verify Build
114+ ## Step 6: Update CI Matrix
115+
116+ Add the new test to ` .github/workflows/ci.yml ` matrix:
117+
118+ ``` yaml
119+ - name : <package-name>
120+ dir : tests/<first-letter>/<package-name>
121+ target : <package-name>_test
122+ run : true # false if test needs network/API keys
123+ ` ` `
124+
125+ ## Step 7: Verify Build
114126
115127` ` ` bash
116128# Clean any cached package
@@ -129,20 +141,104 @@ xmake run <package-name>_test
129141
130142All three commands must succeed before proceeding.
131143
132- ## Step 7 : Create Branch, Commit & Push
144+ ## Step 8 : Create Branch, Commit & Push
133145
134146``` bash
135147git checkout -b add-< repo-name> -library
136148git add packages/< first-letter> /< package-name> /xmake.lua \
137149 tests/< first-letter> /< package-name> /xmake.lua \
138150 tests/< first-letter> /< package-name> /main.cpp \
139- tests/xmake.lua
151+ tests/xmake.lua \
152+ .github/workflows/ci.yml
140153git commit -m " add <package-name> library"
141154git push -u upstream add-< repo-name> -library
142155```
143156
144157Use ` upstream ` (SSH remote) for push, not ` origin ` (HTTPS, no auth).
145158
159+ ## C++23 Toolchain Reference
160+
161+ All mcpplibs packages require C++23 with modules support. Below are the toolchain configurations for each platform, referenced from [ xlings CI] ( https://github.com/d2learn/xlings/tree/main/.github/workflows ) .
162+
163+ ### Linux — GCC 14 (Ubuntu 24.04)
164+
165+ ``` bash
166+ sudo apt-get install -y gcc-14 g++-14
167+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
168+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
169+ xmake f -y --toolchain=gcc
170+ ```
171+
172+ For static/cross builds (musl-gcc 15.1.0, used by xlings):
173+ ``` bash
174+ xmake f -c -p linux -m release \
175+ --sdk=" $MUSL_SDK " \
176+ --cross=x86_64-linux-musl- \
177+ --cc=x86_64-linux-musl-gcc \
178+ --cxx=x86_64-linux-musl-g++
179+ ```
180+
181+ ### macOS — LLVM 20 (macOS 15)
182+
183+ ``` bash
184+ brew install llvm@20
185+ xmake f -y --toolchain=llvm --sdk=/opt/homebrew/opt/llvm@20
186+ ```
187+
188+ For static linking of libc++ (no runtime dependency on LLVM dylibs):
189+ ``` lua
190+ -- in xmake.lua
191+ local llvm_prefix = os.getenv (" LLVM_PREFIX" ) or " /opt/homebrew/opt/llvm@20"
192+ local libcxx_dir = llvm_prefix .. " /lib/c++"
193+ add_ldflags (" -nostdlib++" , {force = true })
194+ add_ldflags (libcxx_dir .. " /libc++.a" , {force = true })
195+ add_ldflags (libcxx_dir .. " /libc++experimental.a" , {force = true })
196+ add_ldflags (" -lc++abi" , {force = true })
197+ ```
198+
199+ Verify no LLVM dylib dependency: ` otool -L <binary> | grep llvm `
200+
201+ ### Windows — MSVC (windows-latest)
202+
203+ ``` bash
204+ xmake f -y # auto-selects MSVC
205+ ```
206+
207+ No special configuration needed. MSVC from Visual Studio supports C++23.
208+
209+ ### Toolchain Version Summary
210+
211+ | Platform | Compiler | Version | Runner |
212+ | ----------| ----------| ---------| --------|
213+ | Linux | GCC | 14+ | ubuntu-24.04 |
214+ | Linux (static) | musl-gcc | 15.1.0 | ubuntu-24.04 |
215+ | macOS | LLVM/Clang | 20 | macos-15 |
216+ | Windows | MSVC | latest | windows-latest |
217+
218+ ### GitHub Actions Setup Pattern
219+
220+ ``` yaml
221+ # Linux
222+ - os : ubuntu-24.04
223+ setup : |
224+ sudo apt-get update
225+ sudo apt-get install -y gcc-14 g++-14
226+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
227+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
228+ toolchain : gcc
229+
230+ # macOS
231+ - os : macos-15
232+ setup : brew install llvm@20
233+ toolchain : llvm
234+ sdk : /opt/homebrew/opt/llvm@20
235+
236+ # Windows
237+ - os : windows-latest
238+ setup : echo "MSVC auto-detected"
239+ toolchain : msvc
240+ ` ` `
241+
146242## Checklist
147243
148244- [ ] Package directory name == ` package("xxx")` name
@@ -151,6 +247,7 @@ Use `upstream` (SSH remote) for push, not `origin` (HTTPS, no auth).
151247- [ ] Extra headers copied in `on_install` if needed by cppm
152248- [ ] Test does NOT have `add_repositories()` (top-level handles it)
153249- [ ] Test registered in `tests/xmake.lua` via `includes()`
250+ - [ ] CI matrix updated with new test entry
154251- [ ] `xmake build` succeeds
155252- [ ] `xmake run` produces expected output
156253- [ ] Committed and pushed to upstream
0 commit comments