[libc++] Add a CI jobs to test the Standalone builds
authorLouis Dionne <ldionne@apple.com>
Fri, 23 Oct 2020 20:27:41 +0000 (16:27 -0400)
committerLouis Dionne <ldionne@apple.com>
Mon, 26 Oct 2020 16:13:19 +0000 (12:13 -0400)
libcxx/src/CMakeLists.txt
libcxx/utils/ci/buildkite-pipeline.yml
libcxx/utils/ci/run-buildbot.sh

index 575bfc9..95dd520 100644 (file)
@@ -223,7 +223,7 @@ if (LIBCXX_ENABLE_SHARED)
       "-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
       "-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
 
-    target_link_libraries(cxx_shared PRIVATE cxxabi-reexports)
+    target_link_libraries(cxx_shared PRIVATE $<TARGET_NAME_IF_EXISTS:cxxabi-reexports>)
   endif()
 
   # Generate a linker script in place of a libc++.so symlink.
index 4ea32c1..108588f 100644 (file)
@@ -125,6 +125,20 @@ steps:
     agents:
       queue: "libcxx-builders"
 
+  - label: "Legacy standalone build"
+  command: "libcxx/utils/ci/run-buildbot.sh legacy-standalone"
+  artifact_paths:
+    - "**/test-results.xml"
+  agents:
+    queue: "libcxx-builders"
+
+  - label: "Unified standalone build"
+  command: "libcxx/utils/ci/run-buildbot.sh unified-standalone"
+  artifact_paths:
+    - "**/test-results.xml"
+  agents:
+    queue: "libcxx-builders"
+
   # Build with the configuration we use to generate libc++.dylib on Apple platforms
   - label: "Apple system"
     command: "libcxx/utils/ci/run-buildbot.sh x86_64-apple-system"
index 7534cf3..cee4f39 100755 (executable)
@@ -163,6 +163,58 @@ benchmarks)
     generate-cmake
     check-cxx-benchmarks
 ;;
+unified-standalone)
+    export CC=clang
+    export CXX=clang++
+
+    echo "--- Generating CMake"
+    rm -rf "${BUILD_DIR}"
+    cmake -S "${MONOREPO_ROOT}/libcxx/utils/ci/runtimes" \
+          -B "${BUILD_DIR}" \
+          -GNinja \
+          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+          -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind"
+
+    check-cxx-cxxabi
+;;
+legacy-standalone)
+    export CC=clang
+    export CXX=clang++
+
+    echo "--- Generating CMake"
+    rm -rf "${BUILD_DIR}"
+    cmake -S "${MONOREPO_ROOT}/libcxx" \
+          -B "${BUILD_DIR}/libcxx" \
+          -GNinja \
+          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+          -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
+          -DLIBCXX_CXX_ABI=libcxxabi \
+          -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${MONOREPO_ROOT}/libcxxabi/include" \
+          -DLIBCXX_CXX_ABI_LIBRARY_PATH="${BUILD_DIR}/libcxxabi/lib"
+
+    cmake -S "${MONOREPO_ROOT}/libcxxabi" \
+          -B "${BUILD_DIR}/libcxxabi" \
+          -GNinja \
+          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+          -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
+          -DLIBCXXABI_LIBCXX_PATH="${MONOREPO_ROOT}/libcxx" \
+          -DLIBCXXABI_LIBCXX_INCLUDES="${MONOREPO_ROOT}/libcxx/include"
+
+    echo "+++ Building libc++abi"
+    ninja -C "${BUILD_DIR}/libcxxabi" cxxabi
+
+    echo "+++ Building libc++"
+    ninja -C "${BUILD_DIR}/libcxx" cxx
+
+    echo "+++ Running the libc++ tests"
+    ninja -C "${BUILD_DIR}/libcxx" check-cxx
+
+    echo "+++ Running the libc++abi tests"
+    ninja -C "${BUILD_DIR}/libcxxabi" check-cxxabi
+;;
 *)
     echo "${BUILDER} is not a known configuration"
     exit 1