Skip to content

Commit

Permalink
Use llvm_add_library() to create the CMake target
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettDong committed Feb 12, 2024
1 parent 785fba6 commit 0ac409a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0ac409a

Please sign in to comment.