]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
Debug compilation warnings on Windows.
authorrnv <rnv@opencascade.com>
Thu, 13 Aug 2020 12:20:27 +0000 (15:20 +0300)
committerrnv <rnv@opencascade.com>
Thu, 13 Aug 2020 12:20:27 +0000 (15:20 +0300)
cmake/SalomeSetupPlatform.cmake

index c470e35a1e778d7351b8a91687590af52add8b97..a1290e6360a7908b19a9b14a680b295db75dbbcd 100644 (file)
@@ -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()