From 524ad8f8fca9bbeb19b4789bfc22fa2eceee9bff Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Mon, 12 Feb 2024 12:33:22 +0800 Subject: [PATCH] Use llvm_add_library() to create the CMake target --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3f001b..a438fed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,4 @@ jobs: ninja -C build --verbose - name: Load Plugin run: | - clang-tidy-16 --load=build/libClangTidyPlugin.so --checks="-*,my-check" --list-checks + clang-tidy-16 --load=build/ClangTidyPlugin.so --checks="-*,my-check" --list-checks diff --git a/CMakeLists.txt b/CMakeLists.txt index ba6256b..90e22a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.20) project(ClangTidyPlugin C CXX) find_package(LLVM REQUIRED) find_package(Clang REQUIRED) -add_library(ClangTidyPlugin MODULE MyClangTidyPluginModule.cpp MyCheck.cpp) +include(AddLLVM) +llvm_add_library(ClangTidyPlugin MODULE MyClangTidyPluginModule.cpp MyCheck.cpp) target_compile_features(ClangTidyPlugin PRIVATE cxx_std_17) target_include_directories(ClangTidyPlugin PRIVATE ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}) target_link_libraries(ClangTidyPlugin PRIVATE clangTidy)