Skip to content

Commit c3b65bc

Browse files
committed
fix libc++ abi issue
1 parent 7f98a94 commit c3b65bc

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: ./build/linux/x86_64/release/d2x --version
5151

5252
build-macos:
53-
runs-on: [macos-latest]
53+
runs-on: macos-15
5454
steps:
5555
- name: Checkout code
5656
uses: actions/checkout@v4
@@ -78,9 +78,7 @@ jobs:
7878
7979
- name: Build with xmake
8080
run: |
81-
export LLVM_PREFIX=$HOME/.xlings/data/xpkgs/xim-x-llvm/20.1.7
82-
ls -al $LLVM_PREFIX
83-
xmake f -m release --toolchain=llvm --sdk=$LLVM_PREFIX -vv -y
81+
xmake f -m release --toolchain=llvm -vv -y
8482
xmake -j$(nproc)
8583
8684
- name: Verify d2x --version

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
path: d2x-${{ inputs.version }}-linux-x86_64.tar.gz
6060

6161
build-macos:
62-
runs-on: [macos-latest]
62+
runs-on: macos-15
6363
steps:
6464
- name: Checkout code
6565
uses: actions/checkout@v4

xmake.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ target("d2x")
2020
-- platform specific settings
2121
if is_plat("macosx") then
2222
set_toolchains("llvm")
23-
local llvm_prefix = os.getenv("LLVM_PREFIX")
24-
if llvm_prefix then -- if LLVM_PREFIX is set, we assume it's a recent version of LLVM that provides its own libc++ with C++23 support
25-
-- 静态链接 LLVM 自带的 libc++,避免依赖系统 libc++.dylib 中缺失的 C++23 符号
26-
-- (std::println 等 C++23 特性需要 macOS 15+ 的 libc++,静态链接后可在 macOS 11+ 运行)
27-
add_ldflags("-nostdlib++", {force = true})
28-
add_ldflags(llvm_prefix .. "/lib/libc++.a", {force = true})
29-
add_ldflags(llvm_prefix .. "/lib/libc++abi.a", {force = true})
30-
end
3123
elseif is_plat("linux") then
3224
add_ldflags("-static", {force = true})
3325
end

0 commit comments

Comments
 (0)