Repository: arrow
Updated Branches:
  refs/heads/master 0637e05d5 -> 8378c48df


ARROW-589: C++: Use system provided shared jemalloc if static is unavailable

Author: Uwe L. Korn <[email protected]>

Closes #355 from xhochy/ARROW-589 and squashes the following commits:

a9d88bc [Uwe L. Korn] ARROW-589: C++: Use system provided shared jemalloc if 
static is unavailable


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/8378c48d
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/8378c48d
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/8378c48d

Branch: refs/heads/master
Commit: 8378c48df53bfdcf0c834aaf3b8b737f74eb212c
Parents: 0637e05
Author: Uwe L. Korn <[email protected]>
Authored: Fri Mar 3 09:51:57 2017 -0500
Committer: Wes McKinney <[email protected]>
Committed: Fri Mar 3 09:51:57 2017 -0500

----------------------------------------------------------------------
 cpp/src/arrow/jemalloc/CMakeLists.txt | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/8378c48d/cpp/src/arrow/jemalloc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/jemalloc/CMakeLists.txt 
b/cpp/src/arrow/jemalloc/CMakeLists.txt
index c0f90eb..7caa74a 100644
--- a/cpp/src/arrow/jemalloc/CMakeLists.txt
+++ b/cpp/src/arrow/jemalloc/CMakeLists.txt
@@ -20,11 +20,21 @@
 
 include_directories(SYSTEM "{JEMALLOC_INCLUDE_DIR}")
 
-# arrow_jemalloc library
-set(ARROW_JEMALLOC_STATIC_LINK_LIBS
-  arrow_static
-  jemalloc_static
-)
+# In the case that jemalloc is only available as a shared library also use it 
to
+# link it in the static requirements. In contrast to other libraries we try in
+# most cases to use the system provided version of jemalloc to better align 
with
+# other potential users of jemalloc.
+if (JEMALLOC_STATIC_LIB)
+  set(ARROW_JEMALLOC_STATIC_LINK_LIBS
+    arrow_static
+    jemalloc_static
+  )
+else()
+  set(ARROW_JEMALLOC_STATIC_LINK_LIBS
+    arrow_static
+    jemalloc_shared
+  )
+endif()
 
 if (NOT APPLE)
   set(ARROW_JEMALLOC_STATIC_LINK_LIBS ${ARROW_JEMALLOC_STATIC_LINK_LIBS} 
pthread)

Reply via email to