You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/09/18 13:58:12 UTC

[arrow] branch master updated: ARROW-3257: [C++] Stop to use IMPORTED_LINK_INTERFACE_LIBRARIES

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new c49cccc  ARROW-3257: [C++] Stop to use IMPORTED_LINK_INTERFACE_LIBRARIES
c49cccc is described below

commit c49cccc8598432c0bfba5ea4ac0688fb9ee876da
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Tue Sep 18 09:57:54 2018 -0400

    ARROW-3257: [C++] Stop to use IMPORTED_LINK_INTERFACE_LIBRARIES
    
    Because it's deprecated in CMake 3.2 that is the minimum required
    version:
    
    https://cmake.org/cmake/help/v3.2/prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES.html
    
    The document says that we should use INTERFACE_LINK_LIBRARIES:
    
    https://cmake.org/cmake/help/v3.2/prop_tgt/INTERFACE_LINK_LIBRARIES.html
    
    Author: Kouhei Sutou <ko...@clear-code.com>
    
    Closes #2579 from kou/cpp-use-interface-link-libraries and squashes the following commits:
    
    1eebf7d7b <Kouhei Sutou>  Stop to use IMPORTED_LINK_INTERFACE_LIBRARIES
---
 cpp/CMakeLists.txt                          |  3 ---
 cpp/cmake_modules/BuildUtils.cmake          | 14 +++++++++++---
 cpp/cmake_modules/ThirdpartyToolchain.cmake |  5 +++--
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 0cb52cb..c6d5da2 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -640,9 +640,6 @@ if (ARROW_ORC)
   SET(ARROW_STATIC_LINK_LIBS
     ${ARROW_STATIC_LINK_LIBS}
     orc)
-  set_target_properties(orc
-    PROPERTIES INTERFACE_LINK_LIBRARIES
-    protobuf)
 endif()
 
 if (ARROW_STATIC_LINK_LIBS)
diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake
index af814e4..3a77a46 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -33,6 +33,10 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
     add_library(${AUG_LIB_NAME} STATIC IMPORTED)
     set_target_properties(${AUG_LIB_NAME}
       PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}")
+    if(ARG_DEPS)
+      set_target_properties(${AUG_LIB_NAME}
+        PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
+    endif()
     message("Added static library dependency ${LIB_NAME}: ${ARG_STATIC_LIB}")
 
     SET(AUG_LIB_NAME "${LIB_NAME}_shared")
@@ -48,7 +52,7 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
     endif()
     if(ARG_DEPS)
       set_target_properties(${AUG_LIB_NAME}
-        PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}")
+        PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
     endif()
     message("Added shared library dependency ${LIB_NAME}: ${ARG_SHARED_LIB}")
   elseif(ARG_STATIC_LIB)
@@ -61,8 +65,10 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
       PROPERTIES IMPORTED_LOCATION "${ARG_STATIC_LIB}")
     if(ARG_DEPS)
       set_target_properties(${AUG_LIB_NAME}
-        PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}")
+        PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
     endif()
+    set_target_properties(${LIB_NAME}
+      PROPERTIES INTERFACE_LINK_LIBRARIES "${AUG_LIB_NAME}")
     message("Added static library dependency ${LIB_NAME}: ${ARG_STATIC_LIB}")
   elseif(ARG_SHARED_LIB)
     add_library(${LIB_NAME} SHARED IMPORTED)
@@ -84,8 +90,10 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
     message("Added shared library dependency ${LIB_NAME}: ${ARG_SHARED_LIB}")
     if(ARG_DEPS)
       set_target_properties(${AUG_LIB_NAME}
-        PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}")
+        PROPERTIES INTERFACE_LINK_LIBRARIES "${ARG_DEPS}")
     endif()
+    set_target_properties(${LIB_NAME}
+      PROPERTIES INTERFACE_LINK_LIBRARIES "${AUG_LIB_NAME}")
   else()
     message(FATAL_ERROR "No static or shared library provided for ${LIB_NAME}")
   endif()
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 0bd91f8..19339216 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -516,7 +516,7 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
   if(MSVC)
     set_target_properties(gflags
       PROPERTIES
-      IMPORTED_LINK_INTERFACE_LIBRARIES "shlwapi.lib")
+      INTERFACE_LINK_LIBRARIES "shlwapi.lib")
   endif()
 
   if(GFLAGS_VENDORED)
@@ -1137,7 +1137,8 @@ if (ARROW_ORC)
 
   include_directories(SYSTEM ${ORC_INCLUDE_DIR})
   ADD_THIRDPARTY_LIB(orc
-    STATIC_LIB ${ORC_STATIC_LIB})
+    STATIC_LIB ${ORC_STATIC_LIB}
+    DEPS protobuf)
 
   if (ORC_VENDORED)
     add_dependencies(orc orc_ep)