From 43252c1b17b9a199c6a1673996cf61e1cfff90c8 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 30 Jan 2020 13:05:14 +0300 Subject: [PATCH] [libcxxabi] Set LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX to ON if LIBCXX_ENABLE_SHARED is not defined Differential Revision: https://reviews.llvm.org/D71894 --- libcxxabi/CMakeLists.txt | 28 ---------------------------- libcxxabi/test/CMakeLists.txt | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 7b854a7..9b96224 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -92,14 +92,6 @@ usual symlinks pointing to that.") option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON) option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON) -option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI - "Whether the libc++abi tests should link with the shared libc++abi library" - ${LIBCXXABI_ENABLE_SHARED}) - -option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX - "Whether the libc++abi tests should link with the shared libc++ library" - ${LIBCXX_ENABLE_SHARED}) - cmake_dependent_option(LIBCXXABI_INSTALL_STATIC_LIBRARY "Install the static libc++abi library." ON "LIBCXXABI_ENABLE_STATIC;LIBCXXABI_INSTALL_LIBRARY" OFF) @@ -123,26 +115,6 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC) message(FATAL_ERROR "libc++abi must be built as either a shared or static library.") endif() -if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_SHARED) - message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being ON requires LIBCXXABI_ENABLE_SHARED to be ON") -endif() - -if(NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_STATIC) - message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being OFF requires LIBCXXABI_ENABLE_STATIC to be ON") -endif() - -if(DEFINED LIBCXX_ENABLE_SHARED - AND LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX - AND NOT LIBCXX_ENABLE_SHARED) - message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being ON requires LIBCXX_ENABLE_SHARED to be ON") -endif() - -if(DEFINED LIBCXX_ENABLE_STATIC - AND NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX - AND NOT LIBCXX_ENABLE_STATIC) - message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being OFF requires LIBCXX_ENABLE_STATIC to be ON") -endif() - if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR) set(LIBCXXABI_LIBCXX_SRC_DIRS ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}) else() diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index 23c0dac..b47eef7 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -11,6 +11,32 @@ if (NOT DEFINED LIBCXX_ENABLE_SHARED) set(LIBCXX_ENABLE_SHARED ON) endif() +option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI + "Whether the libc++abi tests should link with the shared libc++abi library" + ${LIBCXXABI_ENABLE_SHARED}) + +option(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX + "Whether the libc++abi tests should link with the shared libc++ library" + ${LIBCXX_ENABLE_SHARED}) + +if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_SHARED) + message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being ON requires LIBCXXABI_ENABLE_SHARED to be ON") +endif() + +if(NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI AND NOT LIBCXXABI_ENABLE_STATIC) + message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI being OFF requires LIBCXXABI_ENABLE_STATIC to be ON") +endif() + +if(LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX AND NOT LIBCXX_ENABLE_SHARED) + message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being ON requires LIBCXX_ENABLE_SHARED to be ON") +endif() + +if(DEFINED LIBCXX_ENABLE_STATIC + AND NOT LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX + AND NOT LIBCXX_ENABLE_STATIC) + message(FATAL_ERROR "LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX being OFF requires LIBCXX_ENABLE_STATIC to be ON") +endif() + pythonize_bool(LIBCXXABI_BUILD_32_BITS) pythonize_bool(LIBCXX_ENABLE_SHARED) pythonize_bool(LIBCXXABI_ENABLE_SHARED) -- 2.7.4