From a1348978e6fd4df033f4a0a719c1aa196d18c842 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 15 Jun 2023 04:59:56 -0700 Subject: [PATCH] build: do not define the sodium target when not found by CMake (#1287) --- contrib/Findsodium.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/Findsodium.cmake b/contrib/Findsodium.cmake index 076ff370..316c5e94 100644 --- a/contrib/Findsodium.cmake +++ b/contrib/Findsodium.cmake @@ -231,6 +231,10 @@ find_package_handle_standard_args(sodium VERSION_VAR sodium_VERSION_STRING) +if (NOT sodium_FOUND) + return() +endif() + # mark file paths as advanced mark_as_advanced(sodium_INCLUDE_DIR) mark_as_advanced(sodium_LIBRARY_DEBUG)