[mlpack-git] master: Added libsupc++ library to linker while building with coverage (8cc01d5)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jul 20 15:16:44 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/57a24a9d9fbdb4687ea0e0fef85bc2a133420dcc...82cf86500e8ad98b32db9fd9cceca4a844f4bb19

>---------------------------------------------------------------

commit 8cc01d5c7fed666cb57152b0f84a178421294e57
Author: sumedhghaisas <sumedhghaisas at gmail.com>
Date:   Thu Jul 21 00:46:44 2016 +0530

    Added libsupc++ library to linker while building with coverage


>---------------------------------------------------------------

8cc01d5c7fed666cb57152b0f84a178421294e57
 CMake/mlpack_coverage.in  | 4 ++--
 CMakeLists.txt            | 3 +++
 src/mlpack/CMakeLists.txt | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CMake/mlpack_coverage.in b/CMake/mlpack_coverage.in
index 36c1eaf..0d3710a 100755
--- a/CMake/mlpack_coverage.in
+++ b/CMake/mlpack_coverage.in
@@ -63,7 +63,8 @@ fi
 
 # initial pass
 echo "Generating primary coverage report"
-lcov -b . -c -i -d ./ -o .coverage.wtest.base >> ./coveragehistory/$current_log_file
+[[ -d ./coveragehistory/ ]] || mkdir coveragehistory
+lcov -b . -c -i -d ./ -o .coverage.wtest.base > ./coveragehistory/$current_log_file
 
 # Run the tests
 if [ "$test_case" = "ALL" ]; then
@@ -112,7 +113,6 @@ genhtml -o ./coverage/ .coverage.total
 
 # Extra: Preserve coverage file in coveragehistory folder
 coverage_file=$current_coverage_file
-[[ -d ./coveragehistory/ ]] || mkdir coveragehistory
 cp .coverage.total ./coveragehistory/$current_coverage_file
 
 # clean temp coverage files
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc2189c..b54696a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,6 +74,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lm")
 endif()
 
+set(COMPILER_SUPPORT_LIBRARIES "")
+
 # Setup build for test coverage
 if(BUILD_WITH_COVERAGE)
   # Currently coverage only works with GNU g++
@@ -86,6 +88,7 @@ if(BUILD_WITH_COVERAGE)
       message(FATAL_ERROR "gcov not found! Aborting...")
     endif()
 
+    set(COMPILER_SUPPORT_LIBRARIES "supc++")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fno-inline -fno-inline-small-functions -fno-default-inline -fprofile-arcs -fkeep-inline-functions")
     message(WARNING "Adding debug options for coverage")
     # Remove optimizations for better line coverage
diff --git a/src/mlpack/CMakeLists.txt b/src/mlpack/CMakeLists.txt
index be5cbca..9d55c5e 100644
--- a/src/mlpack/CMakeLists.txt
+++ b/src/mlpack/CMakeLists.txt
@@ -41,7 +41,9 @@ target_link_libraries(mlpack
   ${ARMADILLO_LIBRARIES}
   ${Boost_LIBRARIES}
   ${LIBXML2_LIBRARIES}
+  ${COMPILER_SUPPORT_LIBRARIES}
 )
+
 set_target_properties(mlpack
   PROPERTIES
   VERSION 2.0




More information about the mlpack-git mailing list