From b9e8c3f96435a041b56265028b4543d2056b6703 Mon Sep 17 00:00:00 2001 From: Niklas Uhl Date: Mon, 18 Aug 2025 18:13:34 +0200 Subject: [PATCH] Allow using generator expressions inside of the KASSERT_ASSERTION_LEVEL property. This also, the exception mode property did not properly respect `KASSERT_PREFIX`, fixed that. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c62b973..e017ef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ target_compile_features(${KASSERT_CMAKE_NAMESPACE}_kassert INTERFACE cxx_std_17) # THROWING_KASSERT is able to throw an exception if an assertion fails. If KASSERT_EXCEPTION_MODE is defined, than an # exception will be thrown upon failure, otherwise it behaves like regular KASSERT. You can either manually #define it, # or by setting the KASSERT_EXCEPTION_MODE target property to ON on the target which links to kassert. -set(exception_mode_enabled "$>") +set(exception_mode_enabled "$>>") target_compile_definitions( ${KASSERT_CMAKE_NAMESPACE}_kassert INTERFACE "$<${exception_mode_enabled}:-D${KASSERT_PREFIX}_EXCEPTION_MODE>" ) @@ -78,8 +78,8 @@ target_compile_definitions( # The assertion level controls which assertions are enabled during runtime. Assertion levels can be set explicitly using # the -DKASSERT_ASSERTION_LEVEL=... flag. You can also set the KASSERT_ASSERTION_LEVEL target property to the desired # level on the target which links to kassert. This will properly #define the assertion level for the target. -set(assertion_level_set "$>") -set(assertion_level "$") +set(assertion_level_set "$>>") +set(assertion_level "$>") target_compile_definitions( ${KASSERT_CMAKE_NAMESPACE}_kassert INTERFACE "$<${assertion_level_set}:-D${KASSERT_PREFIX}_ASSERTION_LEVEL=${assertion_level}>"