Skip to content

Commit

Permalink
cmake: Bump required C++ standard version to C++17
Browse files Browse the repository at this point in the history
Note this adds a boost-specific #define to avoid using
deprecated STL features that have been removed on some
platforms. See #2634.

Fixes #2634

(Internal change: 2295937)
  • Loading branch information
sunyab authored and pixar-oss committed Sep 19, 2023
1 parent 71b777f commit 0e4d360
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/defaults/CXXDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ include(CXXHelpers)
include(Version)
include(Options)

# Require C++14
set(CMAKE_CXX_STANDARD 14)
# Require C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand All @@ -44,6 +44,11 @@ _add_define(GLX_GLXEXT_PROTOTYPES)
# Python bindings for tf require this define.
_add_define(BOOST_PYTHON_NO_PY_SIGNATURES)

# Parts of boost (in particular, boost::hash) rely on deprecated features
# of the STL that have been removed from some implementations under C++17.
# This define tells boost not to use those features.
_add_define(BOOST_NO_CXX98_FUNCTION_BASE)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
_add_define(BUILD_OPTLEVEL_DEV)
endif()
Expand Down

0 comments on commit 0e4d360

Please sign in to comment.