Repository: kudu
Updated Branches:
  refs/heads/master b3eb06a01 -> 1d9ce5625


KUDU-2560: exported thirdparty library variants should use exported deps

This addresses a longstanding bug in ADD_THIRDPARTY_LIB that caused
"exported" thirdparty library targets to express their own thirdparty
dependencies in terms of regular (i.e. non-exported) targets.

The first time this mattered was in commit d55df3c6e, where libunwind was
added as a dependency of glog. This caused the exported client library, by
virtue of its glog dependency, to depend on 'unwind' (shared object) instead
of on 'unwind_exported' (static archive). In most systems the linker elided
that dependency because it was unnecessary, but it is preserved by the
linker in devtoolset3. That causes client_examples-test to fail if the
system doesn't have libunwind installed.

While I was there I removed some usages of DEPS that were not actually used.

Change-Id: I28dd499b152d4eadd9b5cf6575650a1a3db163f1
Reviewed-on: http://gerrit.cloudera.org:8080/11354
Reviewed-by: Dan Burkert <danburk...@apache.org>
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Reviewed-by: Alexey Serbin <aser...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1d9ce562
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1d9ce562
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1d9ce562

Branch: refs/heads/master
Commit: 1d9ce56251bb41e21d58cb5b8904ba0aa35110be
Parents: b3eb06a
Author: Adar Dembo <a...@cloudera.com>
Authored: Wed Aug 29 15:14:35 2018 -0700
Committer: Alexey Serbin <aser...@cloudera.com>
Committed: Thu Aug 30 01:16:30 2018 +0000

----------------------------------------------------------------------
 CMakeLists.txt               | 16 ++++++++--------
 cmake_modules/FindPmem.cmake |  1 -
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/1d9ce562/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0cd6bc1..d7821e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -942,7 +942,7 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
   # A shared object exported variant will force any "leaf" library that
   # transitively depends on it to also depend on it at runtime; this is
   # desirable for some libraries (e.g. cyrus_sasl).
-  set(LIB_NAME_EXPORTED ${LIB_NAME}_exported)
+  set(LIB_NAME_EXPORTED "${LIB_NAME}_exported")
   if(ARG_STATIC_LIB)
     add_library(${LIB_NAME_EXPORTED} STATIC IMPORTED)
     set_target_properties(${LIB_NAME_EXPORTED}
@@ -953,8 +953,11 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
       PROPERTIES IMPORTED_LOCATION "${ARG_SHARED_LIB}")
   endif()
   if(ARG_DEPS)
+    foreach(DEP ${ARG_DEPS})
+      list(APPEND EXPORTED_DEPS "${DEP}_exported")
+    endforeach()
     set_target_properties(${LIB_NAME_EXPORTED}
-      PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${ARG_DEPS}")
+      PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${EXPORTED_DEPS}")
   endif()
 endfunction()
 
@@ -974,15 +977,13 @@ set(CMAKE_PREFIX_PATH
 find_package(CyrusSASL REQUIRED)
 include_directories(SYSTEM ${CYRUS_SASL_INCLUDE_DIR})
 ADD_THIRDPARTY_LIB(cyrus_sasl
-  SHARED_LIB "${CYRUS_SASL_SHARED_LIB}"
-  DEPS ${CYRUS_SASL_LIB_DEPS})
+  SHARED_LIB "${CYRUS_SASL_SHARED_LIB}")
 
 ## GSSAPI
 find_package(GSSAPI REQUIRED)
 include_directories(SYSTEM ${GSSAPI_INCLUDE_DIR})
 ADD_THIRDPARTY_LIB(gssapi_krb5
-  SHARED_LIB "${GSSAPI_SHARED_LIB}"
-  DEPS ${GSSAPI_LIB_DEPS})
+  SHARED_LIB "${GSSAPI_SHARED_LIB}")
 
 ## GLog (depends on libunwind)
 find_package(GLog REQUIRED)
@@ -1157,8 +1158,7 @@ ADD_THIRDPARTY_LIB(pmem
   SHARED_LIB "${PMEM_SHARED_LIB}")
 ADD_THIRDPARTY_LIB(pmemobj
   STATIC_LIB "${PMEMOBJ_STATIC_LIB}"
-  SHARED_LIB "${PMEMOBJ_SHARED_LIB}"
-  DEPS ${PMEMOBJ_DEPS})
+  SHARED_LIB "${PMEMOBJ_SHARED_LIB}")
 endif()
 
 if (EXISTS ${VMEM_SHARED_LIB})

http://git-wip-us.apache.org/repos/asf/kudu/blob/1d9ce562/cmake_modules/FindPmem.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindPmem.cmake b/cmake_modules/FindPmem.cmake
index 2270e65..a628e2f 100644
--- a/cmake_modules/FindPmem.cmake
+++ b/cmake_modules/FindPmem.cmake
@@ -21,7 +21,6 @@
 #  XXX_STATIC_LIBS, path to *.a
 #  XXX_SHARED_LIBS, path to *.so shared library
 #  PMEM_FOUND, whether PMEM libraries have been found
-#  PMEMOBJ_DEPS, dependencies required for using libpmemobj
 
 find_path(PMEM_INCLUDE_DIR libpmem.h
   NO_CMAKE_SYSTEM_PATH

Reply via email to