From bc5719ac11ceb78ecc57b8c5489af14523d55f27 Mon Sep 17 00:00:00 2001 From: TaurusXin Date: Fri, 20 Sep 2024 23:55:46 +0800 Subject: [PATCH] feat: docs for cross build on macOS --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1c5c357..8d1e1f6 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,10 @@ cmake -G "Visual Studio 17 2022" -A x64 -B build # Linux / macOS cmake -DCMAKE_BUILD_TYPE=Release -B build + +# 如果需要在 macOS 下交叉编译,可以指定 `CMAKE_OSX_ARCHITECTURES` 变量来指明目标系统架构 +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -B build # arm64 +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -B build # Intel-based ``` 编译项目