From: Peter Wu Date: Fri, 4 May 2018 13:55:26 +0000 (+0200) Subject: [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake X-Git-Tag: archive/raspbian/1%19.1.7-1+rpi1^2~81 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bd5222703aefc10e2249811a1cf4f568ea263beb;p=llvm-toolchain-19.git [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake Ensure that symlinks such as /usr/lib/cmake/clang-X.Y (pointing to /usr/lib/llvm-X.Y/lib/cmake/llvm) are resolved. This ensures that CLANG_INSTALL_PREFIX ends up to be /usr/lib/llvm-X.Y instead of /usr. Partially addresses PR37128 Gbp-Pq: Name 0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch --- diff --git a/cmake/Modules/FindPrefixFromConfig.cmake b/cmake/Modules/FindPrefixFromConfig.cmake index 22211e4b72..c545dbd7ec 100644 --- a/cmake/Modules/FindPrefixFromConfig.cmake +++ b/cmake/Modules/FindPrefixFromConfig.cmake @@ -39,10 +39,10 @@ function(find_prefix_from_config out_var prefix_var path_to_leave) # install prefix, and avoid hard-coding any absolute paths. set(config_code "# Compute the installation prefix from this LLVMConfig.cmake file location." - "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") + "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)") # Construct the proper number of get_filename_component(... PATH) # calls to compute the installation prefix. - string(REGEX REPLACE "/" ";" _count "${path_to_leave}") + string(REGEX REPLACE "/" ";" _count "prefix/${path_to_leave}") foreach(p ${_count}) list(APPEND config_code "get_filename_component(${prefix_var} \"\${${prefix_var}}\" PATH)")