projects/aports·blob master · refs

31 lines · 1.4 KiB

1starting from llvm14 the install prefix breaks via symlinks;
2/usr/lib/llvm14/lib/cmake/llvm/LLVMConfig.cmake goes up 3 directories to find
3/usr/lib/llvm14/include as LLVM_INCLUDE_DIRS, but to even use this cmake folder
4at all it has to be symlinked to /usr/lib/cmake/llvm .. so the directory it
5instead uses is just /usr/include, which is not where the cmake includes are.
6this hardcodes them to the install prefix we pass via cmake, which should
7always be correct, and what cmake tries to autodetect anyway.
8
9also see: https://reviews.llvm.org/D29969
10
11this is supposedly fixed now, but for some reason it still isn't
12--- a/llvm/cmake/modules/CMakeLists.txt
13+++ b/llvm/cmake/modules/CMakeLists.txt
14@@ -42,6 +42,8 @@ endif()
15 #
16
17 set(LLVM_CONFIG_CODE "
18+# this is wrong when automatically detected
19+set(LLVM_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")
20 # LLVM_BUILD_* values available only from LLVM build tree.
21 set(LLVM_BUILD_BINARY_DIR \"${LLVM_BINARY_DIR}\")
22 set(LLVM_BUILD_LIBRARY_DIR \"${LLVM_LIBRARY_DIR}\")
23@@ -115,8 +117,6 @@ file(COPY .
24 # Generate LLVMConfig.cmake for the install tree.
25 #
26
27-find_prefix_from_config(LLVM_CONFIG_CODE LLVM_INSTALL_PREFIX "${LLVM_INSTALL_PACKAGE_DIR}")
28-
29 extend_path(LLVM_CONFIG_MAIN_INCLUDE_DIR "\${LLVM_INSTALL_PREFIX}" "${CMAKE_INSTALL_INCLUDEDIR}")
30 # This is the same as the above because the handwritten and generated headers
31 # are combined in one directory at install time.