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

* LLDB assertions are on by default, like swift assertions

* LLDB assertions can be enabled/disabled globally with the --assertions
  and --no-assertions options

Partially addresses: rdar://38524846
This commit is contained in:
Vedant Kumar
2018-03-15 19:05:58 -07:00
parent 6df106e168
commit 9db99a0a24
4 changed files with 13 additions and 1 deletions

View File

@@ -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"
@@ -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
}
#