Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Remove serial dependency on jemalloc #39559

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,6 @@ macro(build_jemalloc)
target_link_libraries(jemalloc::jemalloc INTERFACE Threads::Threads)
target_include_directories(jemalloc::jemalloc BEFORE
INTERFACE "${JEMALLOC_INCLUDE_DIR}")
add_dependencies(jemalloc::jemalloc jemalloc_ep)

list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc)

Expand Down Expand Up @@ -2142,7 +2141,6 @@ if(ARROW_MIMALLOC)
if(WIN32)
target_link_libraries(mimalloc::mimalloc INTERFACE "bcrypt.lib" "psapi.lib")
endif()
add_dependencies(mimalloc::mimalloc mimalloc_ep)
add_dependencies(toolchain mimalloc_ep)

list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc)
Expand Down
22 changes: 8 additions & 14 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,31 +351,25 @@ set(ARROW_TESTING_SRCS
testing/util.cc)

# Add dependencies for third-party allocators.
# If possible we only want memory_pool.cc to wait for allocators to finish building,
# If possible we only want memory_pool{_jemalloc}.cc to wait for allocators to finish building,
# but that only works with Ninja
# (see https://gitlab.kitware.com/cmake/cmake/issues/19677)

set(_allocator_dependencies "") # Empty list
if(jemalloc_VENDORED)
list(APPEND _allocator_dependencies jemalloc_ep)
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set_source_files_properties(memory_pool_jemalloc.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep)
else()
add_dependencies(arrow_dependencies jemalloc_ep)
endif()
endif()
if(mimalloc_VENDORED)
list(APPEND _allocator_dependencies mimalloc_ep)
endif()

if(_allocator_dependencies)
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS
"${_allocator_dependencies}")
set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS mimalloc_ep)
else()
add_dependencies(arrow_dependencies ${_allocator_dependencies})
add_dependencies(arrow_dependencies mimalloc_ep)
endif()
set_source_files_properties(memory_pool.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON
SKIP_UNITY_BUILD_INCLUSION ON)
endif()

unset(_allocator_dependencies)

if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_property(SOURCE util/io_util.cc
APPEND_STRING
Expand Down
Loading