Justin Lebar 36b87d8043
Set -rpath-link only if the path is nonempty.
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.
2023-09-21 10:13:51 -07:00
..

See docs/CMake.html for instructions on how to build LLVM with CMake.