diff --git a/cmake/CompileBoost.cmake b/cmake/CompileBoost.cmake index 35207b6b67..d0a53b4c07 100644 --- a/cmake/CompileBoost.cmake +++ b/cmake/CompileBoost.cmake @@ -38,6 +38,10 @@ function(compile_boost) set(BOOST_LINK_FLAGS "") if(APPLE OR ICX OR USE_LIBCXX) list(APPEND BOOST_COMPILER_FLAGS -stdlib=libc++ -nostdlib++) + if (APPLE) + # Remove this after boost 1.81 or above is used + list(APPEND BOOST_COMPILER_FLAGS -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) + endif() list(APPEND BOOST_LINK_FLAGS -lc++ -lc++abi) if (NOT APPLE) list(APPEND BOOST_LINK_FLAGS -static-libgcc) diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 09e20e3081..281ffa6627 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -79,6 +79,11 @@ if(WIN32) add_definitions(-D_USE_MATH_DEFINES) # Math constants endif() +if(APPLE) +# Remove this after boost 1.81 or above is used +add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) +endif() + if (USE_CCACHE) find_program(CCACHE_PROGRAM "ccache" REQUIRED) set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") diff --git a/fdbmonitor/fdbmonitor.cpp b/fdbmonitor/fdbmonitor.cpp index 50fcb87426..eeae06a1ac 100644 --- a/fdbmonitor/fdbmonitor.cpp +++ b/fdbmonitor/fdbmonitor.cpp @@ -80,7 +80,9 @@ #include "fdbclient/SimpleIni.h" #include "fdbclient/versions.h" +#ifdef __linux__ constexpr uint64_t DEFAULT_MEMORY_LIMIT = 8LL << 30; +#endif constexpr double MEMORY_CHECK_INTERVAL = 2.0; // seconds #ifdef __linux__