Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
63 changes: 16 additions & 47 deletions libcxx/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,26 @@ add_subdirectory(tools)
# This ensures that we run the test suite against a setup that matches what we ship
# in production as closely as possible (in terms of file paths, rpaths, etc).
set(LIBCXX_TESTING_INSTALL_PREFIX "${LIBCXX_BINARY_DIR}/test-suite-install")
set(libcxx_test_suite_install_targets cxx-headers cxx cxx-modules)
if (TARGET cxx_experimental)
list(APPEND libcxx_test_suite_install_targets cxx_experimental)
endif()
if (LIBCXX_CXX_ABI STREQUAL "libcxxabi")
add_custom_target(install-cxxabi-test-suite-prefix
DEPENDS cxxabi-headers
cxxabi
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXX_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxxabi-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxxabi
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxx-test-depends install-cxxabi-test-suite-prefix)
list(APPEND libcxx_test_suite_install_targets cxxabi-headers cxxabi)
endif()

if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
add_custom_target(install-unwind-test-suite-prefix
DEPENDS unwind-headers
unwind
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXX_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=unwind-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=unwind
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxx-test-depends install-unwind-test-suite-prefix)
list(APPEND libcxx_test_suite_install_targets unwind-headers unwind)
endif()

add_custom_target(install-cxx-test-suite-prefix
DEPENDS cxx-headers
cxx
cxx_experimental
cxx-modules
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXX_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx-modules
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx
-DCMAKE_INSTALL_PREFIX="${LIBCXX_TESTING_INSTALL_PREFIX}"
-P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxx-test-depends install-cxx-test-suite-prefix)
# Run installation targets serially to avoid race conditions between install targets
set_property(GLOBAL PROPERTY JOB_POOLS libcxx-test-install-pool=1 APPEND)
foreach(target IN LISTS libcxx_test_suite_install_targets)
add_custom_target(libcxx-test-suite-install-${target} DEPENDS "${target}"
COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}"
--prefix "${LIBCXX_TESTING_INSTALL_PREFIX}"
--component "${target}"
JOB_POOL libcxx-test-install-pool)
add_dependencies(cxx-test-depends libcxx-test-suite-install-${target})
endforeach()

set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
Expand Down
65 changes: 18 additions & 47 deletions libcxxabi/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,27 @@ macro(pythonize_bool var)
endif()
endmacro()

# Install the library and its dependencies at a fake location so we can run the test
# suite against it. This ensures that we run the test suite against a setup that matches
# what we ship in production as closely as possible (in terms of file paths, rpaths, etc).
set(LIBCXXABI_TESTING_INSTALL_PREFIX "${LIBCXXABI_BINARY_DIR}/test-suite-install")
add_custom_target(libcxxabi-install-cxx-for-testing
DEPENDS cxx-headers
cxx
cxx_experimental
cxx-modules
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXXABI_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx-modules
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxx
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxxabi-test-depends libcxxabi-install-cxx-for-testing)

add_custom_target(libcxxabi-install-cxxabi-for-testing
DEPENDS cxxabi-headers
cxxabi
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXXABI_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxxabi-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=cxxabi
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxxabi-test-depends libcxxabi-install-cxxabi-for-testing)

set(libcxxabi_test_suite_install_targets cxx-headers cxx cxx-modules cxxabi-headers cxxabi)
if (TARGET cxx_experimental)
list(APPEND libcxxabi_test_suite_install_targets cxx_experimental)
endif()
if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
add_custom_target(libcxxabi-install-unwind-for-testing
DEPENDS unwind-headers
unwind
COMMAND ${CMAKE_COMMAND} -E make_directory "${LIBCXXABI_TESTING_INSTALL_PREFIX}"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=unwind-headers
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=unwind
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_TESTING_INSTALL_PREFIX}"
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
add_dependencies(cxxabi-test-depends libcxxabi-install-unwind-for-testing)
list(APPEND libcxxabi_test_suite_install_targets unwind-headers unwind)
endif()
# Run installation targets serially to avoid race conditions between install targets
set_property(GLOBAL PROPERTY JOB_POOLS libcxxabi-test-install-pool=1 APPEND)
foreach(target IN LISTS libcxxabi_test_suite_install_targets)
add_custom_target(libcxxabi-test-suite-install-${target} DEPENDS "${target}"
COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}"
--prefix "${LIBCXXABI_TESTING_INSTALL_PREFIX}"
--component "${target}"
JOB_POOL libcxxabi-test-install-pool)
add_dependencies(cxxabi-test-depends libcxxabi-test-suite-install-${target})
endforeach()

pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)

Expand Down
Loading