build-script: Build lldb with CMake on Darwin

build-script can already build lldb on Darwin using its Xcode project,
but it's useful to support the CMake build as well.

The CMake build allows incremental rebuilds with build-script. I expect
this to significantly cut down on iteration time.

Taking advantage of CMake also lets lldb piggyback on existing support
for sanitizers -- or exciting new build configurations we don't know
about yet -- without having to update the Xcode project file.

rdar://problem/36751944
This commit is contained in:
Vedant Kumar
2018-01-22 16:31:21 -08:00
parent cc783dc45a
commit 330e47d869
4 changed files with 50 additions and 12 deletions

View File

@@ -53,7 +53,8 @@ def _apply_default_arguments(args):
# Build LLDB if any LLDB-related options were specified.
if args.lldb_build_variant is not None or \
args.lldb_assertions is not None:
args.lldb_assertions is not None or \
args.lldb_build_with_xcode is not None:
args.build_lldb = True
# Set the default build variant.
@@ -75,6 +76,9 @@ def _apply_default_arguments(args):
if args.lldb_build_variant is None:
args.lldb_build_variant = args.build_variant
if args.lldb_build_with_xcode is None:
args.lldb_build_with_xcode = '1'
if args.foundation_build_variant is None:
args.foundation_build_variant = args.build_variant
@@ -568,6 +572,14 @@ def create_argument_parser():
const='Debug',
help='build the Debug variant of LLDB')
option('--lldb-build-with-xcode', store('lldb_build_with_xcode'),
const='1',
help='build LLDB using xcodebuild, if possible')
option('--lldb-build-with-cmake', store('lldb_build_with_xcode'),
const='0',
help='build LLDB using CMake')
option('--debug-cmark', store('cmark_build_variant'),
const='Debug',
help='build the Debug variant of CommonMark')