[PATCH] D46521: [llvm] cmake: resolve symlinks in LLVMConfig.cmake

Brad King via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 06:59:44 PDT 2018


brad.king added a comment.

For reference, CMake's own `install(EXPORT)` does a similar REALPATH trick here <https://gitlab.kitware.com/cmake/cmake/blob/v3.11.1/Source/cmExportInstallFileGenerator.cxx#L194-206>.  The goal is to overcome cross-prefix symlinks.  CMake doesn't actually use the realpath directly, but the realpath of the original installation prefix and the realpath of the location from which the file is loaded are the same, then it uses the original installation prefix instead of the path used to load the file.  This achieves robustness against cross-prefix symlinks while still allowing the package to be relocatable.


Repository:
  rL LLVM

https://reviews.llvm.org/D46521





More information about the llvm-commits mailing list