hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject hadoop git commit: HDFS-9408. Build both static and dynamic libraries for libhdfspp. Contributed by Stephen Walkauskas.
Date Mon, 16 Nov 2015 18:10:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-8707 8fdbbae04 -> 825571a0e


HDFS-9408. Build both static and dynamic libraries for libhdfspp. Contributed by Stephen Walkauskas.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/825571a0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/825571a0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/825571a0

Branch: refs/heads/HDFS-8707
Commit: 825571a0e77712a5eca0b6db09020c87ad6e27e1
Parents: 8fdbbae
Author: Haohui Mai <wheat9@apache.org>
Authored: Mon Nov 16 10:09:16 2015 -0800
Committer: Haohui Mai <wheat9@apache.org>
Committed: Mon Nov 16 10:09:16 2015 -0800

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/CMakeLists.txt    | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/825571a0/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt
index c544b4d..18e4cb0 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/CMakeLists.txt
@@ -61,3 +61,26 @@ set(PROTO_HADOOP_TEST_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../../../../hadoop-com
 add_subdirectory(third_party/gmock-1.7.0)
 add_subdirectory(lib)
 add_subdirectory(tests)
+
+# create an empty file; hadoop_add_dual_library wraps add_library which
+# requires at least one file as an argument
+set(EMPTY_FILE_CC ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/empty.cc)
+file(WRITE ${EMPTY_FILE_CC} "")
+
+hadoop_add_dual_library(hdfspp ${EMPTY_FILE_CC})
+if(NEED_LINK_DL)
+   set(LIB_DL dl)
+endif()
+
+SET(LIBHDFSPP_SUBLIBS bindings_c fs rpc reader proto common)
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  # linking a shared library from static ones requires --whole-archive
+  SET(LIBHDFSPP_SUBLIBS -Wl,--whole-archive ${LIBHDFSPP_SUBLIBS} -Wl,--no-whole-archive)
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+
+hadoop_target_link_dual_libraries(hdfspp
+    ${LIBHDFSPP_SUBLIBS}
+    ${LIB_DL}
+    ${PROTOBUF_LIBRARY}
+    ${OPENSSL_LIBRARIES}
+)


Mime
View raw message