Skip to content

Commit cb1e647

Browse files
authored
Merge pull request #430 from night1rider/cmake-options-fix-wolftpm_no_lock
Updating default logic for WOLFTPM_NO_LOCK depending on state of WOLFTPM_SINGLE_THREADED
2 parents 75938ca + f68e28b commit cb1e647

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,16 @@ if(WOLFTPM_SINGLE_THREADED)
9191
endif()
9292

9393
# Mutex locking
94-
set(WOLFTPM_NO_LOCK "no" CACHE STRING
95-
"Enable thread mutex locking (default: enabled)")
94+
if(WOLFTPM_SINGLE_THREADED)
95+
set(_WOLFTPM_NO_LOCK_DEFAULT "yes")
96+
else()
97+
set(_WOLFTPM_NO_LOCK_DEFAULT "no")
98+
endif()
99+
set(WOLFTPM_NO_LOCK "${_WOLFTPM_NO_LOCK_DEFAULT}" CACHE STRING
100+
"Disable thread mutex locking (default: ${_WOLFTPM_NO_LOCK_DEFAULT})")
96101
set_property(CACHE WOLFTPM_NO_LOCK
97102
PROPERTY STRINGS "yes;no")
98-
if(NOT WOLFTPM_NO_LOCK)
103+
if(WOLFTPM_NO_LOCK)
99104
list(APPEND WOLFTPM_DEFINITIONS
100105
"-DWOLFTPM_NO_LOCK")
101106
endif()

0 commit comments

Comments
 (0)