build: CMake: do not set CMP0059 to old (#10363)

Keeps using add_definitions for compatibility with older CMake.

Newer CMake (3.12) would have `add_compile_definitions`, but it is not
required, since `add_defitions` was meant to be used for
compile/preprocessor definitions initially anyway.

Ref: https://github.com/neovim/neovim/pull/4389
This commit is contained in:
Daniel Hahler
2019-06-29 20:37:48 +02:00
committed by GitHub
parent 39ba35b38d
commit c207095445
5 changed files with 38 additions and 28 deletions

View File

@@ -7,7 +7,7 @@ if(USE_GCOV)
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")
add_compile_definitions(USE_GCOV)
add_definitions(-DUSE_GCOV)
endif()
endif()