@@ -315,47 +315,23 @@ jobs:
315315 LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang++" | head -1 | xargs dirname | xargs dirname)
316316 echo "LLVM_ROOT=$LLVM_ROOT" >> "$GITHUB_ENV"
317317
318- - name : Install xmake
318+ - name : Bootstrap mcpp from v0.0.16 release
319319 run : |
320- brew install xmake
321- xmake --version
322-
323- - name : Build mcpp with xmake + LLVM
320+ # Download the v0.0.16 macOS binary to bootstrap this build
321+ WORK=$(mktemp -d)
322+ curl -fsSL -o "$WORK/mcpp.tar.gz" \
323+ "https://github.com/mcpp-community/mcpp/releases/download/v0.0.16/mcpp-0.0.16-macosx-arm64.tar.gz"
324+ tar -xzf "$WORK/mcpp.tar.gz" -C "$WORK"
325+ BOOTSTRAP="$WORK/mcpp-0.0.16-macosx-arm64/bin/mcpp"
326+ test -x "$BOOTSTRAP"
327+ "$BOOTSTRAP" --version
328+ export PATH="$(dirname "$BOOTSTRAP"):$PATH"
329+ echo "PATH=$(dirname "$BOOTSTRAP"):$PATH" >> "$GITHUB_ENV"
330+
331+ - name : Build mcpp (self-host via v0.0.16)
324332 run : |
325- # Generate xmake.lua if not present
326- if [ ! -f xmake.lua ]; then
327- cat > xmake.lua << 'EOF'
328- add_rules("mode.release")
329- set_languages("c++23")
330-
331- package("cmdline")
332- set_homepage("https://github.com/mcpplibs/cmdline")
333- set_description("Modern C++ command-line parsing library")
334- set_license("Apache-2.0")
335- add_urls("https://github.com/mcpplibs/cmdline/archive/refs/tags/$(version).tar.gz")
336- add_versions("0.0.1", "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0")
337- on_install(function (package)
338- import("package.tools.xmake").install(package)
339- end)
340- package_end()
341-
342- add_requires("cmdline 0.0.1")
343-
344- target("mcpp")
345- set_kind("binary")
346- add_files("src/main.cpp")
347- add_files("src/**.cppm")
348- add_packages("cmdline")
349- add_includedirs("src/libs/json")
350- set_policy("build.c++.modules", true)
351- EOF
352- fi
353-
354- xmake f -y -m release --toolchain=llvm --sdk="$LLVM_ROOT"
355- xmake build -y mcpp
356-
357- # Locate and verify built binary
358- MCPP_BIN=$(find build -name mcpp -type f -perm +111 | head -1)
333+ mcpp build
334+ MCPP_BIN=$(find target -path "*/bin/mcpp" | head -1)
359335 test -x "$MCPP_BIN"
360336 file "$MCPP_BIN"
361337 "$MCPP_BIN" --version
0 commit comments