Skip to content

Commit

Permalink
Use C++14 for Boost > 1.80.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nwhitehorn committed Oct 24, 2022
1 parent d1032f6 commit 612e182
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 612e182

Please sign in to comment.