From 44f531689ec1d6489a6a3e8480b8b407845c9b43 Mon Sep 17 00:00:00 2001 From: Steen Rasmussen Date: Mon, 9 Sep 2024 15:19:56 +0200 Subject: [PATCH] Only overwrite default library prefix for module library type build. Signed-off-by: Frederik Wedel-Heinen --- oqsprov/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/oqsprov/CMakeLists.txt b/oqsprov/CMakeLists.txt index 6b5afe3b..fb00011f 100644 --- a/oqsprov/CMakeLists.txt +++ b/oqsprov/CMakeLists.txt @@ -24,9 +24,9 @@ if(OQS_PROVIDER_BUILD_STATIC) endif() add_library(oqsprovider ${OQS_LIBRARY_TYPE} ${PROVIDER_SOURCE_FILES}) + set_target_properties(oqsprovider PROPERTIES - PREFIX "" OUTPUT_NAME "oqsprovider" PUBLIC_HEADER "oqs_prov.h" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" @@ -42,7 +42,14 @@ set_target_properties(oqsprovider # For Windows DLLs RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -if (NOT OQS_PROVIDER_BUILD_STATIC) +if (OQS_LIBRARY_TYPE STREQUAL "MODULE") + # When openssl looks for provider modules it does not prepend "lib" to the + # provider name. + set_target_properties(oqsprovider + PROPERTIES + PREFIX "" + ) + if (APPLE) # OpenSSL looks for `.dylib` files on XNU-based platforms. # Because `MODULE` writes to a `.so` file by default, we must explicitely @@ -62,11 +69,6 @@ if (NOT OQS_PROVIDER_BUILD_STATIC) SUFFIX ".dll" ) endif() -else() - set_target_properties(oqsprovider - PROPERTIES - PREFIX "lib" - ) endif() target_link_libraries(oqsprovider PUBLIC OQS::oqs ${OPENSSL_CRYPTO_LIBRARY} ${OQS_ADDL_SOCKET_LIBS})