From 7e7ad05b58cf46e4b1f88313c2c2373459bf22ed Mon Sep 17 00:00:00 2001 From: Marcus Winter Date: Wed, 10 Feb 2016 11:46:47 +0100 Subject: [PATCH] cmake: remove vs (before 2015) warnings --- CMakeCommon/SetCompilerFlags.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeCommon/SetCompilerFlags.cmake b/CMakeCommon/SetCompilerFlags.cmake index a03378d..b43fc6f 100644 --- a/CMakeCommon/SetCompilerFlags.cmake +++ b/CMakeCommon/SetCompilerFlags.cmake @@ -86,19 +86,23 @@ function(SetVisualStudioCompilerFlags) # This is only an informational warning about which functions # have been inlined by the compiler. # 4255 -> Deactivates warning "no function prototype given converting () to (void)" - # + # # Locally suppressed warnings (should not be globally suppressed): # 4640 -> Information that local static variable initialization is not # thread-safe. # - # VS 2015 specific warnings: - # 5026 -> Move constructor was implicitly defined as deleted + # VS 2015 specific warnings: + # 5026 -> Move constructor was implicitly defined as deleted # 5027 -> Move assignment operator was implicitly defined as deleted - # - set(warning_flags "/Wall /wd4820 /wd4514 /wd4668 /wd4710 /wd4350 /wd4571 /wd4625 /wd4626 /wd4711 /wd4255 /wd5026 /wd5027") - if (WARNINGS_ARE_ERRORS STREQUAL ON) + # + set(warning_flags "/Wall /wd4820 /wd4514 /wd4668 /wd4710 /wd4350 /wd4571 /wd4625 /wd4626 /wd4711 /wd4255") + if (WARNINGS_ARE_ERRORS STREQUAL ON) set(warning_flags "${warning_flags} /WX") - endif() + endif() + string(FIND "${CMAKE_GENERATOR}" "Visual Studio 14 2015" vs2015_state) + if (vs2015_state EQUAL 0) + set(warning_flags "${warning_flags} /wd5026 /wd5027") + endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warning_flags}" PARENT_SCOPE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${warning_flags}" PARENT_SCOPE) endif() -- libgit2 0.26.0