If you are using brew
instead of mac ports
your steps may vary!
You need to have clang
and llvm
installed on your system.
- I have
clang-14
andllvm-14
installed on my system (through mac ports!). - Make sure they are selected as default
port select clang
andport select llvm
- If not select them by
sudo port select clang mp-clang-14
(and the same for llvm
- If not select them by
Next set the CC
shell variable.
export CC=$(which clang)
To build lldb-mi
just execute the following:
git clone https://github.com/lldb-tools/lldb-mi
mkdir -p lldb-mi/build
cd lldb-mi/build
cmake .. -D CMAKE_PREFIX_PATH=/opt/local/libexec
cmake --build .
Using -D CMAKE_PREFIX_PATH=/opt/local/libexec
is very important because otherwise the following error will occur:
CMake Error at CMakeLists.txt:15 (find_package):
Could not find a package configuration file provided by "LLVM" with any of
the following names:
LLVMConfig.cmake
llvm-config.cmake
Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
"LLVM_DIR" to a directory containing one of the above files. If "LLVM"
provides a separate development package or SDK, be sure it has been
installed.
Just copy the lldb-mi
binary into /opt/local/bin
sudo mv src/lldb-mi /opt/local/bin