Commit Graph

15 Commits

Author SHA1 Message Date
Michal Gorny 0820041e1d [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible
Use clang_target_link_libraries() in order to support linking against
libclang-cpp instead of static libraries.

Differential Revision: https://reviews.llvm.org/D68448

llvm-svn: 373786
2019-10-04 20:30:02 +00:00
Fangrui Song 41c249adc4 Add explicit dependency on clangSerialization after rC348911
llvm-svn: 348916
2018-12-12 08:25:16 +00:00
Shoaib Meenai d806af3499 [CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.

Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.

Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).

Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.

Differential Revision: https://reviews.llvm.org/D40823

llvm-svn: 319840
2017-12-05 21:49:56 +00:00
Petr Hosek fe0e145aed [CMake] Use tools template for clangd and modularize
This makes them usable as distribution components in the build.

Differential Revision: https://reviews.llvm.org/D35017

llvm-svn: 307601
2017-07-11 00:18:07 +00:00
Saleem Abdulrasool 9dc1b0f29d modularize: add install rule
This allows modularize to be installed.  Previously, no install rule would be
created for it.

llvm-svn: 253310
2015-11-17 05:09:18 +00:00
John Thompson 8eb8d93672 Added module map coverage support, extracted from module-map-checker.
llvm-svn: 229869
2015-02-19 16:47:27 +00:00
John Thompson d845baecb4 Moved header list loading to new class. This is staging for adding module map loading and checking support.
llvm-svn: 229108
2015-02-13 14:29:22 +00:00
NAKAMURA Takumi 23b702c8de [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
NAKAMURA Takumi 78f534d689 [CMake] clang-tools-extra: Update dependencies.
llvm-svn: 196860
2013-12-10 01:41:10 +00:00
NAKAMURA Takumi ff9225f3d7 [CMake] clang-tools-extra may not depend on LLVM CodeGen.
llvm-svn: 196805
2013-12-09 19:27:57 +00:00
John Thompson 5ab4f11152 Added module map generation option.
llvm-svn: 192703
2013-10-15 13:52:33 +00:00
John Thompson 94faa4d0d4 Fixed case change that caused the test failure. Incorporarated Sean's review changes, consisting only of renaming and comment changes.
llvm-svn: 187277
2013-07-26 23:56:42 +00:00
Rafael Espindola 17b15cfbe3 Revert "Added new feature for checking macro and preprocessor conditional consistency."
This reverts commit r187228. It broke some bots:
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32

llvm-svn: 187235
2013-07-26 19:23:33 +00:00
John Thompson 1e0101461e Added new feature for checking macro and preprocessor conditional consistency.
llvm-svn: 187228
2013-07-26 18:16:22 +00:00
John Thompson 4f8ba659d9 Initial check in of Doug's modularize tool for checking header readiness for modules, plus some changes per review feedback: Removed system headers, changed to use stream output, added file name in message.
llvm-svn: 176847
2013-03-12 02:07:30 +00:00