2017-05-23 16:12:45 +08:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
|
2019-01-16 08:24:22 +08:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
|
2017-05-23 16:12:45 +08:00
|
|
|
|
2017-07-11 08:18:07 +08:00
|
|
|
add_clang_tool(clangd
|
2017-05-23 16:12:45 +08:00
|
|
|
ClangdMain.cpp
|
[clangd] Interfaces for writing code tweaks
Summary:
The code tweaks are an implementation of mini-refactorings exposed
via the LSP code actions. They run in two stages:
- Stage 1. Decides whether the action is available to the user and
collects all the information required to finish the action.
Should be cheap, since this will run over all the actions known to
clangd on each textDocument/codeAction request from the client.
- Stage 2. Uses information from stage 1 to produce the actual edits
that the code action should perform. This stage can be expensive and
will only run if the user chooses to perform the specified action in
the UI.
One unfortunate consequence of this change is increased latency of
processing the textDocument/codeAction requests, which now wait for an
AST. However, we cannot avoid this with what we have available in the LSP
today.
Reviewers: kadircet, ioeric, hokein, sammccall
Reviewed By: sammccall
Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D56267
llvm-svn: 352494
2019-01-29 22:17:36 +08:00
|
|
|
$<TARGET_OBJECTS:obj.clangDaemonTweaks>
|
2017-05-23 16:12:45 +08:00
|
|
|
)
|
|
|
|
|
2017-09-25 22:08:35 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
support
|
|
|
|
)
|
|
|
|
|
2019-01-16 08:24:22 +08:00
|
|
|
set(CLANGD_XPC_LIBS "")
|
|
|
|
if(CLANGD_BUILD_XPC)
|
|
|
|
list(APPEND CLANGD_XPC_LIBS "clangdXpcJsonConversions" "clangdXpcTransport")
|
|
|
|
endif()
|
|
|
|
|
2017-05-23 16:12:45 +08:00
|
|
|
target_link_libraries(clangd
|
[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-06 05:49:56 +08:00
|
|
|
PRIVATE
|
2017-05-23 16:12:45 +08:00
|
|
|
clangBasic
|
2019-01-22 20:55:15 +08:00
|
|
|
clangTidy
|
2017-05-23 16:12:45 +08:00
|
|
|
clangDaemon
|
|
|
|
clangFormat
|
|
|
|
clangFrontend
|
|
|
|
clangSema
|
|
|
|
clangTooling
|
|
|
|
clangToolingCore
|
2019-01-16 08:24:22 +08:00
|
|
|
${CLANGD_XPC_LIBS}
|
2017-05-23 16:12:45 +08:00
|
|
|
)
|