pirama added a comment.

In D78033#1978612 <https://reviews.llvm.org/D78033#1978612>, @beanz wrote:

> I think this has some unintended consequences. If your tool wants to use 
> libLLVM and libClang you really need libClang to be linked against libLLVM, 
> otherwise you're actually just hiding the problem.


I wanted to avoid this since `libLLVM` is an optional target but `libclang-cpp` 
is built by default.  Maybe I didn't think through all options in this regard.

1. We could build `libLLVM` by default, but don't install it unless requested.
2. Or link `libclang-cpp` against `libLLVM` iff the latter is built.

Either option would require a CMake change that I am not sure how to make.  We 
would need to remove LLVM static libraries from `libclang-cpp`'s link command 
but I cannot figure out how to accomplish this.  They are getting included 
transitively via CMake's dependency graph.

Another option is to make libclang-cpp a superset of Clang and LLVM libraries.  
This would however require using `--whole-archive` similar to `libLLVM.so`.

Do you have any preferred solution and pointers on how to filter out some 
dependencies in CMake?  One hacky way could be to add a special-case in 
`AddLLVM.cmake` and dedup right before `target_link_libraries()`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78033/new/

https://reviews.llvm.org/D78033



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D78033: [cma... Pirama Arumuga Nainar via Phabricator via cfe-commits
    • [PATCH] D78033:... Chris Bieneman via Phabricator via cfe-commits
    • [PATCH] D78033:... Pirama Arumuga Nainar via Phabricator via cfe-commits

Reply via email to