Skip to content

build-script: Implement support for --(no-)lldb-assertions #15290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ class BuildScriptInvocation(object):
args.swift_analyze_code_coverage).lower(),
"--llbuild-enable-assertions", str(
args.llbuild_assertions).lower(),
"--lldb-assertions", str(
args.lldb_assertions).lower(),
"--cmake-generator", args.cmake_generator,
"--build-jobs", str(args.build_jobs),
"--common-cmake-options=%s" % ' '.join(
Expand Down
7 changes: 7 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ KNOWN_SETTINGS=(
lldb-test-swift-only "1" "when running lldb tests, only include Swift-specific tests"
lldb-no-debugserver "" "delete debugserver after building it, and don't try to codesign it"
lldb-use-system-debugserver "" "don't try to codesign debugserver, and use the system's debugserver instead"
lldb-assertions "1" "build lldb with assertions enabled"
llvm-build-type "Debug" "the CMake build variant for LLVM and Clang (Debug, RelWithDebInfo, Release, MinSizeRel). Defaults to Debug."
swift-build-type "Debug" "the CMake build variant for Swift"
swift-enable-assertions "1" "enable assertions in Swift"
Expand Down Expand Up @@ -1781,6 +1782,12 @@ function set_lldb_xcodebuild_options() {
-enableUndefinedBehaviorSanitizer=YES
)
fi
if [[ "$(true_false ${LLDB_ASSERTIONS})" == "FALSE" ]]; then
lldb_xcodebuild_options=(
"${lldb_xcodebuild_options[@]}"
OTHER_CFLAGS="-DNDEBUG"
)
fi
}

#
Expand Down
3 changes: 3 additions & 0 deletions utils/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def _apply_default_arguments(args):
if args.llbuild_assertions is None:
args.llbuild_assertions = args.assertions

if args.lldb_assertions is None:
args.lldb_assertions = args.assertions

# Set the default CMake generator.
if args.cmake_generator is None:
args.cmake_generator = 'Ninja'
Expand Down
2 changes: 1 addition & 1 deletion utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
'libicu_build_variant': 'Debug',
'lit_args': '-sv',
'llbuild_assertions': True,
'lldb_assertions': None,
'lldb_assertions': True,
'lldb_build_variant': 'Debug',
'lldb_build_with_xcode': '1',
'llvm_assertions': True,
Expand Down