From a88f11131f1cbc3830ba4b8d85b663a5591362de Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Tue, 19 Nov 2019 14:50:21 +0300 Subject: [PATCH] [generator] Use tcmalloc for efficient multithreading processing --- CMakeLists.txt | 11 +++++++++++ generator/generator_tool/CMakeLists.txt | 1 + 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6549e2d..5f6fb75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,17 @@ if (NOT SKIP_TESTS) configure_gtest() endif() + +# TCMalloc Linking +add_library(tcmalloc_config INTERFACE) + +option(USE_TCMALLOC "Link TCMalloc memory allocator" ON) +if (USE_TCMALLOC) + find_package(tcmalloc) + target_link_libraries(tcmalloc_config INTERFACE tcmalloc) +endif() + + # Code Coverage Configuration add_library(coverage_config INTERFACE) diff --git a/generator/generator_tool/CMakeLists.txt b/generator/generator_tool/CMakeLists.txt index 4a6eeaf..0f74bea 100644 --- a/generator/generator_tool/CMakeLists.txt +++ b/generator/generator_tool/CMakeLists.txt @@ -9,4 +9,5 @@ geocore_link_libraries( geocoder ${Boost_PROGRAM_OPTIONS_LIBRARY} ${CMAKE_DL_LIBS} + tcmalloc_config )