lldb-tools / lldb-mi

LLDB's machine interface driver
https://lldb.llvm.org
Other
165 stars 56 forks source link

[Docs] Building on macOS #100

Open Birch-san opened 2 years ago

Birch-san commented 2 years ago

The "Building against system LLDB" instructions didn't work out-of-the-box on M1 macOS Monterey 12.4 with XCode 13.2.1.

Here's a known-good sequence of instructions. Pretty similar to the existing "Building against custom LLDB" instructions.

git clone --depth 1 https://github.com/llvm/llvm-project.git
cd llvm-project
# I think you can remove CMAKE_INSTALL_PREFIX because we do not attempt installation
cmake \
-DLLDB_USE_SYSTEM_DEBUGSERVER=ON \
-DLLDB_INCLUDE_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS='lldb;clang' \
-DCMAKE_INSTALL_PREFIX=prefix \
-S llvm -B build -G Ninja
cmake --build build --target lldb

cd ..
git clone --depth 1 https://github.com/lldb-tools/lldb-mi.git
cd lldb-mi
cmake -DLLVM_DIR=../llvm-project/build/lib/cmake/llvm .
cmake --build .
# enjoy your new lldb-mi
./src/lldb-mi --help
LimingFang commented 2 years ago

My mac is M1 macOS Monterey 12.4, but I can build against system lldb..🤔

H-G-Hristov commented 2 years ago

Did you manage to build a working version? https://github.com/lldb-tools/lldb-mi/issues/101