cmake: De-duplicate libraries on link lines opportunistically

This change resolves "ignoring duplicate libraries" linker warnings on
macOS.
This commit is contained in:
Hennadii Stepanov 2024-12-15 15:54:35 +00:00
parent b042c4f053
commit 710a0bb52f
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,12 @@ generate_header_from_json(data/tx_invalid.json)
generate_header_from_json(data/tx_valid.json)
generate_header_from_raw(data/asmap.raw test::data)
if(POLICY CMP0156)
# De-duplicate libraries on link lines based on linker capabilities.
# See: https://cmake.org/cmake/help/latest/policy/CMP0156.html
cmake_policy(SET CMP0156 NEW)
endif()
# Do not use generator expressions in test sources because the
# SOURCES property is processed to gather test suite macros.
add_executable(test_bitcoin

View file

@ -4,6 +4,12 @@
add_subdirectory(util)
if(POLICY CMP0156)
# De-duplicate libraries on link lines based on linker capabilities.
# See: https://cmake.org/cmake/help/latest/policy/CMP0156.html
cmake_policy(SET CMP0156 NEW)
endif()
add_executable(fuzz
addition_overflow.cpp
addrman.cpp