Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
option(WITH_STATIC_LIB "Build with a static library" OFF)
option(WITH_CMOCKERY_SUPPORT "Install a cmockery header" OFF)
option(UNIT_TESTING "Build with unit testing" OFF)
option(WITH_STATIC_LIB "Build with a static library" OFF)
option(WITH_CMOCKERY_SUPPORT "Install a cmockery header" OFF)
option(UNIT_TESTING "Build with unit testing" OFF)
+
+if (UNIT_TESTING)
+ set(WITH_STATIC_LIB ON)
+endif()
test_setup_fail)
foreach(_CMOCKA_TEST ${CMOCKA_TESTS})
test_setup_fail)
foreach(_CMOCKA_TEST ${CMOCKA_TESTS})
- add_cmocka_test(${_CMOCKA_TEST} ${_CMOCKA_TEST}.c ${CMOCKA_SHARED_LIBRARY})
+ add_cmocka_test(${_CMOCKA_TEST} ${_CMOCKA_TEST}.c ${CMOCKA_STATIC_LIBRARY})
endforeach()
### Special Cases
if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
set_source_files_properties(test_cmockery.c PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()
endforeach()
### Special Cases
if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
set_source_files_properties(test_cmockery.c PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()
-add_cmocka_test(test_cmockery test_cmockery.c ${CMOCKA_SHARED_LIBRARY})
+add_cmocka_test(test_cmockery test_cmockery.c ${CMOCKA_STATIC_LIBRARY})