Skip to content

🍒[CMake] Enable CMP0156 if available #9515

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmake/Modules/CMakePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ endif()
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()

# CMP0156: De-duplicate libraries on link lines based on linker capabilities.
# New in CMake 3.29: https://cmake.org/cmake/help/latest/policy/CMP0156.html
# Avoids the deluge of 'ld: warning: ignoring duplicate libraries' warnings when
# building with the Apple linker.
if(POLICY CMP0156)
cmake_policy(SET CMP0156 NEW)
endif()