[CMake] Explicitly specify paths to libc++abi in CrossWinToARMLinux.cmake
authorSergej Jaskiewicz <jaskiewiczs@icloud.com>
Fri, 13 Mar 2020 14:55:18 +0000 (17:55 +0300)
committerSergej Jaskiewicz <jaskiewiczs@icloud.com>
Fri, 13 Mar 2020 14:58:02 +0000 (17:58 +0300)
Summary:
D69169, which was necessary for running libc++ tests on remote host, got reverted. I couldn't think of a less invasive way to achieve this behavior but specify libc++abi paths in our cache file.

Reviewers: vvereschaka, aorlov, andreil99, EricWF

Reviewed By: vvereschaka

Subscribers: mgorny, kristof.beyls, ldionne, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D74347

clang/cmake/caches/CrossWinToARMLinux.cmake

index 50957b1..0d359a1 100644 (file)
 #  cmake --build . --target check-clang
 #  cmake --build . --target check-lld
 
+# LLVM_PROJECT_DIR is the path to the llvm-project directory.
+# The right way to compute it would probably be to use "${CMAKE_SOURCE_DIR}/../",
+# but CMAKE_SOURCE_DIR is set to the wrong value on earlier CMake versions
+# that we still need to support (for instance, 3.10.2).
+get_filename_component(LLVM_PROJECT_DIR
+                       "${CMAKE_CURRENT_LIST_DIR}/../../../"
+                       ABSOLUTE)
+
 if (NOT DEFINED DEFAULT_SYSROOT)
   message(WARNING "DEFAULT_SYSROOT must be specified for the cross toolchain build.")
 endif()
@@ -83,6 +91,9 @@ set(LIBCXX_USE_COMPILER_RT                  ON CACHE BOOL "")
 set(LIBCXX_TARGET_TRIPLE                    "${CMAKE_C_COMPILER_TARGET}" CACHE STRING "")
 set(LIBCXX_SYSROOT                          "${DEFAULT_SYSROOT}" CACHE STRING "")
 set(LIBCXX_ENABLE_SHARED                    OFF CACHE BOOL "")
+set(LIBCXX_CXX_ABI                          "libcxxabi" CACHE STRING "")
+set(LIBCXX_CXX_ABI_INCLUDE_PATHS            "${LLVM_PROJECT_DIR}/libcxxabi/include" CACHE PATH "")
+set(LIBCXX_CXX_ABI_LIBRARY_PATH             "${CMAKE_BINARY_DIR}/lib/${LIBCXX_TARGET_TRIPLE}/c++" CACHE PATH "")
 
 set(BUILTINS_CMAKE_ARGS                     "-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_AR=${CMAKE_AR}" CACHE STRING "")
 set(RUNTIMES_CMAKE_ARGS                     "-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_AR=${CMAKE_AR}" CACHE STRING "")