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

halt build if CURVE requested but not found #4663

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,13 @@ endif()
# Select curve encryption library, defaults to disabled To use libsodium instead, use --with-libsodium(must be
# installed) To disable curve, use --disable-curve

option(WITH_LIBSODIUM "Use libsodium" OFF)
option(WITH_LIBSODIUM "Use libsodium (required with ENABLE_CURVE)" OFF)
option(WITH_LIBSODIUM_STATIC "Use static libsodium library" OFF)
option(ENABLE_LIBSODIUM_RANDOMBYTES_CLOSE "Automatically close libsodium randombytes. Not threadsafe without getrandom()" ON)
option(ENABLE_CURVE "Enable CURVE security" OFF)

if(ENABLE_CURVE)
# libsodium is currently the only CURVE provider
if(WITH_LIBSODIUM)
find_package("sodium")
if(SODIUM_FOUND)
Expand All @@ -280,12 +281,17 @@ if(ENABLE_CURVE)
endif()
else()
message(
ERROR
"libsodium not installed, you may want to install libsodium and run cmake again"
FATAL_ERROR
"libsodium requested but not found, you may want to install libsodium and run cmake again"
)
endif()
else() # WITH_LIBSODIUM
message(
FATAL_ERROR
"ENABLE_CURVE set, but not WITH_LIBSODIUM. No CURVE provider found."
)
endif()
else()
else() # ENABLE_CURVE
message(STATUS "CURVE security is disabled")
endif()

Expand Down