mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 10:26:46 +00:00

If a add_clang_library call doesn't specify building as static or shared
library they are implicitly added to the list static libraries that is
linked in to clang-cpp shared library here.
315ba77406/clang/cmake/modules/AddClang.cmake (L107)
Because the clang-tools-extra libraries targets were declared after
clang-cpp they by luck never got linked to clang-cpp.
This change is required for clang symbol visibility macros on windows to
work correctly for clang tools since we need to distinguish if a target
being built will be importing or exporting clang symbols from the
clang-cpp DLL.
73 lines
1.9 KiB
CMake
73 lines
1.9 KiB
CMake
set(LLVM_LINK_COMPONENTS
|
|
FrontendOpenMP
|
|
Support
|
|
)
|
|
|
|
setup_host_tool(clang-tidy-confusable-chars-gen CLANG_TIDY_CONFUSABLE_CHARS_GEN clang_tidy_confusable_chars_gen clang_tidy_confusable_chars_gen_target)
|
|
|
|
add_subdirectory(ConfusableTable)
|
|
|
|
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/../../include-cleaner/include")
|
|
|
|
add_custom_command(
|
|
OUTPUT Confusables.inc
|
|
COMMAND ${clang_tidy_confusable_chars_gen} ${CMAKE_CURRENT_SOURCE_DIR}/ConfusableTable/confusables.txt ${CMAKE_CURRENT_BINARY_DIR}/Confusables.inc
|
|
DEPENDS ${clang_tidy_confusable_chars_gen_target} ConfusableTable/confusables.txt)
|
|
|
|
add_custom_target(genconfusable DEPENDS Confusables.inc)
|
|
set_target_properties(genconfusable PROPERTIES FOLDER "Clang Tools Extra/Sourcegenning")
|
|
|
|
add_clang_library(clangTidyMiscModule STATIC
|
|
ConstCorrectnessCheck.cpp
|
|
CoroutineHostileRAIICheck.cpp
|
|
DefinitionsInHeadersCheck.cpp
|
|
ConfusableIdentifierCheck.cpp
|
|
HeaderIncludeCycleCheck.cpp
|
|
IncludeCleanerCheck.cpp
|
|
MiscTidyModule.cpp
|
|
MisleadingBidirectional.cpp
|
|
MisleadingIdentifier.cpp
|
|
MisplacedConstCheck.cpp
|
|
NewDeleteOverloadsCheck.cpp
|
|
NoRecursionCheck.cpp
|
|
NonCopyableObjects.cpp
|
|
NonPrivateMemberVariablesInClassesCheck.cpp
|
|
RedundantExpressionCheck.cpp
|
|
StaticAssertCheck.cpp
|
|
ThrowByValueCatchByReferenceCheck.cpp
|
|
UnconventionalAssignOperatorCheck.cpp
|
|
UniqueptrResetReleaseCheck.cpp
|
|
UnusedAliasDeclsCheck.cpp
|
|
UnusedParametersCheck.cpp
|
|
UnusedUsingDeclsCheck.cpp
|
|
UseAnonymousNamespaceCheck.cpp
|
|
UseInternalLinkageCheck.cpp
|
|
|
|
LINK_LIBS
|
|
clangTidy
|
|
clangTidyUtils
|
|
|
|
DEPENDS
|
|
omp_gen
|
|
genconfusable
|
|
ClangDriverOptions
|
|
)
|
|
|
|
clang_target_link_libraries(clangTidyMiscModule
|
|
PRIVATE
|
|
clangAnalysis
|
|
clangAST
|
|
clangASTMatchers
|
|
clangBasic
|
|
clangFormat
|
|
clangLex
|
|
clangSerialization
|
|
clangTooling
|
|
clangToolingInclusions
|
|
clangToolingInclusionsStdlib
|
|
)
|
|
target_link_libraries(clangTidyMiscModule
|
|
PRIVATE
|
|
clangIncludeCleaner
|
|
)
|