Skip to content

Commit 50462e0

Browse files
authored
Allow using generator expressions inside of the KASSERT_ASSERTION_LEVEL property. (#69)
1 parent 0734b01 commit 50462e0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ target_compile_features(${KASSERT_CMAKE_NAMESPACE}_kassert INTERFACE cxx_std_17)
7070
# THROWING_KASSERT is able to throw an exception if an assertion fails. If KASSERT_EXCEPTION_MODE is defined, than an
7171
# exception will be thrown upon failure, otherwise it behaves like regular KASSERT. You can either manually #define it,
7272
# or by setting the KASSERT_EXCEPTION_MODE target property to ON on the target which links to kassert.
73-
set(exception_mode_enabled "$<BOOL:$<TARGET_PROPERTY:KASSERT_EXCEPTION_MODE>>")
73+
set(exception_mode_enabled "$<BOOL:$<TARGET_PROPERTY:$<GENEX_EVAL:${KASSERT_PREFIX}_EXCEPTION_MODE>>>")
7474
target_compile_definitions(
7575
${KASSERT_CMAKE_NAMESPACE}_kassert INTERFACE "$<${exception_mode_enabled}:-D${KASSERT_PREFIX}_EXCEPTION_MODE>"
7676
)
7777

7878
# The assertion level controls which assertions are enabled during runtime. Assertion levels can be set explicitly using
7979
# the -DKASSERT_ASSERTION_LEVEL=... flag. You can also set the KASSERT_ASSERTION_LEVEL target property to the desired
8080
# level on the target which links to kassert. This will properly #define the assertion level for the target.
81-
set(assertion_level_set "$<BOOL:$<TARGET_PROPERTY:${KASSERT_PREFIX}_ASSERTION_LEVEL>>")
82-
set(assertion_level "$<TARGET_PROPERTY:${KASSERT_PREFIX}_ASSERTION_LEVEL>")
81+
set(assertion_level_set "$<BOOL:$<GENEX_EVAL:$<TARGET_PROPERTY:${KASSERT_PREFIX}_ASSERTION_LEVEL>>>")
82+
set(assertion_level "$<GENEX_EVAL:$<TARGET_PROPERTY:${KASSERT_PREFIX}_ASSERTION_LEVEL>>")
8383
target_compile_definitions(
8484
${KASSERT_CMAKE_NAMESPACE}_kassert
8585
INTERFACE "$<${assertion_level_set}:-D${KASSERT_PREFIX}_ASSERTION_LEVEL=${assertion_level}>"

0 commit comments

Comments
 (0)