Package: llvm-toolchain-6.0 / 1:6.0.1-10

0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From d0d969074f6e0f975ad53d21e7ce6c7b40cf2957 Mon Sep 17 00:00:00 2001
From: Peter Wu <peter@lekensteyn.nl>
Date: Fri, 4 May 2018 15:43:06 +0200
Subject: [PATCH] [llvm] cmake: resolve symlinks in LLVMConfig.cmake

Ensure that symlinks such as /usr/lib/llvm-X.Y/cmake (pointing to
lib/cmake/llvm) are resolved. This ensures that LLVM_INSTALL_PREFIX
becomes /usr/lib/llvm-X.Y instead of /usr.

Partially addresses PR37128
---
 cmake/modules/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index 6074e835859..1cf4569b884 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -76,10 +76,10 @@ file(COPY .
 # Generate LLVMConfig.cmake for the install tree.
 set(LLVM_CONFIG_CODE "
 # Compute the installation prefix from this LLVMConfig.cmake file location.
-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
+get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
 # Construct the proper number of get_filename_component(... PATH)
 # calls to compute the installation prefix.
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
+string(REGEX REPLACE "/" ";" _count "prefix/${LLVM_INSTALL_PACKAGE_DIR}")
 foreach(p ${_count})
   set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
 get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-- 
2.17.0