Author: Pranav Kant Date: 2026-10-08T12:50:40-07:00 New Revision: d16bbeffbb155b6023db63448edcfa4c610caea2
URL: https://github.com/llvm/llvm-project/commit/d16bbeffbb155b6023db63448edcfa4c610caea2 DIFF: https://github.com/llvm/llvm-project/commit/d16bbeffbb155b6023db63448edcfa4c610caea2.diff LOG: [clangd][test] Move plugin examples and CMake rules to plugins directory (#230260) Move FeatureModuleExample.cpp and StandaloneTweakExample.cpp into the clangd/test/plugins directory. Added: clang-tools-extra/clangd/test/plugins/CMakeLists.txt clang-tools-extra/clangd/test/plugins/FeatureModuleExample.cpp clang-tools-extra/clangd/test/plugins/StandaloneTweakExample.cpp Modified: clang-tools-extra/clangd/test/CMakeLists.txt Removed: clang-tools-extra/clangd/test/FeatureModuleExample.cpp clang-tools-extra/clangd/test/StandaloneTweakExample.cpp ################################################################################ diff --git a/clang-tools-extra/clangd/test/CMakeLists.txt b/clang-tools-extra/clangd/test/CMakeLists.txt index 401d3a8b156db..5972d0933f610 100644 --- a/clang-tools-extra/clangd/test/CMakeLists.txt +++ b/clang-tools-extra/clangd/test/CMakeLists.txt @@ -30,33 +30,7 @@ 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() +add_subdirectory(plugins) llvm_canonicalize_cmake_booleans(CLANG_PLUGIN_SUPPORT) diff --git a/clang-tools-extra/clangd/test/plugins/CMakeLists.txt b/clang-tools-extra/clangd/test/plugins/CMakeLists.txt new file mode 100644 index 0000000000000..5097e50dbffc5 --- /dev/null +++ b/clang-tools-extra/clangd/test/plugins/CMakeLists.txt @@ -0,0 +1,29 @@ +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() + +set(CLANGD_TEST_DEPS ${CLANGD_TEST_DEPS} PARENT_SCOPE) diff --git a/clang-tools-extra/clangd/test/FeatureModuleExample.cpp b/clang-tools-extra/clangd/test/plugins/FeatureModuleExample.cpp similarity index 100% rename from clang-tools-extra/clangd/test/FeatureModuleExample.cpp rename to clang-tools-extra/clangd/test/plugins/FeatureModuleExample.cpp diff --git a/clang-tools-extra/clangd/test/StandaloneTweakExample.cpp b/clang-tools-extra/clangd/test/plugins/StandaloneTweakExample.cpp similarity index 100% rename from clang-tools-extra/clangd/test/StandaloneTweakExample.cpp rename to clang-tools-extra/clangd/test/plugins/StandaloneTweakExample.cpp _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
