diff --git a/.circleci/config.yml b/.circleci/config.yml index 89408c4c..30c04684 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,6 +74,7 @@ jobs: name: Run tests command: | if << parameters.OQS_PROVIDER_BUILD_STATIC >> ; then + test -f _build/lib/oqsprovider.a ctest --test-dir _build/ else ./scripts/runtests.sh -V @@ -98,6 +99,7 @@ jobs: name: Run tests (-DNOPUBKEY_IN_PRIVKEY=ON) command: | if << parameters.OQS_PROVIDER_BUILD_STATIC >> ; then + test -f _build/lib/oqsprovider.a ctest --test-dir _build/ else ./scripts/runtests.sh -V @@ -170,11 +172,16 @@ jobs: - run: name: Build OQS-OpenSSL provider command: | - export OPENSSL_INSTALL=`brew config | grep HOMEBREW_PREFIX | sed -e "s/HOMEBREW_PREFIX: //g"`/opt/openssl@3 && mkdir _build && cd _build && liboqs_DIR=`pwd`/../.local cmake -GNinja -DOPENSSL_ROOT_DIR=$OPENSSL_INSTALL .. && ninja && echo "export OPENSSL_INSTALL=$OPENSSL_INSTALL" >> "$BASH_ENV" && cd .. && echo "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$OPENSSL_INSTALL/lib" >> "$BASH_ENV" + oqsprovider_cmake_args="<< parameters.CMAKE_ARGS >>" + if << parameters.OQS_PROVIDER_BUILD_STATIC >> ; then + oqsprovider_cmake_args="${oqsprovider_cmake_args} -DOQS_PROVIDER_BUILD_STATIC=ON" + fi + export OPENSSL_INSTALL=`brew config | grep HOMEBREW_PREFIX | sed -e "s/HOMEBREW_PREFIX: //g"`/opt/openssl@3 && mkdir _build && cd _build && liboqs_DIR=`pwd`/../.local cmake -GNinja -DOPENSSL_ROOT_DIR=$OPENSSL_INSTALL ${oqsprovider_cmake_args} .. && ninja && echo "export OPENSSL_INSTALL=$OPENSSL_INSTALL" >> "$BASH_ENV" && cd .. && echo "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$OPENSSL_INSTALL/lib" >> "$BASH_ENV" - run: name: Run tests command: | if << parameters.OQS_PROVIDER_BUILD_STATIC >> ; then + test -f _build/lib/oqsprovider.a ctest --test-dir _build/ --output-on-failure else ./scripts/runtests.sh -V @@ -191,6 +198,7 @@ jobs: name: Run tests command: | if << parameters.OQS_PROVIDER_BUILD_STATIC >> ; then + test -f _build/lib/oqsprovider.a ctest --test-dir _build/ --output-on-failure else ./scripts/runtests.sh -V diff --git a/oqsprov/CMakeLists.txt b/oqsprov/CMakeLists.txt index 9bc7870f..93ba12f3 100644 --- a/oqsprov/CMakeLists.txt +++ b/oqsprov/CMakeLists.txt @@ -58,24 +58,26 @@ set_target_properties(oqsprovider # For Windows DLLs RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -if (APPLE) - # OpenSSL looks for `.dylib` files on XNU-based platforms. - # Because `MODULE` writes to a `.so` file by default, we must explicitely - # set the suffix here. - set_target_properties(oqsprovider - PROPERTIES - SUFFIX ".dylib" - ) -endif() +if (NOT OQS_PROVIDER_BUILD_STATIC) + if (APPLE) + # OpenSSL looks for `.dylib` files on XNU-based platforms. + # Because `MODULE` writes to a `.so` file by default, we must explicitely + # set the suffix here. + set_target_properties(oqsprovider + PROPERTIES + SUFFIX ".dylib" + ) + endif() -if (CYGWIN OR MSVC) - # OpenSSL looks for `.dll` files on Windows platforms. - # Because `MODULE` writes to a `.so` file by default, we must explicitely - # set the suffix here. - set_target_properties(oqsprovider - PROPERTIES - SUFFIX ".dll" - ) + if (CYGWIN OR MSVC) + # OpenSSL looks for `.dll` files on Windows platforms. + # Because `MODULE` writes to a `.so` file by default, we must explicitely + # set the suffix here. + set_target_properties(oqsprovider + PROPERTIES + SUFFIX ".dll" + ) + endif() endif() target_link_libraries(oqsprovider PUBLIC OQS::oqs ${OPENSSL_CRYPTO_LIBRARY} ${OQS_ADDL_SOCKET_LIBS})