From 4386814b045a74c10edad5effafd48ac869ebda1 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 30 Jan 2019 02:01:50 +0100 Subject: build: set compiler options in one place - add_definitions() is preferred to CMAKE_C_FLAGS. --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0629403dfe..213709cb8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,11 +172,6 @@ if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif() -# Enable -Wconversion. -if(NOT MSVC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow -Wconversion") -endif() - # gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently # does not work with Neovim due to some uses of dynamically-sized structures. # https://github.com/neovim/neovim/issues/223 @@ -264,7 +259,7 @@ if(MSVC) add_definitions(-DWIN32) else() add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter - -Wstrict-prototypes -std=gnu99) + -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion) check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG) if(HAS_WIMPLICIT_FALLTHROUGH_FLAG) -- cgit