Don't use -Wl,--allow-shlib-undefined on macOS (#18683)

This commit is contained in:
Ilya Lavrenov authored and GitHub committed 2023-07-21 13:08:26 +04:00
1 parent e478964695
commit bbd592b530
1 file changed
+7 -5
+7 -5
View File
@@ -419,16 +419,18 @@ macro(_ov_find_onnx_frontend_dependencies)
endmacro()
function(_ov_target_no_deprecation_error)
if(NOT MSVC)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# older macOS x86_64 does not support this linker option
if(CMAKE_CROSSCOMPILING AND NOT APPLE)
set_target_properties(${ARGV} PROPERTIES
INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(flags "-diag-warning=1786")
else()
set(flags "-Wno-error=deprecated-declarations")
endif()
if(CMAKE_CROSSCOMPILING)
set_target_properties(${ARGV} PROPERTIES
INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined")
endif()
set_target_properties(${ARGV} PROPERTIES INTERFACE_COMPILE_OPTIONS ${flags})
endif()