diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b7212fe2..60a477cd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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" diff --git a/oqsprov/CMakeLists.txt b/oqsprov/CMakeLists.txt index 0a8b6b8d..dd116eaf 100644 --- a/oqsprov/CMakeLists.txt +++ b/oqsprov/CMakeLists.txt @@ -79,6 +79,11 @@ 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}) @@ -86,9 +91,11 @@ 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") @@ -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}) diff --git a/scripts/fullbuild.sh b/scripts/fullbuild.sh index 4640b575..6910a89a 100755 --- a/scripts/fullbuild.sh +++ b/scripts/fullbuild.sh @@ -124,6 +124,7 @@ if [ ! -f "_build/lib/oqsprovider.$SHLIBEXT" ]; then #BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" BUILD_TYPE="" # for omitting public key in private keys add -DNOPUBKEY_IN_PRIVKEY=ON + set -x if [ -z "$OPENSSL_INSTALL" ]; then cmake $CMAKE_OPENSSL_LOCATION $BUILD_TYPE $OQSPROV_CMAKE_PARAMS -S . -B _build && cmake --build _build else