diff options
author | dundargoc <gocdundar@gmail.com> | 2022-11-12 13:34:14 +0100 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-11-14 20:17:04 +0100 |
commit | 2755510f7800ff675a5fbe2cfaa59459ff3ab6b2 (patch) | |
tree | 13bc54ad9b6f2c724eb188a5e44753c92652c43f /CMakeLists.txt | |
parent | f8c671827710c6e9cca3bfd60c32098b2be8239a (diff) | |
download | rneovim-2755510f7800ff675a5fbe2cfaa59459ff3ab6b2.tar.gz rneovim-2755510f7800ff675a5fbe2cfaa59459ff3ab6b2.tar.bz2 rneovim-2755510f7800ff675a5fbe2cfaa59459ff3ab6b2.zip |
ci(windows): treat compiler warnings as errors
Reduce the warning level from 3 to 1 and fix all warnings.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a78b8d5e47..a6e0ee017a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ # Version should match the tested CMAKE_URL in .github/workflows/ci.yml. cmake_minimum_required(VERSION 3.10) + +# Can be removed once minimum version is at least 3.15 +if(POLICY CMP0092) + cmake_policy(SET CMP0092 NEW) +endif() + project(nvim C) if(POLICY CMP0075) @@ -270,7 +276,7 @@ int main(void) option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF) if(MSVC) # XXX: /W4 gives too many warnings. #3241 - add_compile_options(/W3) + add_compile_options(-W1 -wd4311) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) add_definitions(-DMSWIN) else() @@ -364,10 +370,14 @@ option(CI_BUILD "CI, extra flags will be set" OFF) if(CI_BUILD) message(STATUS "CI build enabled") - add_compile_options(-Werror) - if(DEFINED ENV{BUILD_UCHAR}) - # Get some test coverage for unsigned char - add_compile_options(-funsigned-char) + if(MSVC) + add_compile_options(-WX) + else() + add_compile_options(-Werror) + if(DEFINED ENV{BUILD_UCHAR}) + # Get some test coverage for unsigned char + add_compile_options(-funsigned-char) + endif() endif() endif() |