Added link options for cross-compilation (#2399)
authorIlya Lavrenov <ilya.lavrenov@intel.com>
Mon, 28 Sep 2020 15:59:48 +0000 (18:59 +0300)
committerGitHub <noreply@github.com>
Mon, 28 Sep 2020 15:59:48 +0000 (18:59 +0300)
inference-engine/cmake/config.cmake.in
inference-engine/cmake/share/InferenceEngineConfig.cmake.in

index 42a32f9..3e7e9a8 100644 (file)
@@ -7,7 +7,7 @@ if(DEFINED IE_MAIN_SOURCE_DIR AND TARGET inference_engine)
                                   inference_engine_c_api)
 else()
     include("${CMAKE_CURRENT_LIST_DIR}/targets.cmake")
-    if(NOT WIN32)
+    if(NOT MSVC)
         set_target_properties(IE::inference_engine PROPERTIES INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
     endif()
 
@@ -31,4 +31,11 @@ else()
     get_target_property(InferenceEngine_INCLUDE_DIRS IE::inference_engine INTERFACE_INCLUDE_DIRECTORIES)
     set(InferenceEngine_LIBRARIES IE::inference_engine_legacy IE::inference_engine
                                   IE::inference_engine_c_api)
+
+    foreach(library IN LISTS InferenceEngine_LIBRARIES)
+        if(CMAKE_CROSSCOMPILING AND NOT MSVC)
+            set_property(TARGET ${library} PROPERTY
+                         INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined")
+        endif()
+    endforeach()
 endif()
index 83d6900..327da89 100644 (file)
@@ -154,6 +154,10 @@ else()
                 else()
                     set_target_properties(IE::inference_engine${ie_library_suffix} PROPERTIES
                             INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
+                    if(CMAKE_CROSSCOMPILING AND NOT MSVC)
+                        set_property(TARGET IE::inference_engine${ie_library_suffix} PROPERTY
+                                     INTERFACE_LINK_OPTIONS "-Wl,--allow-shlib-undefined")
+                    endif()
                 endif()
             endif()
         endforeach()