Warning as error for Windows (#13291)

* parent 6e7016ccda
author Ilya Churaev <ilya.churaev@intel.com> 1664281499 +0400
committer Ilya Churaev <ilya.churaev@intel.com> 1664510018 +0400

Fixed warnings on local machine

* Added CMAKE_COMPILE_WARNING_AS_ERROR usage

* Fixed style

* Fixed merge conflicts

* Fixed typo

* Fixed myriad build for macOS

* Fixed warning

* Fixed tests

* Disabled incorrect test

* Try to fix linux tests

* Revert "Try to fix linux tests"

This reverts commit 29224c93ff.

* Fixed tests

* Revert logic with incorrect cast

* Fixed log softmax

* Disable warning as error for cuda

* Try to fix inference_engine_s

* Fixed cmake

* Revert "Fixed cmake"

This reverts commit 87e9e4e674.

* Revert "Try to fix inference_engine_s"

This reverts commit a1adca8b05.

* WA for static symbols in inference_engine_s test library

* Fixed code style

* Fixed static definition for master

* Revert "Fixed static definition for master"

This reverts commit 20d00d215a.

* Revert "Fixed code style"

This reverts commit 0eb2362543.

* Revert "WA for static symbols in inference_engine_s test library"

This reverts commit 75ef86a79d.

* Fixed linker issue for Windows

* Disable WaE by default

* Disable warning as error in the developer package

* Try to fix dev package

* Try to fix Windows Jenkins

* Revert old behavior for tread_warn_as_err variable
This commit is contained in:
Ilya Churaev
2022-10-06 13:44:21 +04:00
committed by GitHub
parent 25f85a3beb
commit 8a9c19e3eb
285 changed files with 1125 additions and 876 deletions

View File

@@ -45,16 +45,16 @@ set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_PDB_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${IE_MAIN_SAMPLES_DIR}/${BIN_FOLDER})
if(TREAT_WARNING_AS_ERROR AND NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
endif()
if (WIN32)
set_property (DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") # no asynchronous structured exception handling
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
if (TREAT_WARNING_AS_ERROR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") # treating warnings as errors
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qdiag-disable:177")
endif()
@@ -64,11 +64,6 @@ if (WIN32)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4267 /wd4819")
endif()
else()
# treating warnings as errors
if(TREAT_WARNING_AS_ERROR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable:177")
endif()