1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-17 14:05:25 +03:00
aports/testing/llvm12/fix-LLVMConfig-cmake-install-prefix.patch
psykose c723beeca9 testing/llvm12: move from community
nothing using it in community
2022-10-30 02:24:39 +02:00

24 lines
1 KiB
Diff

Fix LLVMConfig.cmake being generated to use correct LLVM_INSTALL_PREFIX
(e.g. /usr/lib/llvm5).
This is needed e.g. for building lldb.
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -99,15 +99,7 @@
# 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)")
-# Construct the proper number of get_filename_component(... PATH)
-# calls to compute the installation prefix.
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
-foreach(p ${_count})
- set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
-get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-endforeach(p)
+set(LLVM_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
set(LLVM_CONFIG_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")
set(LLVM_CONFIG_MAIN_INCLUDE_DIR "${LLVM_CONFIG_INCLUDE_DIRS}")