[LLVMbugs] [Bug 20489] New: Clang should export static library dependencies (like LLVM_LINK_COMPONENTS)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 29 23:19:41 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20489

            Bug ID: 20489
           Summary: Clang should export static library dependencies (like
                    LLVM_LINK_COMPONENTS)
           Product: Build scripts
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: rzg at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

CMake will automatically include transitive dependencies of the libraries added
to a target with target_link_libraries. So, if a target uses
target_link_libraries(... clangAST), CMake knows that this also means to link
against clangAST's dependencies (clangBasic and clangLex), and so on.

However, this appears to only work within a project. If one is building a tool
that wants to link against libclang*, but is not part of clang's CMake project,
the dependency information must be hardcoded, which is fragile.

LLVM solved this by explicitly exposing a library's dependencies using
LLVM_LINK_COMPONENTS but this doesn't seem to be the case for Clang, whose
targets use target_link_libraries directly.

This would make it substantially easier for projects to link against the
libclang* static libraries that get installed (and therefore are presumably
intended to be linked against!) without having to manually unravel and hardcode
the transitive dependencies.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140730/0ead8841/attachment.html>


More information about the llvm-bugs mailing list