Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ACEAA200C4A for ; Sun, 2 Apr 2017 10:04:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AB65C160B8E; Sun, 2 Apr 2017 08:04:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CD567160B77 for ; Sun, 2 Apr 2017 10:04:20 +0200 (CEST) Received: (qmail 82293 invoked by uid 500); 2 Apr 2017 08:04:20 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 82284 invoked by uid 99); 2 Apr 2017 08:04:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Apr 2017 08:04:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DE16EDFE34; Sun, 2 Apr 2017 08:04:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: uwe@apache.org To: commits@arrow.apache.org Message-Id: <28e210e6186d4e7b83f2af9c50a6e95d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: arrow git commit: ARROW-747: [C++] Calling add_dependencies with dl causes spurious CMake warning Date: Sun, 2 Apr 2017 08:04:19 +0000 (UTC) archived-at: Sun, 02 Apr 2017 08:04:21 -0000 Repository: arrow Updated Branches: refs/heads/master 651ea9247 -> baf38e47a ARROW-747: [C++] Calling add_dependencies with dl causes spurious CMake warning I added an option to make the dependency targets (e.g. external projects) in libraries more explicit. Author: Wes McKinney Closes #472 from wesm/ARROW-747 and squashes the following commits: c60832f [Wes McKinney] Add DEPENDENCIES argument to ADD_ARROW_LIB to fix spurious dl dependency issue Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/baf38e47 Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/baf38e47 Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/baf38e47 Branch: refs/heads/master Commit: baf38e47a7d73d87017699304dcbe15f297c9284 Parents: 651ea92 Author: Wes McKinney Authored: Sun Apr 2 10:04:11 2017 +0200 Committer: Uwe L. Korn Committed: Sun Apr 2 10:04:11 2017 +0200 ---------------------------------------------------------------------- cpp/CMakeLists.txt | 9 +--- cpp/cmake_modules/BuildUtils.cmake | 18 ++------ cpp/src/arrow/io/CMakeLists.txt | 4 +- cpp/src/arrow/ipc/CMakeLists.txt | 74 +++++++++++++----------------- cpp/src/arrow/jemalloc/CMakeLists.txt | 5 ++ 5 files changed, 46 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/baf38e47/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7a5a0e6..aacc7a1 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -654,13 +654,8 @@ if (ARROW_JEMALLOC) include_directories(SYSTEM ${JEMALLOC_INCLUDE_DIR}) ADD_THIRDPARTY_LIB(jemalloc - STATIC_LIB ${JEMALLOC_STATIC_LIB} - SHARED_LIB ${JEMALLOC_SHARED_LIB}) - - if (JEMALLOC_VENDORED) - add_dependencies(jemalloc_shared jemalloc_ep) - add_dependencies(jemalloc_static jemalloc_ep) - endif() + STATIC_LIB ${JEMALLOC_STATIC_LIB} + SHARED_LIB ${JEMALLOC_SHARED_LIB}) endif() ## Google PerfTools http://git-wip-us.apache.org/repos/asf/arrow/blob/baf38e47/cpp/cmake_modules/BuildUtils.cmake ---------------------------------------------------------------------- diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake index 43d9840..3a3b536 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake @@ -85,26 +85,18 @@ endfunction() function(ADD_ARROW_LIB LIB_NAME) set(options) set(one_value_args SHARED_LINK_FLAGS) - set(multi_value_args SOURCES STATIC_LINK_LIBS STATIC_PRIVATE_LINK_LIBS SHARED_LINK_LIBS SHARED_PRIVATE_LINK_LIBS) + set(multi_value_args SOURCES STATIC_LINK_LIBS STATIC_PRIVATE_LINK_LIBS SHARED_LINK_LIBS SHARED_PRIVATE_LINK_LIBS DEPENDENCIES) cmake_parse_arguments(ARG "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) if(ARG_UNPARSED_ARGUMENTS) message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}") endif() add_library(${LIB_NAME}_objlib OBJECT - ${ARG_SOURCES} + ${ARG_SOURCES} ) - if (ARG_STATIC_LINK_LIBS) - add_dependencies(${LIB_NAME}_objlib ${ARG_STATIC_LINK_LIBS}) - endif() - if (ARG_STATIC_PRIVATE_LINK_LIBS) - add_dependencies(${LIB_NAME}_objlib ${ARG_STATIC_PRIVATE_LINK_LIBS}) - endif() - if (ARG_SHARED_LINK_LIBS) - add_dependencies(${LIB_NAME}_objlib ${ARG_SHARED_LINK_LIBS}) - endif() - if(ARG_SHARED_PRIVATE_LINK_LIBS) - add_dependencies(${LIB_NAME}_objlib ${ARG_SHARED_PRIVATE_LINK_LIBS}) + + if (ARG_DEPENDENCIES) + add_dependencies(${LIB_NAME}_objlib ${ARG_DEPENDENCIES}) endif() # Necessary to make static linking into other shared libraries work properly http://git-wip-us.apache.org/repos/asf/arrow/blob/baf38e47/cpp/src/arrow/io/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/io/CMakeLists.txt b/cpp/src/arrow/io/CMakeLists.txt index 8aabf64..3951eac 100644 --- a/cpp/src/arrow/io/CMakeLists.txt +++ b/cpp/src/arrow/io/CMakeLists.txt @@ -48,11 +48,11 @@ if (MSVC) else() set(ARROW_IO_STATIC_LINK_LIBS arrow_static - dl + ${CMAKE_DL_LIBS} ) set(ARROW_IO_SHARED_LINK_LIBS arrow_shared - dl + ${CMAKE_DL_LIBS} ) endif() http://git-wip-us.apache.org/repos/asf/arrow/blob/baf38e47/cpp/src/arrow/ipc/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/ipc/CMakeLists.txt b/cpp/src/arrow/ipc/CMakeLists.txt index 31a04df..5fa7d61 100644 --- a/cpp/src/arrow/ipc/CMakeLists.txt +++ b/cpp/src/arrow/ipc/CMakeLists.txt @@ -26,7 +26,8 @@ set(ARROW_IPC_SHARED_LINK_LIBS set(ARROW_IPC_TEST_LINK_LIBS arrow_ipc_static - arrow_io_static) + arrow_io_static + arrow_static) set(ARROW_IPC_SRCS feather.cc @@ -44,20 +45,22 @@ if(NOT APPLE) set(ARROW_IPC_LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/symbols.map") endif() -ADD_ARROW_LIB(arrow_ipc - SOURCES ${ARROW_IPC_SRCS} - SHARED_LINK_FLAGS ${ARROW_IPC_LINK_FLAGS} - SHARED_LINK_LIBS ${ARROW_IPC_SHARED_LINK_LIBS} - STATIC_LINK_LIBS ${ARROW_IO_SHARED_PRIVATE_LINK_LIBS} -) - if(RAPIDJSON_VENDORED) - add_dependencies(arrow_ipc_objlib rapidjson_ep) + set(IPC_DEPENDENCIES ${IPC_DEPENDENCIES} rapidjson_ep) endif() + if(FLATBUFFERS_VENDORED) - add_dependencies(arrow_ipc_objlib flatbuffers_ep) + set(IPC_DEPENDENCIES ${IPC_DEPENDENCIES} flatbuffers_ep) endif() +ADD_ARROW_LIB(arrow_ipc + SOURCES ${ARROW_IPC_SRCS} + DEPENDENCIES ${IPC_DEPENDENCIES} + SHARED_LINK_FLAGS ${ARROW_IPC_LINK_FLAGS} + SHARED_LINK_LIBS ${ARROW_IPC_SHARED_LINK_LIBS} + STATIC_LINK_LIBS ${ARROW_IO_SHARED_PRIVATE_LINK_LIBS} +) + ADD_ARROW_TEST(feather-test) ARROW_TEST_LINK_LIBRARIES(feather-test ${ARROW_IPC_TEST_LINK_LIBS}) @@ -71,40 +74,27 @@ ARROW_TEST_LINK_LIBRARIES(ipc-json-test ${ARROW_IPC_TEST_LINK_LIBS}) ADD_ARROW_TEST(json-integration-test) +ARROW_TEST_LINK_LIBRARIES(json-integration-test + ${ARROW_IPC_TEST_LINK_LIBS}) if (ARROW_BUILD_TESTS) - if (APPLE) - target_link_libraries(json-integration-test - arrow_ipc_static - arrow_io_static - arrow_static - gflags - gtest - ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - dl) - set_target_properties(json-integration-test - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - elseif (MSVC) - target_link_libraries(json-integration-test - arrow_ipc_static - arrow_io_static - arrow_static - gflags - gtest - ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SYSTEM_LIBRARY}) - else() - target_link_libraries(json-integration-test - arrow_ipc_static - arrow_io_static - arrow_static - gflags - gtest - pthread - ${BOOST_FILESYSTEM_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} - dl) + target_link_libraries(json-integration-test + gflags + gtest + ${BOOST_FILESYSTEM_LIBRARY} + ${BOOST_SYSTEM_LIBRARY}) + + if (UNIX) + if (APPLE) + target_link_libraries(json-integration-test + ${CMAKE_DL_LIBS}) + set_target_properties(json-integration-test + PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + else() + target_link_libraries(json-integration-test + pthread + ${CMAKE_DL_LIBS}) + endif() endif() endif() http://git-wip-us.apache.org/repos/asf/arrow/blob/baf38e47/cpp/src/arrow/jemalloc/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/jemalloc/CMakeLists.txt b/cpp/src/arrow/jemalloc/CMakeLists.txt index b8e6e23..7b627ac 100644 --- a/cpp/src/arrow/jemalloc/CMakeLists.txt +++ b/cpp/src/arrow/jemalloc/CMakeLists.txt @@ -84,8 +84,13 @@ if(NOT APPLE) set(ARROW_JEMALLOC_LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/symbols.map") endif() +if (JEMALLOC_VENDORED) + set(JEMALLOC_DEPENDENCIES jemalloc_ep) +endif() + ADD_ARROW_LIB(arrow_jemalloc SOURCES ${ARROW_JEMALLOC_SRCS} + DEPENDENCIES ${JEMALLOC_DEPENDENCIES} SHARED_LINK_FLAGS ${ARROW_JEMALLOC_LINK_FLAGS} SHARED_LINK_LIBS ${ARROW_JEMALLOC_SHARED_LINK_LIBS} SHARED_PRIVATE_LINK_LIBS ${ARROW_JEMALLOC_SHARED_PRIVATE_LINK_LIBS}