[clang-tools-extra] [clangd] Add dynamic plugins support (PR #226995)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 8 04:39:14 PDT 2026
================
@@ -30,6 +30,36 @@ foreach(dep FileCheck count not llvm-config)
endif()
endforeach()
+if (NOT WIN32 OR NOT LLVM_LINK_LLVM_DYLIB)
+ llvm_add_library(
+ ClangdFeatureModuleExample
+ MODULE FeatureModuleExample.cpp
+ PLUGIN_TOOL clangd
+ PARTIAL_SOURCES_INTENDED)
+ llvm_add_library(
+ ClangdStandaloneTweakExample
+ MODULE StandaloneTweakExample.cpp
+ PLUGIN_TOOL clangd
+ PARTIAL_SOURCES_INTENDED)
+endif()
+
+foreach(target ClangdFeatureModuleExample ClangdStandaloneTweakExample)
+ if(TARGET ${target})
+ list(APPEND CLANGD_TEST_DEPS ${target})
+ target_include_directories(${target} PUBLIC BEFORE
+ "${CLANG_TOOLS_SOURCE_DIR}/clangd"
+ "${CMAKE_CURRENT_BINARY_DIR}/.."
+ )
+ if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
+ set(LLVM_LINK_COMPONENTS
+ Support
+ )
+ endif()
+ endif()
+endforeach()
+
+llvm_canonicalize_cmake_booleans(CLANG_PLUGIN_SUPPORT)
----------------
timon-ul wrote:
I am totally fine with keeping it as `CLANG_PLUGIN_SUPPORT`. I wanted to merely bring it up for consideration, but this is not something I consider very important, let's keep it this way then.
https://github.com/llvm/llvm-project/pull/226995
More information about the cfe-commits
mailing list