Skip to content

[clang-tidy] Remove redundant LINK_LIBS #94588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jun 6, 2024

clangAnalysis is already being pulled in via clang_target_link_libraries(). Also listing it in LINK_LIBS means that we'll link both against the static libraries and the shared libclang-cpp.so library if CLANG_LINK_CLANG_DYLIB is enabled, and waste time on unnecessary LTO.

clangAnalysis is already being pulled in via
clang_target_link_libraries(). Also listing it in LINK_LIBS means
that we'll link both against the static libraries and the shared
libclang-cpp.so library if CLANG_LINK_CLANG_DYLIB is enabled, and
waste time on unnecessary LTO.
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2024

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang-tidy

Author: Nikita Popov (nikic)

Changes

clangAnalysis is already being pulled in via clang_target_link_libraries(). Also listing it in LINK_LIBS means that we'll link both against the static libraries and the shared libclang-cpp.so library if CLANG_LINK_CLANG_DYLIB is enabled, and waste time on unnecessary LTO.


Full diff: https://github.com/llvm/llvm-project/pull/94588.diff

1 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/misc/CMakeLists.txt (-1)
diff --git a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
index 35e29b9a7d136..36fcd8fc1b277 100644
--- a/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/misc/CMakeLists.txt
@@ -43,7 +43,6 @@ add_clang_library(clangTidyMiscModule
   UseAnonymousNamespaceCheck.cpp
 
   LINK_LIBS
-  clangAnalysis
   clangTidy
   clangTidyUtils
 

@nikic nikic merged commit 10dcba7 into llvm:main Jun 6, 2024
10 checks passed
@nikic nikic deleted the clang-tidy-remove-redundant-link-libs branch June 6, 2024 11:55
@JonasToth
Copy link
Member

As you requested my review:

The original linking was done for the ExprMutAnalyzer used in 'misc-const-correctness'. If clang-tidy is builtin without static analyzer Support, you get linker failure.

If the ExprMutAnalyzer is moved (back) to clang-tidy, the issue is not existent. The original move request was from static analysis background where they might wanted to use the class as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants