mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 09:46:14 +00:00
build: add kernel-specific warnings
In some cases, we'll want to be more aggressive or care about different things when building the kernel. In this case, a warning is added for symbols which may be duplicated between the kernel and downstream users. This warning was introduced in clang 21, which is not yet the minimum supported compiler version. REDUCE_EXPORTS needs to be ON to trigger it.
This commit is contained in:
parent
64294c8909
commit
24c3b47010
@ -83,9 +83,25 @@ add_library(bitcoinkernel
|
||||
$<TARGET_OBJECTS:leveldb>
|
||||
$<TARGET_OBJECTS:crc32c>
|
||||
)
|
||||
|
||||
# Compiler warnings that apply only to the kernel and its dependencies.
|
||||
# These can be more strict and/or warnings that only apply to shared
|
||||
# libs.
|
||||
add_library(kernel_warn_interface INTERFACE)
|
||||
if(NOT MSVC)
|
||||
try_append_cxx_flags("-Wunique-object-duplication" TARGET kernel_warn_interface SKIP_LINK)
|
||||
endif()
|
||||
|
||||
# Also manually apply the warnings to the kernel's internal dependencies
|
||||
target_link_libraries(bitcoin_clientversion PRIVATE kernel_warn_interface)
|
||||
target_link_libraries(bitcoin_crypto PRIVATE kernel_warn_interface)
|
||||
target_link_libraries(leveldb PRIVATE kernel_warn_interface)
|
||||
target_link_libraries(crc32c PRIVATE kernel_warn_interface)
|
||||
|
||||
target_link_libraries(bitcoinkernel
|
||||
PRIVATE
|
||||
core_interface
|
||||
kernel_warn_interface
|
||||
secp256k1_objs
|
||||
$<$<PLATFORM_ID:Windows>:bcrypt>
|
||||
$<TARGET_NAME_IF_EXISTS:USDT::headers>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user