Steven Wu b8c560f159
[CMake] Remove EXPORT_SYMBOLS_FOR_PLUGINS from #102138 (#102396)
Partially remove some of the changes from #102138 as
EXPORT_SYMBOLS_FOR_PLUGINS doesn't work on all the configurations.
2024-08-08 06:00:11 -07:00

71 lines
1.3 KiB
CMake

set(LLVM_LINK_COMPONENTS
AllTargetsAsmParsers
AllTargetsDescs
AllTargetsInfos
FrontendOpenMP
support
)
# Needed by LLVM's CMake checks because this file defines multiple targets.
set(LLVM_OPTIONAL_SOURCES ClangTidyMain.cpp ClangTidyToolMain.cpp)
add_clang_library(clangTidyMain
ClangTidyMain.cpp
LINK_LIBS
clangTidy
${ALL_CLANG_TIDY_CHECKS}
DEPENDS
omp_gen
ClangDriverOptions
)
clang_target_link_libraries(clangTidyMain
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangTooling
clangToolingCore
)
# Support plugins.
if(CLANG_PLUGIN_SUPPORT)
set(support_plugins SUPPORT_PLUGINS)
endif()
add_clang_tool(clang-tidy
ClangTidyToolMain.cpp
DEPENDS
clang-resource-headers
${support_plugins}
)
clang_target_link_libraries(clang-tidy
PRIVATE
clangAST
clangASTMatchers
clangBasic
clangTooling
clangToolingCore
)
target_link_libraries(clang-tidy
PRIVATE
clangTidy
clangTidyMain
${ALL_CLANG_TIDY_CHECKS}
)
if(CLANG_PLUGIN_SUPPORT)
export_executable_symbols_for_plugins(clang-tidy)
endif()
install(PROGRAMS clang-tidy-diff.py
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-tidy)
install(PROGRAMS run-clang-tidy.py
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT clang-tidy
RENAME run-clang-tidy)