Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for the CMAKE_PARAMS environment variable #510

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ activate further warning messages. In particular, when "Debug" has been set, dis
[debugging capabilities](https://github.com/open-quantum-safe/oqs-provider/wiki/Debugging)
are activated and additional setup warnings are output.

### CMAKE_PARAMS

This environment variable lets you specify additional flags to pass to `cmake` explicitly when using the `fullbuild.sh` script.

For example, in order to point `cmake` to a specific library, you might run:

```
$ env CMAKE_PARAMS="-DOPENSSL_CRYPTO_LIBRARY=/opt/lib64/libcrypto.so" bash scripts/fullbuild.sh
```

### liboqs_DIR

This environment variable must be set to the location of the `liboqs` installation to be
Expand Down
7 changes: 4 additions & 3 deletions scripts/fullbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# The following variables influence the operation of this build script:
# Argument -f: Soft clean, ensuring re-build of oqs-provider binary
# Argument -F: Hard clean, ensuring checkout and build of all dependencies
# EnvVar CMAKE_PARAMS: passed to cmake
# EnvVar MAKE_PARAMS: passed to invocations of make; sample value: "-j"
# EnvVar OQSPROV_CMAKE_PARAMS: passed to invocations of oqsprovider cmake
# EnvVar LIBOQS_BRANCH: Defines branch/release of liboqs; default value "main"
Expand Down Expand Up @@ -108,7 +109,7 @@ if [ -z $liboqs_DIR ]; then
# STD: only include NIST standardized algorithms
# NIST_R4: only include algorithms in round 4 of the NIST competition
# All: include all algorithms supported by liboqs (default)
cd liboqs && cmake -GNinja $DOQS_ALGS_ENABLED $CMAKE_OPENSSL_LOCATION -DCMAKE_INSTALL_PREFIX=$(pwd)/../.local -S . -B _build && cd _build && ninja && ninja install && cd ../..
cd liboqs && cmake -GNinja $CMAKE_PARAMS $DOQS_ALGS_ENABLED $CMAKE_OPENSSL_LOCATION -DCMAKE_INSTALL_PREFIX=$(pwd)/../.local -S . -B _build && cd _build && ninja && ninja install && cd ../..
if [ $? -ne 0 ]; then
echo "liboqs build failed. Exiting."
exit -1
Expand All @@ -125,9 +126,9 @@ if [ ! -f "_build/lib/oqsprovider.$SHLIBEXT" ]; then
BUILD_TYPE=""
# for omitting public key in private keys add -DNOPUBKEY_IN_PRIVKEY=ON
if [ -z "$OPENSSL_INSTALL" ]; then
cmake $CMAKE_OPENSSL_LOCATION $BUILD_TYPE $OQSPROV_CMAKE_PARAMS -S . -B _build && cmake --build _build
cmake $CMAKE_PARAMS $CMAKE_OPENSSL_LOCATION $BUILD_TYPE $OQSPROV_CMAKE_PARAMS -S . -B _build && cmake --build _build
else
cmake -DOPENSSL_ROOT_DIR=$OPENSSL_INSTALL $BUILD_TYPE $OQSPROV_CMAKE_PARAMS -S . -B _build && cmake --build _build
cmake $CMAKE_PARAMS -DOPENSSL_ROOT_DIR=$OPENSSL_INSTALL $BUILD_TYPE $OQSPROV_CMAKE_PARAMS -S . -B _build && cmake --build _build
fi
if [ $? -ne 0 ]; then
echo "provider build failed. Exiting."
Expand Down
Loading