Skip to content

Commit 5e4cd25

Browse files
committed
[C++] Remove serial dependency on jemalloc
1 parent 30c4e15 commit 5e4cd25

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

-2
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,6 @@ macro(build_jemalloc)
20742074
target_link_libraries(jemalloc::jemalloc INTERFACE Threads::Threads)
20752075
target_include_directories(jemalloc::jemalloc BEFORE
20762076
INTERFACE "${JEMALLOC_INCLUDE_DIR}")
2077-
add_dependencies(jemalloc::jemalloc jemalloc_ep)
20782077

20792078
list(APPEND ARROW_BUNDLED_STATIC_LIBS jemalloc::jemalloc)
20802079

@@ -2142,7 +2141,6 @@ if(ARROW_MIMALLOC)
21422141
if(WIN32)
21432142
target_link_libraries(mimalloc::mimalloc INTERFACE "bcrypt.lib" "psapi.lib")
21442143
endif()
2145-
add_dependencies(mimalloc::mimalloc mimalloc_ep)
21462144
add_dependencies(toolchain mimalloc_ep)
21472145

21482146
list(APPEND ARROW_BUNDLED_STATIC_LIBS mimalloc::mimalloc)

cpp/src/arrow/CMakeLists.txt

+8-14
Original file line numberDiff line numberDiff line change
@@ -351,31 +351,25 @@ set(ARROW_TESTING_SRCS
351351
testing/util.cc)
352352

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

358-
set(_allocator_dependencies "") # Empty list
359358
if(jemalloc_VENDORED)
360-
list(APPEND _allocator_dependencies jemalloc_ep)
359+
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
360+
set_source_files_properties(memory_pool_jemalloc.cc PROPERTIES OBJECT_DEPENDS jemalloc_ep)
361+
else()
362+
add_dependencies(arrow_dependencies jemalloc_ep)
363+
endif()
361364
endif()
362365
if(mimalloc_VENDORED)
363-
list(APPEND _allocator_dependencies mimalloc_ep)
364-
endif()
365-
366-
if(_allocator_dependencies)
367366
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
368-
set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS
369-
"${_allocator_dependencies}")
367+
set_source_files_properties(memory_pool.cc PROPERTIES OBJECT_DEPENDS mimalloc_ep)
370368
else()
371-
add_dependencies(arrow_dependencies ${_allocator_dependencies})
369+
add_dependencies(arrow_dependencies mimalloc_ep)
372370
endif()
373-
set_source_files_properties(memory_pool.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON
374-
SKIP_UNITY_BUILD_INCLUSION ON)
375371
endif()
376372

377-
unset(_allocator_dependencies)
378-
379373
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
380374
set_property(SOURCE util/io_util.cc
381375
APPEND_STRING

0 commit comments

Comments
 (0)