From 1dd81c04f33436dbf823dfc764c727a06023ba75 Mon Sep 17 00:00:00 2001 From: Mike Ellery Date: Tue, 5 Mar 2019 16:34:27 -0800 Subject: [PATCH] Improve jemalloc build config: * fix include order for macos/homebrew * use static jemalloc for static builds * set CMP0074 for using _ROOT variables --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 494f08fe0..ffcc5afe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ if (target) endif () project (rippled) +if (POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif () #[===================================================================[ convenience variables and sanity checks #]===================================================================] @@ -606,6 +609,9 @@ target_link_libraries (opts $<$,$>:-p>) if (jemalloc) + if (static) + set(JEMALLOC_USE_STATIC ON CACHE BOOL "" FORCE) + endif () find_package (jemalloc REQUIRED) target_compile_definitions (opts INTERFACE PROFILE_JEMALLOC) target_include_directories (opts SYSTEM INTERFACE ${JEMALLOC_INCLUDE_DIRS}) @@ -724,7 +730,7 @@ if (is_xcode) target_include_directories (ripple_boost BEFORE INTERFACE ${Boost_INCLUDE_DIRS}) target_compile_options (ripple_boost INTERFACE --system-header-prefix="boost/") else () - target_include_directories (ripple_boost SYSTEM INTERFACE ${Boost_INCLUDE_DIRS}) + target_include_directories (ripple_boost SYSTEM BEFORE INTERFACE ${Boost_INCLUDE_DIRS}) endif() target_link_libraries (ripple_boost @@ -2564,9 +2570,9 @@ else () src/test/unit_test/multi_runner.cpp) endif () target_link_libraries (rippled + Ripple::boost Ripple::opts Ripple::libs - Ripple::boost Ripple::xrpl_core) exclude_if_included (rippled)