summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-02-12 08:03:16 (GMT)
committerAndreas Schneider <asn@cryptomilk.org>2015-02-12 15:59:22 (GMT)
commitc180601e564bcbf2ec2d143963ca22a3effdb9fe (patch)
tree9ca19fe92112dd982c899c9d8c28a767083cd320
parente7d3455e9d0f9393dc8055a7fd89c93fa5236d5a (diff)
downloadcmocka-c180601e564bcbf2ec2d143963ca22a3effdb9fe.zip
cmocka-c180601e564bcbf2ec2d143963ca22a3effdb9fe.tar.gz
cmocka-c180601e564bcbf2ec2d143963ca22a3effdb9fe.tar.bz2
cmake: Build tests with the static library.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--DefineOptions.cmake4
-rw-r--r--tests/CMakeLists.txt4
2 files changed, 6 insertions, 2 deletions
diff --git a/DefineOptions.cmake b/DefineOptions.cmake
index d34d2a3..7564a22 100644
--- a/DefineOptions.cmake
+++ b/DefineOptions.cmake
@@ -1,3 +1,7 @@
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()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1be4867..e10985b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -19,14 +19,14 @@ set(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()
-add_cmocka_test(test_cmockery test_cmockery.c ${CMOCKA_SHARED_LIBRARY})
+add_cmocka_test(test_cmockery test_cmockery.c ${CMOCKA_STATIC_LIBRARY})
### Exceptions