Removed public dependency on CMAKE_DL_LIB (#1633)
authorIlya Lavrenov <ilya.lavrenov@intel.com>
Wed, 5 Aug 2020 03:11:13 +0000 (06:11 +0300)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 03:11:13 +0000 (06:11 +0300)
inference-engine/cmake/share/InferenceEngineConfig.cmake.in
inference-engine/src/inference_engine/CMakeLists.txt
inference-engine/tests_deprecated/unit/CMakeLists.txt

index d3fc9f8..83d6900 100644 (file)
@@ -143,8 +143,6 @@ else()
                 else()
                     ext_message(WARNING "Inference Engine DEBUG binaries are missed")
                 endif()
-
-                target_link_libraries(IE::inference_engine${ie_library_suffix} INTERFACE ${CMAKE_DL_LIBS})
             else()
                 # Only Release binaries are distributed for Linux systems
                 set_target_properties(IE::inference_engine${ie_library_suffix} PROPERTIES
@@ -157,7 +155,6 @@ else()
                     set_target_properties(IE::inference_engine${ie_library_suffix} PROPERTIES
                             INTERFACE_COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
                 endif()
-                target_link_libraries(IE::inference_engine${ie_library_suffix} INTERFACE ${CMAKE_DL_LIBS})
             endif()
         endforeach()
 
index b7fb394..0a06b09 100644 (file)
@@ -159,7 +159,7 @@ set_ie_threading_interface_for(${TARGET_NAME})
 
 target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads pugixml openvino::itt
                                              ${NGRAPH_LIBRARIES} inference_engine_transformations
-                                     PUBLIC ${CMAKE_DL_LIBS} ${TARGET_NAME}_legacy)
+                                     PUBLIC ${TARGET_NAME}_legacy)
 
 target_include_directories(${TARGET_NAME} INTERFACE ${PUBLIC_HEADERS_DIR} PRIVATE
                                                 $<TARGET_PROPERTY:${TARGET_NAME}_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
@@ -191,10 +191,9 @@ if(WIN32)
     set_target_properties(${TARGET_NAME}_s PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}_s)
 endif()
 
-target_link_libraries(${TARGET_NAME}_s PRIVATE ${NGRAPH_LIBRARIES} inference_engine_transformations openvino::itt
-# NOTE: public linkage with ITT is important here! without it binaries that use this library do not
-#       get proper compile flags to support ITT which causes hard-to-detect bugs.
-                                       PUBLIC pugixml ${CMAKE_DL_LIBS})
+target_link_libraries(${TARGET_NAME}_s PRIVATE ${CMAKE_DL_LIBS} ${NGRAPH_LIBRARIES}
+                                               inference_engine_transformations openvino::itt
+                                       PUBLIC pugixml)
 
 target_compile_definitions(${TARGET_NAME}_s PUBLIC USE_STATIC_IE)
 
index 1343578..0c7a6c3 100644 (file)
@@ -142,8 +142,7 @@ target_link_libraries(${TARGET_NAME} PRIVATE
     # dynamic libraries
     inference_engine_lp_transformations
     inference_engine_transformations
-    inference_engine_ir_v7_reader
-    ${CMAKE_DL_LIBS})
+    inference_engine_ir_v7_reader)
 
 if(TARGET libGNAStubs)
     target_link_libraries(${TARGET_NAME} PRIVATE libGNAStubs)