COMP: Suppress macOS linker warnings for duplicate -lm from ITK dependencies - #1376
Merged
Merged
Conversation
hjmjohnson
marked this pull request as ready for review
March 26, 2026 13:34
…dencies On macOS, Apple's linker warns about duplicate -lm entries that arise from ITK's transitive dependency chains. The duplicates are harmless (the linker deduplicates them) but produce ~70 warnings per build. Suppress them at the linker level in both the ITK ExternalProject and CTK's own targets since the fix belongs upstream in ITK's exported targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jamesobutler
force-pushed
the
pr/itk-linker-warnings
branch
from
March 28, 2026 14:13
138477b to
36069a5
Compare
jamesobutler
approved these changes
Mar 28, 2026
jamesobutler
enabled auto-merge (rebase)
March 28, 2026 14:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #1372, part of a systematic clazy static analysis effort to improve CTK for Slicer compatibility and Qt6 migration.
What this changes
Adds CMake logic to detect and deduplicate
-lmlinker flags injected by ITK on macOS, eliminating spuriousld: warning: duplicate -lmmessages during CTK builds that link ITK.Why
Pre-existing macOS-specific linker noise from ITK dependency flags. These warnings appear on every build and obscure real issues in build output.
Testing
🤖 Identified via clazy static analysis using CTK-claude-skills