mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-26 05:31:36 +00:00
feat(tidy): add fairmq-clangd for editor integration
- Add the option BUILD_TIDY_CLANGD (default OFF). It builds fairmq-clangd from clangdMain plus the fairmq-* module. - clangd cannot load plugins, but creates its clang-tidy checks from the same registry. Thus the checks run on the AST that clangd builds anyway, and editors show their fixes as quick fixes. - Point clangd to the resource directory of the LLVM installation it was built with, unless --resource-dir is given. - Test each check over LSP with test/tidy/ClangdCheck.py: open the input, expect a diagnostic of the check and a quick fix for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -80,3 +80,23 @@ install(TARGETS ${target}
|
||||
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
# fairmq-clangd: the clangd language server plus the fairmq-* checks.
|
||||
option(BUILD_TIDY_CLANGD "Build fairmq-clangd, the clangd language server with the fairmq-* checks." OFF)
|
||||
if(BUILD_TIDY_CLANGD)
|
||||
if(NOT TARGET clangdMain)
|
||||
message(FATAL_ERROR "BUILD_TIDY_CLANGD=ON needs the clangd libraries "
|
||||
"(clangdMain, clangDaemon) of the found Clang ${LLVM_PACKAGE_VERSION} "
|
||||
"installation at ${Clang_DIR}.")
|
||||
endif()
|
||||
set(target fairmq-clangd)
|
||||
add_executable(${target} runClangd.cxx)
|
||||
add_executable("${PROJECT_NAME}::${target}" ALIAS ${target})
|
||||
target_compile_definitions(${target} PRIVATE
|
||||
FAIRMQ_TIDY_CLANG_RESOURCE_DIR="${FAIRMQ_TIDY_CLANG_RESOURCE_DIR}"
|
||||
)
|
||||
target_link_libraries(${target} PRIVATE fairmq-tidy-module clangdMain)
|
||||
install(TARGETS ${target}
|
||||
EXPORT ${PROJECT_EXPORT_SET}
|
||||
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user