Fix MacOS compiling errors

This commit is contained in:
Jingyu Zhou 2023-10-20 21:14:46 -07:00
parent ad259d48cf
commit a083d81737
3 changed files with 11 additions and 0 deletions

View File

@ -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)

View File

@ -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}")

View File

@ -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__