diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ebba93..7e5a648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,67 +197,22 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG) endif() elseif(MSVC) set(MSVC_DISABLED_WARNINGS_LIST - "C4061" # enumerator 'identifier' in switch of enum 'enumeration' is not - # explicitly handled by a case label - # Disable this because it flags even when there is a default. "C4100" # 'exarg' : unreferenced formal parameter "C4127" # conditional expression is constant - "C4200" # nonstandard extension used : zero-sized array in - # struct/union. + # C4204 and C4221 are C89-only restrictions which were dropped in C99, but + # VS2017 warns about it. They can be removed when we require VS2019. "C4204" # nonstandard extension used: non-constant aggregate initializer "C4221" # nonstandard extension used : 'identifier' : cannot be # initialized using address of automatic variable - "C4242" # 'function' : conversion from 'int' to 'uint8_t', - # possible loss of data "C4244" # 'function' : conversion from 'int' to 'uint8_t', # possible loss of data "C4267" # conversion from 'size_t' to 'int', possible loss of data - "C4371" # layout of class may have changed from a previous version of the - # compiler due to better packing of member '...' - "C4388" # signed/unsigned mismatch - "C4296" # '>=' : expression is always true - "C4350" # behavior change: 'std::_Wrap_alloc...' - "C4365" # '=' : conversion from 'size_t' to 'int', - # signed/unsigned mismatch - "C4389" # '!=' : signed/unsigned mismatch - "C4464" # relative include path contains '..' - "C4510" # 'argument' : default constructor could not be generated - "C4512" # 'argument' : assignment operator could not be generated - "C4514" # 'function': unreferenced inline function has been removed - "C4548" # expression before comma has no effect; expected expression with - # side-effect" caused by FD_* macros. - "C4610" # struct 'argument' can never be instantiated - user defined - # constructor required. - "C4623" # default constructor was implicitly defined as deleted - "C4625" # copy constructor could not be generated because a base class - # copy constructor is inaccessible or deleted - "C4626" # assignment operator could not be generated because a base class - # assignment operator is inaccessible or deleted - "C4628" # digraphs not supported with -Ze - "C4668" # 'symbol' is not defined as a preprocessor macro, replacing with - # '0' for 'directives' - # Disable this because GTest uses it everywhere. "C4706" # assignment within conditional expression - "C4710" # 'function': function not inlined - "C4711" # function 'function' selected for inline expansion - "C4800" # 'int' : forcing value to bool 'true' or 'false' - # (performance warning) - "C4820" # 'bytes' bytes padding added after construct 'member_name' - "C5026" # move constructor was implicitly defined as deleted - "C5027" # move assignment operator was implicitly defined as deleted - "C5045" # Compiler will insert Spectre mitigation for memory load if - # /Qspectre switch specified - ) - set(MSVC_LEVEL4_WARNINGS_LIST - # See https://connect.microsoft.com/VisualStudio/feedback/details/1217660/warning-c4265-when-using-functional-header - "C4265" # class has virtual functions, but destructor is not virtual ) string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR ${MSVC_DISABLED_WARNINGS_LIST}) - string(REPLACE "C" " -w4" MSVC_LEVEL4_WARNINGS_STR - ${MSVC_LEVEL4_WARNINGS_LIST}) - set(CMAKE_C_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") - set(CMAKE_CXX_FLAGS "-utf-8 -Wall -WX ${MSVC_DISABLED_WARNINGS_STR} ${MSVC_LEVEL4_WARNINGS_STR}") + set(CMAKE_C_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") + set(CMAKE_CXX_FLAGS "-utf-8 -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") endif() if(WIN32) @@ -266,10 +221,6 @@ if(WIN32) add_definitions(-DNOMINMAX) # Allow use of fopen. add_definitions(-D_CRT_SECURE_NO_WARNINGS) - # VS 2017 and higher supports STL-only warning suppressions. - # A bug in CMake < 3.13.0 may cause the space in this value to - # cause issues when building with NASM. In that case, update CMake. - add_definitions("-D_STL_EXTRA_DISABLED_WARNINGS=4774 4987") endif() # pthread_rwlock_t on Linux requires a feature flag. We limit this to Linux |