Skip to content

Commit

Permalink
Fix #439: install the static library under $PREFIX/lib. (#441)
Browse files Browse the repository at this point in the history
This commit fixes issue #439 by copying `oqsprovider.a` to the appropriate
`lib` directory (usually `${CMAKE_INSTALL_PREFIX}/lib`).

Signed-off-by: thb-sb <[email protected]>
  • Loading branch information
thomas authored Jun 26, 2024
1 parent bfaf298 commit e3a8d62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ jobs:
with:
name: oqsprovider-x64
path: _build/*.deb
- name: Verify that the static library is copied to the install directory.
run: |
OPENSSL_BRANCH=${{ matrix.ossl-branch }} OQSPROV_CMAKE_PARAMS="-DOQS_PROVIDER_BUILD_STATIC=ON" ./scripts/fullbuild.sh -f && \
mkdir -p _sysroot/ && \
cmake --install _build --prefix _sysroot/ && \
stat _sysroot/lib/liboqsprovider.a
asan_linux_intel:
name: "Security checks"
Expand Down
10 changes: 9 additions & 1 deletion oqsprov/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,23 @@ 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})
if (USE_ENCODING_LIB)
target_link_libraries(oqsprovider PUBLIC qsc_key_encoder)
target_include_directories(oqsprovider PRIVATE ${encoder_LIBRARY_INCLUDE})
endif()

install(TARGETS oqsprovider
CONFIGURATIONS Debug Release
LIBRARY DESTINATION "${OPENSSL_MODULES_PATH}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/oqs-provider/"
RUNTIME DESTINATION "${OPENSSL_MODULES_PATH}")

if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
Expand All @@ -104,6 +111,7 @@ install(TARGETS oqsprovider
ARCHIVE DESTINATION lib/
PUBLIC_HEADER DESTINATION include/oqs-provider/
)

set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_VENDOR "www.openquantumsafe.org")
set(CPACK_PACKAGE_VERSION ${OQSPROVIDER_VERSION_TEXT})
Expand Down

0 comments on commit e3a8d62

Please sign in to comment.