Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link yubihsm_pkcs11 against static libyubihsm when ENABLE_STATIC is on #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 15 additions & 6 deletions pkcs11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,21 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(yubihsm_pkcs11 PROPERTIES LINK_FLAGS "-liconv")
endif()

target_link_libraries(
yubihsm_pkcs11
yubihsm
${LIBCRYPTO_LDFLAGS}
${GETOPT_LIBS}
)
if(ENABLE_STATIC)
target_link_libraries(
yubihsm_pkcs11
yubihsm_static
${LIBCRYPTO_LDFLAGS}
${GETOPT_LIBS}
)
else(ENABLE_STATIC)
target_link_libraries(
yubihsm_pkcs11
yubihsm
${LIBCRYPTO_LDFLAGS}
${GETOPT_LIBS}
)
endif(ENABLE_STATIC)

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