From eb529653b4fe8bd2e852290e1a4b83f58fdf5a4f Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Wed, 4 Sep 2019 18:25:12 -0500 Subject: [PATCH 1/3] Add jemalloc_ep dependency only on memory_pool.cc --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 1 - cpp/src/arrow/CMakeLists.txt | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 611402315eb..ac8ac2fb353 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1406,7 +1406,6 @@ if(ARROW_JEMALLOC) INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/jemalloc_ep-prefix/src") add_dependencies(jemalloc::jemalloc jemalloc_ep) - add_dependencies(toolchain jemalloc_ep) endif() # ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index f3b9a37c3a6..00d8dc23fcf 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -145,6 +145,11 @@ set(ARROW_SRCS util/utf8.cc vendored/datetime/tz.cpp) +if(ARROW_JEMALLOC) + set_source_files_properties(memory_pool.cc + PROPERTIES OBJECT_DEPENDS jemalloc_ep) +endif() + if(ARROW_JSON) add_subdirectory(json) set(ARROW_SRCS @@ -205,10 +210,6 @@ if(ARROW_CUDA) add_subdirectory(gpu) endif() -if(ARROW_JEMALLOC AND JEMALLOC_VENDORED) - add_dependencies(arrow_dependencies jemalloc::jemalloc) -endif() - if(ARROW_WITH_BROTLI) add_definitions(-DARROW_WITH_BROTLI) set(ARROW_SRCS util/compression_brotli.cc ${ARROW_SRCS}) From c93f311eaa7a48f5d8ce54cd7857fd1067fc4dda Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Wed, 4 Sep 2019 18:25:32 -0500 Subject: [PATCH 2/3] cmake-format --- cpp/src/arrow/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 00d8dc23fcf..392efe9580c 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -146,8 +146,7 @@ set(ARROW_SRCS vendored/datetime/tz.cpp) if(ARROW_JEMALLOC) - set_source_files_properties(memory_pool.cc - PROPERTIES OBJECT_DEPENDS jemalloc_ep) + set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep) endif() if(ARROW_JSON) From 7e46ff4e18ac8d7fe3de960a7aae7d1ad77e2ca2 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Wed, 4 Sep 2019 21:35:51 -0500 Subject: [PATCH 3/3] Only use OBJECT_DEPENDS with Ninja build generator --- cpp/src/arrow/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index 392efe9580c..1c613a09db3 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -146,7 +146,11 @@ set(ARROW_SRCS vendored/datetime/tz.cpp) if(ARROW_JEMALLOC) - set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep) + if("${CMAKE_GENERATOR}" STREQUAL "Ninja") + set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep) + else() + add_dependencies(arrow_dependencies jemalloc_ep) + endif() endif() if(ARROW_JSON)