[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-project/creduce] be741f: On CMake-based build path, set LLVM_LIBS by runnin...



  Branch: refs/heads/master
  Home:   https://github.com/csmith-project/creduce
  Commit: be741fca94f9c33c2dffb8a3846b74d8f3848c4f
      https://github.com/csmith-project/creduce/commit/be741fca94f9c33c2dffb8a3846b74d8f3848c4f
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2019-04-25 (Thu, 25 Apr 2019)

  Changed paths:
    M clang_delta/CMakeLists.txt

  Log Message:
  -----------
  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.