diff options
author | Tom Hughes <tom.hughes@palm.com> | 2010-11-24 09:34:50 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-02 21:35:39 +0300 |
commit | b46f10a11fbb5a8426c28e9113fff57cb7405958 (patch) | |
tree | 6e68912aefc9774d3e3df42b7caf14f5ea749661 /CMakeLists.txt | |
parent | a1138c6f2ae1c8840caeea37526626b1c3f6f1a5 (diff) |
cmake: Add coverage support.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 88feea7ef3b..0ec17a115ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,20 @@ cmake_minimum_required(VERSION 2.6) project(node) +if(USE_GCOV) + set(CMAKE_BUILD_TYPE "Debug") + + # Set global c and c++ flags + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + + # Link flags used for creating executables + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov -fprofile-arcs") + + # Link flags used for creating shared libraries + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lgcov -profile-arcs") +endif() + # # options # @@ -72,5 +86,9 @@ if(${OPENSSL_FOUND} MATCHES TRUE) message(" OpenSSL: ${OPENSSL_LIBRARIES}") endif() -# message(" CCFLAGS: ${CCFLAGS}") -# message(" CPPFLAGS: ${CPPFLAGS}") +if(USE_GCOV) + message(" gcov: enabled") +endif() + +message(" CCFLAGS: ${CCFLAGS}") +message(" CPPFLAGS: ${CPPFLAGS}") |