Skip to content

[CMake] Enable CMP0156 if available #115046

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
Nov 6, 2024
Merged

Conversation

etcwilde
Copy link
Contributor

@etcwilde etcwilde commented Nov 5, 2024

Some linkers do not require that libraries are repeated on the command line. The Apple linker emits warnings when duplicate libraries are specified, resulting in a wall of warnings.

CMP0156 deduplicates libraries on the command line when the linker doesn't require them.

This patch enables CMP0156 to quiet the warnings when using a version of CMake that recognizes it (CMake 3.29 and newer).

Some linkers do not require that libraries are repeated on the command
line. The Apple linker emits warnings when duplicate libraries are
specified, resulting in a wall of warnings.

CMP0156 deduplicates libraries on the command line when the linker
doesn't require them.

This patch enables CMP0156 to quiet the warnings when using a version of
CMake that recognizes it (CMake 3.29 and newer).
@etcwilde etcwilde requested a review from compnerd November 5, 2024 18:43
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Nov 5, 2024
@etcwilde etcwilde requested a review from jroelofs November 5, 2024 18:43
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smaller command lines are also easier to diagnose, and so this should help more generically on non-ELF targets really.

@etcwilde etcwilde merged commit cb90d5b into llvm:main Nov 6, 2024
68 checks passed
@etcwilde etcwilde deleted the ewilde/enable-cmp0156 branch November 6, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants