Incorrect libclang dependency in standalone build

Hi!

I got next message for each internal library when building standalone
LLDB on RHEL 6:

CMake Warning (dev) at cmake/modules/AddLLDB.cmake:90 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target "libclang" of target "lldbTarget" does not exist.

It was introduced recently. r272406 is last version I tried to build.

Eugene.

This is a side-effect of the cmake version bump to 3.4. Cmake now
errors out on non-existing targets. You'll need to figure out a way to
avoid adding this target to the dependency list. Patches welcome. :slight_smile:

pl

This is a side-effect of the cmake version bump to 3.4. Cmake now
errors out on non-existing targets. You'll need to figure out a way to
avoid adding this target to the dependency list. Patches welcome. :slight_smile:

Comment in cmake/modules/AddLLDB.cmake tells:

# Hack: only some LLDB libraries depend on the clang autogenerated headers,
# but it is simple enough to make all of LLDB depend on some of those
# headers without negatively impacting much of anything.
add_dependencies(${name} libclang)

May be dependencies should be expressed explicitly? Of course, if
libraries will be valid.

pl

Eugene.

I don't think you need to concern yourself with that comment. We
should make the dependency graph cleaner, but that is not something
related to your current problem.

IIUC, in case of a standalone build, you can assume that the relevant
target was already built, and you don't need to add it to the
dependency list. So, you should just be able to wrap that statement in
an if(). Ideally something like IF(LLDB_STANDALONE_BUILD), but it that
is not possible IF(TARGET libclang) will work as well...

pl