aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-02-27 20:14:10 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2023-03-03 14:26:29 +0100
commit2cffd048334912f72e0f55b2a02bd1fd9107613a (patch)
tree8b9e8668ad64221334893404f74e86d2ff98f8e9 /src
parent848dac0aaa68a6ecbb7fe346a90bb5e5f5d7f09f (diff)
downloadrneovim-2cffd048334912f72e0f55b2a02bd1fd9107613a.tar.gz
rneovim-2cffd048334912f72e0f55b2a02bd1fd9107613a.tar.bz2
rneovim-2cffd048334912f72e0f55b2a02bd1fd9107613a.zip
refactor(build): graduate -Wvla, -fno-common and -Og "features"
These are in gcc 4.9+ which we require anyway. -Og is safe on clang as well (reserved for a future debug-optimize mode, and currently does the same as -O1 which is reasonable)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nvim/CMakeLists.txt15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 504dde5a9c..10f44c428c 100755
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -87,14 +87,14 @@ if(MSVC)
target_sources(main_lib INTERFACE ${CMAKE_CURRENT_LIST_DIR}/os/nvim.manifest)
else()
target_compile_options(main_lib INTERFACE -Wall -Wextra -pedantic -Wno-unused-parameter
- -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
+ -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla
-Wdouble-promotion
-Wmissing-noreturn
-Wmissing-format-attribute
-Wmissing-prototypes)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
- target_compile_options(main_lib INTERFACE
+ target_compile_options(main_lib INTERFACE -fno-common
$<$<CONFIG:Release>:-Wno-unused-result>
$<$<CONFIG:RelWithDebInfo>:-Wno-unused-result>
$<$<CONFIG:MinSizeRel>:-Wno-unused-result>)
@@ -144,17 +144,6 @@ if(WIN32)
target_compile_definitions(main_lib INTERFACE _WIN32_WINNT=0x0602 MSWIN)
endif()
-# OpenBSD's GCC (4.2.1) doesn't have -Wvla
-check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
-if(HAS_WVLA_FLAG)
- target_compile_options(main_lib INTERFACE -Wvla)
-endif()
-
-check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
-if (HAVE_FNO_COMMON)
- target_compile_options(main_lib INTERFACE -fno-common)
-endif()
-
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
if(HAS_DIAG_COLOR_FLAG)
if(CMAKE_GENERATOR MATCHES "Ninja")