From: rnv Date: Thu, 13 Aug 2020 12:20:27 +0000 (+0300) Subject: Debug compilation warnings on Windows. X-Git-Tag: V9_6_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da4d906f99f4c1ead4f1b8ec61c9a3a3763c79c2;p=tools%2Fconfiguration.git Debug compilation warnings on Windows. --- diff --git a/cmake/SalomeSetupPlatform.cmake b/cmake/SalomeSetupPlatform.cmake index c470e35..a1290e6 100644 --- a/cmake/SalomeSetupPlatform.cmake +++ b/cmake/SalomeSetupPlatform.cmake @@ -125,18 +125,28 @@ IF(NOT NO_CXX11_SUPPORT) ENDIF() # Fight warnings -IF(NOT (WIN32 OR APPLE)) +IF(NOT APPLE) OPTION(SALOME_DEBUG_WARNINGS "Report more warnings" OFF) OPTION(SALOME_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) # Report more warnings MARK_AS_ADVANCED(SALOME_DEBUG_WARNINGS SALOME_TREAT_WARNINGS_AS_ERRORS) IF(SALOME_DEBUG_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") + IF(WIN32) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + ELSE() + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic") + ENDIF() ENDIF() ## Treat all warnings as errors IF(SALOME_TREAT_WARNINGS_AS_ERRORS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + IF(WIN32) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + ELSE() + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + ENDIF() ENDIF() ENDIF()