blob: 3647e7133e339bc3dde20fa2c260b6e56a710898 (
plain)
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
|
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(-)
Index: llvm-toolchain-snapshot_8~svn342269/cmake/modules/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot_8~svn342269.orig/cmake/modules/CMakeLists.txt
+++ llvm-toolchain-snapshot_8~svn342269/cmake/modules/CMakeLists.txt
@@ -82,10 +82,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)")
|