- 安装vmware:https://www.bilibili.com/video/BV1Wo4y1E7fc/
- 安装最新版的macos:极限苹果-Mac论坛-提供Mac软件和macOS苹果系统镜像下载
- 下载并安装brew:版本要低,我装的是4.3.5(Release 4.3.5 · Homebrew/brew · GitHub),不然怎么装都失败.
- 安装cmake:brew install cmake
- 安装llvm:brew install llvm
或者参照后续手动下载源码并构建llvm:
- 下载llvm-project:Download LLVM releases
- 解压
- 进入llvm-project-18.1.8.src
- 新建文件夹mybuilder
- 进入mybuilder
- 执行指令:(来源:Clang - Getting Started和Getting Started with the LLVM System — LLVM 20.0.0git documentation和Building - 🐛 LLDB)
cmake -DLLVM_ENABLE_PROJECTS=‘clang;clang-tools-extra;lldb;lld’ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -G "Unix Makefiles" ../llvm
- 执行指令:(要等很久好几个小时)
make
- 开始编译你的项目:
step1: mkdir buildstep2: cd buildstep3: cmake ../project_namestep4: make 或者 cmake --build .