openvino/cmake/templates
Gladilov, Gleb 64b2593d06
Enable TREAT_DEPRECATED_DECLARATIONS_AS_ERRORS (#24195)
_ov_target_no_deprecation_error function extends
INTERFACE_COMPILE_OPTIONS of such targets as openvino::runtime with
-Wno-error=deprecated-declarations. It makes any target that links
against openvino::runtime (directly or through public interface of
target that linked directly to openvino::runtime) to compile with this
option. The fact that interface options are added to the end of the list
makes it impossible to override them for target-user of
openvino::runtime.

-Wno-error=deprecated-declarations doesn't disable the warning in
contrast to -Wno-deprecated-declarations, but merely enforces to treat
it as warning, not error. It means if a target tries to keep build log
clean (without warning messages) and uses things like -Werror for this
and links against openvino::runtime in any way, then it still will have
warning messages emitted.

To allow user-targets that linked against openvino::runtime to enforce
treatment of warnings as errors including deprecated-declarations
INTERFACE_COMPILE_OPTIONS is extended with generator expression instead,
so that user-target can set property
TREAT_DEPRECATED_DECLARATIONS_AS_ERRORS and get
-Wno-error=deprecated-declarations coming from OpenVINO removed from the
list of compile options.

If TREAT_DEPRECATED_DECLARATIONS_AS_ERRORS isn't set, the behavior is
unchanged and -Wno-error=deprecated-declarations is presented in
INTERFACE_COMPILE_OPTIONS.

Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
2024-04-26 14:47:04 +00:00
..
OpenVINOConfig-version.cmake.in copyright year update (#23370) 2024-03-14 09:37:02 +00:00
OpenVINOConfig.cmake.in Enable TREAT_DEPRECATED_DECLARATIONS_AS_ERRORS (#24195) 2024-04-26 14:47:04 +00:00
OpenVINODeveloperPackageConfig.cmake.in copyright year update (#23370) 2024-03-14 09:37:02 +00:00
OpenVINODeveloperPackageConfigRelocatable.cmake.in copyright year update (#23370) 2024-03-14 09:37:02 +00:00
openvino.pc.in copyright year update (#23370) 2024-03-14 09:37:02 +00:00