Removed /Zi from gtest (#22866)

### Details:
- There is no need to keep `/Zi` at all, because OV will propagate all
its flags to gtest
This commit is contained in:
Ilya Lavrenov 2024-02-15 20:47:58 +04:00 committed by GitHub
parent 3d2c15ffd9
commit c8a54349ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 10 deletions

View File

@ -39,18 +39,13 @@ _ov_gtest_filter_install_interface(gmock gmock)
_ov_gtest_filter_install_interface(gmock_main gmock)
foreach(target gtest gtest_main gmock gmock_main)
# If we have specified /Z7 option, remove -Zi option which comes from gtest
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
get_target_property(_target_cxx_flags ${target} COMPILE_OPTIONS)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
get_target_property(_target_cxx_flags ${target} COMPILE_FLAGS)
if(_target_cxx_flags)
if(CMAKE_CXX_FLAGS_DEBUG MATCHES ".+/Z7.+" OR CMAKE_CXX_FLAGS_RELWITHDEBINFO MATCHES ".+/Z7.+")
string(REPLACE "-Zi" " " _target_cxx_flags ${_target_cxx_flags})
message(STATUS "Removing -Zi flag from target " ${target})
set_target_properties(${target} PROPERTIES COMPILE_OPTIONS "${_target_cxx_flags}")
endif()
string(REPLACE "-Zi" " " _target_cxx_flags ${_target_cxx_flags})
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${_target_cxx_flags}")
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
target_compile_options(${target} PRIVATE -Wno-undef)
if(CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(${target} PRIVATE -Wno-deprecated-copy)