<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Clang should export static library dependencies (like LLVM_LINK_COMPONENTS)"
href="http://llvm.org/bugs/show_bug.cgi?id=20489">20489</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang should export static library dependencies (like LLVM_LINK_COMPONENTS)
</td>
</tr>
<tr>
<th>Product</th>
<td>Build scripts
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>cmake
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rzg@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>