From 612e182ca4ec58ed10a7252bd9a1f49d82d93142 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Mon, 24 Oct 2022 11:33:02 -0400 Subject: [PATCH] Use C++14 for Boost > 1.80. Boost 1.80 starts complaining (in a way that becomes fatal) if built using C++11. Assume systems with very recent Boost also have reasonably-recent compilers. Closes #90. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fb83e6..31300ed2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,11 @@ set(Boost_NO_BOOST_CMAKE ON) # Find all the Boost and Python libraries include(Spt3gBoostPython) +# Upgrade C++ standard to C++14 for Boost >= 1.80, which requires it +if(Boost_VERSION VERSION_GREATER 1.79) + set(CMAKE_CXX_STANDARD 14) +endif() + target_include_directories(spt3g INTERFACE ${Boost_INCLUDE_DIR} ${Python_INCLUDE_DIRS}) target_link_libraries(spt3g INTERFACE pthread ${Boost_LIBRARIES} ${Python_LIBRARIES})