Skip to content

Commit

Permalink
Only overwrite default library prefix for module library type build. (#…
Browse files Browse the repository at this point in the history
…525)

Signed-off-by: Frederik Wedel-Heinen <[email protected]>
Co-authored-by: Steen Rasmussen <[email protected]>
  • Loading branch information
fwh-dc and Steen Rasmussen authored Sep 24, 2024
1 parent 0312c00 commit ea7d18d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions oqsprov/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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})
Expand Down

0 comments on commit ea7d18d

Please sign in to comment.