From ef08f8e5888a6900e0969b8a44f6d0690c95d411 Mon Sep 17 00:00:00 2001 From: Douglas Stebila Date: Fri, 22 Nov 2024 15:54:09 -0500 Subject: [PATCH] Make OQS_VERSION_PRE_RELEASE optionally defined Co-authored-by: Spencer Wilson Signed-off-by: Douglas Stebila --- src/oqsconfig.h.cmake | 2 +- tests/system_info.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/oqsconfig.h.cmake b/src/oqsconfig.h.cmake index 00013d4cf..198cc90ce 100644 --- a/src/oqsconfig.h.cmake +++ b/src/oqsconfig.h.cmake @@ -4,7 +4,7 @@ #define OQS_VERSION_MAJOR @OQS_VERSION_MAJOR@ #define OQS_VERSION_MINOR @OQS_VERSION_MINOR@ #define OQS_VERSION_PATCH @OQS_VERSION_PATCH@ -#define OQS_VERSION_PRE_RELEASE "@OQS_VERSION_PRE_RELEASE@" +#cmakedefine OQS_VERSION_PRE_RELEASE "@OQS_VERSION_PRE_RELEASE@" #cmakedefine OQS_COMPILE_BUILD_TARGET "@OQS_COMPILE_BUILD_TARGET@" #cmakedefine OQS_DIST_BUILD 1 #cmakedefine OQS_DIST_X86_64_BUILD 1 diff --git a/tests/system_info.c b/tests/system_info.c index b16815dc8..37689dc20 100644 --- a/tests/system_info.c +++ b/tests/system_info.c @@ -219,7 +219,11 @@ static void print_oqs_configuration(void) { * USE_SANITIZER: -fsanitize= option present in compile options * OQS_ENABLE_TEST_CONSTANT_TIME: only shown below */ +#if defined(OQS_VERSION_PRE_RELEASE) printf("OQS version: %s (major: %d, minor: %d, patch: %d, pre-release: %s)\n", OQS_VERSION_TEXT, OQS_VERSION_MAJOR, OQS_VERSION_MINOR, OQS_VERSION_PATCH, OQS_VERSION_PRE_RELEASE); +#else + printf("OQS version: %s (major: %d, minor: %d, patch: %d)\n", OQS_VERSION_TEXT, OQS_VERSION_MAJOR, OQS_VERSION_MINOR, OQS_VERSION_PATCH); +#endif #if defined(OQS_COMPILE_GIT_COMMIT) printf("Git commit: %s\n", OQS_COMPILE_GIT_COMMIT); #endif