Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created February 12, 2018 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/c662f12d3ed92584ffc0c5479742160d to your computer and use it in GitHub Desktop.
Save jsierles/c662f12d3ed92584ffc0c5479742160d to your computer and use it in GitHub Desktop.
Fix a build bug that would cause the linker to try linking against
'arrow_static' even when building with -DARROW_BUILD_STATIC=off:
https://issues.apache.org/jira/browse/ARROW-1308
Patch copied from upstream pull request:
https://github.com/apache/arrow/pull/931/commits/88391fe0685742cff489d0bf1a5b1a09b8d73b3b
From 88391fe0685742cff489d0bf1a5b1a09b8d73b3b Mon Sep 17 00:00:00 2001
From: Wes McKinney <wes.mckinney@twosigma.com>
Date: Tue, 1 Aug 2017 16:08:49 -0400
Subject: [PATCH] Link utility executables to Arrow shared library if
ARROW_BUILD_STATIC=off
Change-Id: If418c42ea18aac30eae8482bba7e401c5d8258d1
---
cpp/src/arrow/ipc/CMakeLists.txt | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt
index 9cc61bced..76e52a0f7 100644
--- a/cpp/src/arrow/ipc/CMakeLists.txt
+++ b/cpp/src/arrow/ipc/CMakeLists.txt
@@ -90,18 +90,22 @@ install(FILES
writer.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/ipc")
-if(MSVC)
- set(UTIL_LINK_LIBS
- arrow_static
- ${BOOST_FILESYSTEM_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY})
+if (ARROW_BUILD_STATIC)
+ set(ARROW_UTIL_LIB arrow_static)
else()
+ set(ARROW_UTIL_LIB arrow_shared)
+endif()
+
+set(UTIL_LINK_LIBS
+ ${ARROW_UTIL_LIB}
+ ${BOOST_FILESYSTEM_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY})
+
+if(NOT MSVC)
set(UTIL_LINK_LIBS
- arrow_static
+ ${UTIL_LINK_LIBS}
pthread
- ${BOOST_FILESYSTEM_LIBRARY}
- ${BOOST_SYSTEM_LIBRARY}
- dl)
+ ${CMAKE_DL_LIBS})
endif()
if (ARROW_BUILD_UTILITIES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment