[libc++] Control whether exceptions are enabled in the macOS trunk testing script
authorLouis Dionne <ldionne@apple.com>
Tue, 5 Feb 2019 16:42:37 +0000 (16:42 +0000)
committerLouis Dionne <ldionne@apple.com>
Tue, 5 Feb 2019 16:42:37 +0000 (16:42 +0000)
llvm-svn: 353185

libcxx/utils/ci/macos-trunk.sh

index b365cc6..b646333 100755 (executable)
@@ -8,13 +8,14 @@ $(basename ${0}) [-h|--help] --libcxx-root <LIBCXX-ROOT> --libcxxabi-root <LIBCX
 
 This script is used to continually test libc++ and libc++abi trunk on MacOS.
 
-  --libcxx-root     Full path to the root of the libc++ repository to test.
-  --libcxxabi-root  Full path to the root of the libc++abi repository to test.
-  --std             Version of the C++ Standard to run the tests under (c++03, c++11, etc..).
-  --arch            Architecture to build the tests for (32, 64).
-  [--lit-args]      Additional arguments to pass to lit (optional). If there are multiple arguments, quote them to pass them as a single argument to this script.
-  [--no-cleanup]    Do not cleanup the temporary directory that was used for testing at the end. This can be useful to debug failures. Make sure to clean up manually after.
-  [-h, --help]      Print this help.
+  --libcxx-root       Full path to the root of the libc++ repository to test.
+  --libcxxabi-root    Full path to the root of the libc++abi repository to test.
+  --std               Version of the C++ Standard to run the tests under (c++03, c++11, etc..).
+  --arch              Architecture to build the tests for (32, 64).
+  --libcxx-exceptions Whether to enable exceptions when building libc++ and running the libc++ tests. libc++abi is always built with support for exceptions because other libraries in the runtime depend on it (like libobjc). This must be ON or OFF.
+  [--lit-args]        Additional arguments to pass to lit (optional). If there are multiple arguments, quote them to pass them as a single argument to this script.
+  [--no-cleanup]      Do not cleanup the temporary directory that was used for testing at the end. This can be useful to debug failures. Make sure to clean up manually after.
+  [-h, --help]        Print this help.
 EOM
 }
 
@@ -46,6 +47,10 @@ while [[ $# -gt 0 ]]; do
     ARCH="${2}"
     shift; shift
     ;;
+    --libcxx-exceptions)
+    LIBCXX_EXCEPTIONS="${2}"
+    shift; shift
+    ;;
     --lit-args)
     ADDITIONAL_LIT_ARGS="${2}"
     shift; shift
@@ -70,6 +75,7 @@ if [[ -z ${LIBCXX_ROOT+x} ]]; then echo "--libcxx-root is a required parameter";
 if [[ -z ${LIBCXXABI_ROOT+x} ]]; then echo "--libcxxabi-root is a required parameter"; usage; exit 1; fi
 if [[ -z ${STD+x} ]]; then echo "--std is a required parameter"; usage; exit 1; fi
 if [[ -z ${ARCH+x} ]]; then echo "--arch is a required parameter"; usage; exit 1; fi
+if [[ "${LIBCXX_EXCEPTIONS}" != "ON" && "${LIBCXX_EXCEPTIONS}" != "OFF" ]]; then echo "--libcxx-exceptions is a required parameter and must be either ON or OFF"; usage; exit 1; fi
 if [[ -z ${ADDITIONAL_LIT_ARGS+x} ]]; then ADDITIONAL_LIT_ARGS=""; fi
 
 
@@ -117,6 +123,7 @@ mkdir -p "${LIBCXX_BUILD_DIR}"
   xcrun cmake "${LIBCXX_ROOT}" -GNinja \
     -DLLVM_PATH="${LLVM_ROOT}" \
     -DCMAKE_INSTALL_PREFIX="${LIBCXX_INSTALL_DIR}" \
+    -DLIBCXX_ENABLE_EXCEPTIONS="${LIBCXX_EXCEPTIONS}" \
     -DLLVM_LIT_ARGS="${LIT_FLAGS}" \
     -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" # Build a universal dylib
 )
@@ -130,6 +137,7 @@ mkdir -p "${LIBCXXABI_BUILD_DIR}"
     -DLIBCXXABI_LIBCXX_PATH="${LIBCXX_ROOT}" \
     -DLLVM_PATH="${LLVM_ROOT}" \
     -DCMAKE_INSTALL_PREFIX="${LIBCXXABI_INSTALL_DIR}" \
+    -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
     -DLLVM_LIT_ARGS="${LIT_FLAGS}" \
     -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" # Build a universal dylib
 )