aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-30 02:01:50 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-02-04 02:57:18 +0100
commit4386814b045a74c10edad5effafd48ac869ebda1 (patch)
tree14d25488965f675815739a52cd8d6495e3c50735
parentda88278f2786d85565e6e2a163709266e4c46232 (diff)
downloadrneovim-4386814b045a74c10edad5effafd48ac869ebda1.tar.gz
rneovim-4386814b045a74c10edad5effafd48ac869ebda1.tar.bz2
rneovim-4386814b045a74c10edad5effafd48ac869ebda1.zip
build: set compiler options in one place
- add_definitions() is preferred to CMAKE_C_FLAGS.
-rw-r--r--CMakeLists.txt7
1 files changed, 1 insertions, 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)