THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr)
Client: C++
This closes #1328
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 63981e9..f1ea7bb 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -40,6 +40,16 @@
# and enables the library if all are found. This means the default is to build as
# much as possible but leaving out libraries if their dependencies are not met.
+option(WITH_BOOST_FUNCTIONAL "Use boost/tr1/functional.hpp even under C++11 or later" OFF)
+if (WITH_BOOST_FUNCTIONAL)
+ add_definitions(-DFORCE_BOOST_FUNCTIONAL)
+endif()
+
+option(WITH_BOOST_SMART_PTR "Use boost/smart_ptr.hpp even under C++11 or later" OFF)
+if (WITH_BOOST_SMART_PTR)
+ add_definitions(-DFORCE_BOOST_SMART_PTR)
+endif()
+
option(WITH_BOOST_STATIC "Build with Boost static link library" OFF)
set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC})
if (NOT WITH_BOOST_STATIC)
@@ -197,6 +207,8 @@
message(STATUS " Build static libraries: ${WITH_STATIC_LIB}")
message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}")
message(STATUS " Build with Boost thread support: ${WITH_BOOSTTHREADS}")
+message(STATUS " Build with boost/tr1/functional (forced) ${WITH_BOOST_FUNCTIONAL}")
+message(STATUS " Build with boost/smart_ptr (forced) ${WITH_BOOST_SMART_PTR}")
message(STATUS " Build with C++ std::thread support: ${WITH_STDTHREADS}")
message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")