build: allow static or shared but not both

This commit is contained in:
Cory Fields
2023-03-14 21:15:35 +00:00
parent 36b0adf1b9
commit ef49a11d29
3 changed files with 55 additions and 73 deletions

View File

@@ -6,15 +6,11 @@ target_compile_options(example INTERFACE
$<$<C_COMPILER_ID:MSVC>:/wd4005>
)
target_link_libraries(example INTERFACE
secp256k1
$<$<PLATFORM_ID:Windows>:bcrypt>
)
if(SECP256K1_BUILD_SHARED)
target_link_libraries(example INTERFACE secp256k1)
elseif(SECP256K1_BUILD_STATIC)
target_link_libraries(example INTERFACE secp256k1_static)
if(MSVC)
target_link_options(example INTERFACE /IGNORE:4217)
endif()
if(NOT BUILD_SHARED_LIBS AND MSVC)
target_link_options(example INTERFACE /IGNORE:4217)
endif()
add_executable(ecdsa_example ecdsa.c)