Merge bitcoin-core/secp256k1#1367: build: Improvements to symbol visibility logic on Windows (attempt 3)
c6cd2b15a0ci: Add task for static library on Windows + CMake (Hennadii Stepanov)020bf69a44build: Add extensive docs on visibility issues (Tim Ruffing)0196e8ade1build: Introduce `SECP256k1_DLL_EXPORT` macro (Hennadii Stepanov)9f1b1904a3refactor: Replace `SECP256K1_API_VAR` with `SECP256K1_API` (Hennadii Stepanov)ae9db95ceabuild: Introduce `SECP256K1_STATIC` macro for Windows users (Hennadii Stepanov) Pull request description: Previous attempts: - https://github.com/bitcoin-core/secp256k1/pull/1346 - https://github.com/bitcoin-core/secp256k1/pull/1362 The result is as follows: 1. Simple, concise and extensively documented code. 2. Explicitly documented use cases with no ambiguities. 3. No workarounds for linker warnings. 4. Solves one item in https://github.com/bitcoin-core/secp256k1/issues/1235. ACKs for top commit: real-or-random: utACKc6cd2b15a0Tree-SHA512: d58694452d630aefbd047916033249891bc726b7475433aaaa7c3ea2a07ded8f185a598385b67c2ee3440ec5904ff9d9452c97b0961d84dcb2eb2cf46caa171e
This commit is contained in:
@@ -20,10 +20,10 @@ if(SECP256K1_ASM STREQUAL "arm32")
|
||||
target_link_libraries(secp256k1_asm INTERFACE secp256k1_asm_arm)
|
||||
endif()
|
||||
|
||||
# Define our export symbol only for Win32 and only for shared libs.
|
||||
# This matches libtool's usage of DLL_EXPORT
|
||||
if(WIN32)
|
||||
set_target_properties(secp256k1 PROPERTIES DEFINE_SYMBOL "DLL_EXPORT")
|
||||
# Define our export symbol only for shared libs.
|
||||
set_target_properties(secp256k1 PROPERTIES DEFINE_SYMBOL SECP256K1_DLL_EXPORT)
|
||||
target_compile_definitions(secp256k1 INTERFACE $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:SECP256K1_STATIC>)
|
||||
endif()
|
||||
|
||||
# Object libs don't know if they're being built for a shared or static lib.
|
||||
|
||||
Reference in New Issue
Block a user