From 8e5e2af33b9a80aaf18eba84cca982f32dd50faa Mon Sep 17 00:00:00 2001 From: Alex Langford Date: Tue, 7 Aug 2018 17:34:13 +0000 Subject: [PATCH] Add instructions for building LLDB on Mac OS X with CMake Summary: There were previously no instructions for building LLDB on Mac OS X with CMake. It's sufficiently close to building on Linux/FreeBSD/NetBSD that a well-motivated developer could figure out the steps themselves. However, having an explicit guide is better and can provide Mac OS X specific configurations (e.g. LLDB_BUILD_FRAMEWORK). Reviewers: labath, clayborg Subscribers: emaste, krytarowski Differential Revision: https://reviews.llvm.org/D50362 llvm-svn: 339155 --- lldb/www/build.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lldb/www/build.html b/lldb/www/build.html index fd35b5116ba6..62a758f7b6a8 100755 --- a/lldb/www/build.html +++ b/lldb/www/build.html @@ -143,7 +143,7 @@

Building LLDB on Mac OS X

-

Building on Mac OS X is as easy as downloading the code and building the Xcode project or workspace:

+

There are two ways to build LLDB on Mac OS X: Using Xcode and using CMake

Preliminaries

@@ -151,13 +151,34 @@
  • XCode 4.3 or newer requires the "Command Line Tools" component (XCode->Preferences->Downloads->Components).
  • Mac OS X Lion or newer requires installing Swig.
  • -

    Building LLDB

    +

    Building LLDB with Xcode

    +

    Building on Mac OS X with Xcode is as easy as downloading the code and building the Xcode project or workspace:

    • Download the lldb sources.
    • Follow the code signing instructions in lldb/docs/code-signing.txt
    • In Xcode 3.x: lldb/lldb.xcodeproj, select the lldb-tool target, and build.
    • In Xcode 4.x: lldb/lldb.xcworkspace, select the lldb-tool scheme, and build.
    +

    Building LLDB with CMake

    +

    First download the LLVM, Clang, and LLDB sources. Refer to this page for precise instructions on this step.

    +

    Refer to the code signing instructions in lldb/docs/code-signing.txt for info on codesigning debugserver during the build.

    +

    Using CMake is documented on the Building LLVM with CMake page. + Ninja is the recommended generator to use when building LLDB with CMake.

    + + > cmake $PATH_TO_LLVM -G Ninja +
    > ninja lldb +
    +

    + As noted in the "Building LLVM with CMake" page mentioned above, you can pass + variables to cmake to change build behavior. If LLDB is built as a part of LLVM, + then you can pass LLVM-specific CMake variables to cmake when building LLDB. +

    +

    Here are some commonly used LLDB-specific CMake variables:

    +
      +
    • LLDB_EXPORT_ALL_SYMBOLS:BOOL : Exports all symbols. Useful in conjunction with CMAKE_BUILD_TYPE=Debug.
    • +
    • LLDB_BUILD_FRAMEWORK:BOOL : Builds LLDB.framework as Xcode would
    • +
    • LLDB_CODESIGN_IDENTITY:STRING : Determines the codesign identity to use. An empty string means skip building debugserver to avoid codesigning.
    • +