Skip to content

Commit

Permalink
fix: contract mode definition should only be added when not testing a…
Browse files Browse the repository at this point in the history
…sap_contract
  • Loading branch information
abdes committed Sep 19, 2022
1 parent 7997b68 commit c6d5e34
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/CompileDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include_guard(GLOBAL)
# ------------------------------------------------------------------------------

function(asap_set_compile_definitions target)
set(argOption)
set(argOption "NO_CONTRACT")
set(argSingle "")
set(argMulti "ADD" "REMOVE")

Expand Down Expand Up @@ -53,7 +53,9 @@ function(asap_set_compile_definitions target)
# If linking against asap_contract, set the contract mode based on the build
# type. Use generator expressions only, do not check for CMAKE_BUILD_TYPE
# which is not friendly with multi-config generators.
if(TARGET asap_contract)
#
# Do not add this definition if we are testing asap-_contract
if(TARGET asap_contract AND NOT ASAP_CONTRACT_TESTING)
if(NOT DEFINED OPTION_CONTRACT_MODE)
target_compile_definitions(
${target}
Expand Down

0 comments on commit c6d5e34

Please sign in to comment.