diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -460,6 +460,19 @@ limit: 2 timeout_in_minutes: 120 + - label: "New standalone runtimes build" + command: "libcxx/utils/ci/run-buildbot new-standalone" + artifact_paths: + - "**/test-results.xml" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + - label: "Runtimes build" command: "libcxx/utils/ci/run-buildbot runtimes-build" artifact_paths: diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -430,6 +430,22 @@ check-cxx-cxxabi ;; +new-standalone) + + clean + + echo "--- Generating CMake" + ${CMAKE} \ + -S "${MONOREPO_ROOT}/runtimes" \ + -B "${BUILD_DIR}" \ + -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ + -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in" + + check-cxx-cxxabi +;; runtimes-build) clean diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -13,6 +13,7 @@ if(LLVM_ENABLE_RUNTIMES STREQUAL "all" ) set(LLVM_ENABLE_RUNTIMES ${LLVM_ALL_RUNTIMES}) endif() +set(COMMON_CMAKE_ARGS "-DHAVE_LLVM_LIT=ON") foreach(proj ${LLVM_ENABLE_RUNTIMES}) set(proj_dir "${CMAKE_CURRENT_SOURCE_DIR}/../../${proj}") if(IS_DIRECTORY ${proj_dir} AND EXISTS ${proj_dir}/CMakeLists.txt) @@ -87,6 +88,7 @@ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON + ${COMMON_CMAKE_ARGS} ${BUILTINS_CMAKE_ARGS} PASSTHROUGH_PREFIXES COMPILER_RT USE_TOOLCHAIN @@ -119,6 +121,7 @@ -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON + ${COMMON_CMAKE_ARGS} ${${target}_extra_args} USE_TOOLCHAIN TARGET_TRIPLE ${target} @@ -236,6 +239,7 @@ -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON + ${COMMON_CMAKE_ARGS} ${RUNTIMES_CMAKE_ARGS} PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES ${ARG_PREFIXES} @@ -338,6 +342,7 @@ -DCMAKE_ASM_COMPILER_WORKS=ON -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON -DLLVM_RUNTIMES_TARGET=${name} + ${COMMON_CMAKE_ARGS} ${${name}_extra_args} EXTRA_TARGETS ${${name}_extra_targets} ${${name}_test_targets} diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -116,6 +116,8 @@ get_host_triple(LLVM_DEFAULT_TARGET_TRIPLE) endif() +option(LLVM_INCLUDE_TESTS "Generate build targets for the runtimes unit tests." ON) + # Use libtool instead of ar if you are both on an Apple host, and targeting Apple. if(CMAKE_HOST_APPLE AND APPLE) include(UseLibtool) @@ -184,6 +186,14 @@ ARGS ${RUNTIMES_LIT_EXTRA_ARGS} ) add_custom_target(runtimes-test-depends DEPENDS ${RUNTIMES_LIT_DEPENDS}) + + if (NOT HAVE_LLVM_LIT) + # If built by manually invoking cmake on this directory, we don't have + # llvm-lit. If invoked via llvm/runtimes, the toplevel llvm cmake + # invocation already generated the llvm-lit script. + add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit + ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit) + endif() endif() get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS)