Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On CMake-based build path, set LLVM_LIBS by running `llvm-config'.
Previously, we determined the value of LLVM_LIBS by invoking `llvm_map_components_to_libnames()`, a CMake function provided by LLVM's CMake stuff. Apparently this does not work so well with some vendors' distributions of LLVM. See pull request #189. With this commit, we now set LLVM_LIBS by invoking the `llvm-config` tool. Aside, this is how the Automake-based build path has worked for a long time. The content of this commit is based upon the patch authored by Pranav Kant (GitHub user @pranavk) in #189. I expanded his code somewhat, aiming to make it more portable and robust. Unlike the patch suggested in #189, this commit does *not* add LLVM_LIBS to the call to `target_link_libraries()`. That change is not necessary on any platforms that I have access to, and it is not clear to me that the underlying problem has been dealt with. (The problem related to linking against some prepackaged versions of LLVM.) See the message for commit b5da960. This patch "works for me" on several platforms, but it should be tested more widely. I don't think that I have access to any of the platforms where the vendor makes a problematic distribution.
- Loading branch information