From: Joel Cornett Date: Wed, 6 Apr 2016 19:24:59 +0000 (-0400) Subject: test for GNU compiler before attempting to link against libgcov X-Git-Tag: 3.0.0-233~460^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=984e3de28555cfb2fc08d504ece8978389cc177f;p=thirdparty%2Fsnort3.git test for GNU compiler before attempting to link against libgcov --- diff --git a/cmake/configure_options.cmake b/cmake/configure_options.cmake index f51a48d51..e7c2792df 100644 --- a/cmake/configure_options.cmake +++ b/cmake/configure_options.cmake @@ -60,7 +60,10 @@ if (ENABLE_CODE_COVERAGE) set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -DNDEBUG") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fprofile-arcs -ftest-coverage") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov") + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov") + endif () endif() if (BUILD_UNIT_TESTS)