From 343c698c20f1052f4dd6807d4dbbe3beaa1511eb Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sat, 18 May 2024 08:37:27 +0200 Subject: [PATCH] build: link everything against jemalloc when jemalloc is enabled --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0897cc71..4da961a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1044,6 +1044,10 @@ foreach(tgt dwarfs_common dwarfs_writer dwarfs_extractor target_link_libraries(${tgt} Boost::boost dwarfs_folly_lite dwarfs_thrift_lite) + if(USE_JEMALLOC) + target_link_libraries(${tgt} PkgConfig::JEMALLOC) + endif(USE_JEMALLOC) + target_include_directories(${tgt} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_compile_definitions( @@ -1195,9 +1199,6 @@ endif() foreach(tgt ${MAIN_TARGETS} ${BINARY_TARGETS} ${TEST_TARGETS}) target_link_libraries(${tgt} dwarfs_tool) - if(USE_JEMALLOC) - target_link_libraries(${tgt} PkgConfig::JEMALLOC) - endif(USE_JEMALLOC) endforeach() foreach(tgt ${BINARY_TARGETS} ${TEST_TARGETS})