Skip to content

Instantly share code, notes, and snippets.

@mariusdkm
Created August 9, 2022 11:16
Show Gist options
  • Save mariusdkm/65922612e78819a569f8d5eb2ae337e9 to your computer and use it in GitHub Desktop.
Save mariusdkm/65922612e78819a569f8d5eb2ae337e9 to your computer and use it in GitHub Desktop.

Installing lldb-mi on mac os with mac ports

If you are using brew instead of mac ports your steps may vary!

Setup

You need to have clang and llvm installed on your system.

  • I have clang-14 and llvm-14 installed on my system (through mac ports!).
  • Make sure they are selected as default port select clang and port select llvm
    • If not select them by sudo port select clang mp-clang-14(and the same for llvm

Next set the CC shell variable. export CC=$(which clang)

Build

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.

Install

Just copy the lldb-mi binary into /opt/local/bin

sudo mv src/lldb-mi /opt/local/bin 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment