mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 17:26:11 +00:00

This cmake rule is used by external clients, who may or may not have the LLVM_LIBRARY_OUTPUT_INTDIR variable set. If it is not set, then we pass `-Wl,-rpath-link,` to the compiler. It turns out that gcc and clang interpret this differently. * gcc passes `-rpath-link ""` to the linker, which is what we want. * clang passes `-rpath-link` to the linker. This is not what we want, because then the linker gobbles the next command-line argument, whatever it happens to be, and uses it as the -rpath-link target. Fix this by passing -rpath-link only if we actually have a path we want.
See docs/CMake.html for instructions on how to build LLVM with CMake.