This is an automated email from the ASF dual-hosted git repository. jbarrett pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push: new 4181755 GEODE-5209: Adds coverage to clang compilers. (#302) 4181755 is described below commit 4181755bd09a5936fd15ec38c628c4ea985a125d Author: Jacob Barrett <jbarr...@pivotal.io> AuthorDate: Fri May 25 14:15:20 2018 -0700 GEODE-5209: Adds coverage to clang compilers. (#302) --- BUILDING.md | 12 +++++++----- CMakeLists.txt | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 6b79740..0fb135c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -32,16 +32,14 @@ Building requires access to an installation of Geode. There are two ways to achi $ cmake --build . -- <platform-specific parallelism parameters (see below)> To explicitly specify the location in which the Native Client will be installed, add `-DCMAKE_INSTALL_PREFIX=/path/to/installation/destination` to this initial `cmake` execution command. - + ### Generator CMake uses a "generator" to produce configuration files for use by a variety of build tools, e.g., UNIX makefiles, Visual Studio projects. By default a system-specific generator is used by CMake during configuration. (Please see [the CMake documentation](https://cmake.org/documentation/) for further information.) However, in many cases there is a better choice. #### CLion / Eclipse / Other The recommended generator for most unix platforms is 'Makefiles' (default): - $ cmake .. - -For enabling C++ code coverage on Linux, see [Code Coverage](#code-coverage). + $ cmake .. #### Xcode The recommended generator for Xcode is `Xcode`: @@ -68,7 +66,11 @@ For faster builds, use optional parallelism parameters in the last build step: ### Code Coverage -If building on Linux, you can enable C++ code coverage by adding `-DUSE_CODE_COVERAGE=ON` to the CMake [Generator](#generator) command. You can then generate a C++ code coverage report by downloading [lcov](http://ltp.sourceforge.net/coverage/lcov.php). After acquiring lcov, finish the [Steps to build](#Steps-to-build) section above. Then, run the tests as described in the [CONTRIBUTING.md](CONTRIBUTING.md). Finally, run the following commands from the `build` directory: +If building with GCC or Clang you can enable C++ code coverage by adding `-DUSE_CODE_COVERAGE=ON` to the CMake [Generator](#generator) command. + + $ cmake ... -DUSE_CODE_COVERAGE=ON ... + +You can then generate a C++ code coverage report by downloading [lcov](http://ltp.sourceforge.net/coverage/lcov.php). After acquiring lcov, finish the [Steps to build](#Steps-to-build) section above. Then, run the tests as described in the [CONTRIBUTING.md](CONTRIBUTING.md). Finally, run the following commands from the `build` directory: $ lcov --capture --directory . --output-file coverage.info $ genhtml coverage.info --output-directory coverage_report diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b09a3e..95f79e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") # -Weffc++ TODO fix ) - if (${USE_CPP_COVERAGE}) + if (USE_CPP_COVERAGE) target_compile_options(_CppCodeCoverage INTERFACE --coverage) target_link_libraries(_CppCodeCoverage INTERFACE --coverage) endif() @@ -242,6 +242,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-documentation-unknown-command ) + if (USE_CPP_COVERAGE) + target_compile_options(_CppCodeCoverage INTERFACE --coverage) + target_link_libraries(_CppCodeCoverage INTERFACE --coverage) + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(BUILD_CLI 1) -- To stop receiving notification emails like this one, please contact jbarr...@apache.org.