diff --git a/CMakeLists.txt b/CMakeLists.txt index aeb7a3f345..3c5fda5865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,15 +166,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8) "${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000") endif() -option(USE_GCOV "Enable gcov support" OFF) - -if(USE_GCOV) - message(STATUS "Enabling gcov support") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") -endif() - include_directories("${PROJECT_BINARY_DIR}/config") include_directories("${PROJECT_SOURCE_DIR}/src") diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 810809ea17..803ae4f911 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -1,5 +1,14 @@ include(CheckLibraryExists) +option(USE_GCOV "Enable gcov support" OFF) + +if(USE_GCOV) + message(STATUS "Enabling gcov support") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") +endif() + set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto) set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua) file(GLOB API_HEADERS api/*.h) @@ -199,6 +208,6 @@ set_property(TARGET libnvim APPEND_STRING PROPERTY COMPILE_FLAGS " -DMAKE_LIB ") add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_GENERATED_SOURCES} ${NEOVIM_SOURCES} ${NEOVIM_HEADERS}) target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES}) -set_target_properties(nvim-test PROPERTIES COMPILE_FLAGS -DUNIT_TESTING) +set_property(TARGET nvim-test APPEND_STRING PROPERTY COMPILE_FLAGS -DUNIT_TESTING) add_subdirectory(po)