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()