Skip to content

Commit

Permalink
Link yubihsm_pkcs11 against static libyubihsm when ENABLE_STATIC is s…
Browse files Browse the repository at this point in the history
…pecified (#436)
  • Loading branch information
qpernil authored Dec 3, 2024
1 parent 8b03831 commit 694c419
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ project (yubihsm-shell)

option(BUILD_ONLY_LIB "Library only build" OFF)
option(SUPRESS_MSVC_WARNINGS "Suppresses a lot of the warnings when compiling with MSVC" ON)
option(ENABLE_STATIC "Compiles libyubihsm as a static library (in addtion to the dynamic library)" OFF)

include(${CMAKE_SOURCE_DIR}/cmake/Fuzzing.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/SecurityFlags.cmake)
Expand Down
9 changes: 7 additions & 2 deletions pkcs11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ endif()

target_link_libraries(
yubihsm_pkcs11
yubihsm
${LIBCRYPTO_LDFLAGS}
${GETOPT_LIBS}
)
)

if(ENABLE_STATIC)
target_link_libraries(yubihsm_pkcs11 yubihsm_static)
else()
target_link_libraries(yubihsm_pkcs11 yubihsm)
endif()

if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
Expand Down

0 comments on commit 694c419

Please sign in to comment.