Skip to content

Commit e477777

Browse files
authored
build: Protect against mismatch of OpenVDB vs C++ (#4023)
Looks like OpenVDB >= 10.0 requires a minimum of C++17. Warn at build time if trying to use an OpenVDB too new for the C++ compiler being used. Signed-off-by: Larry Gritz <[email protected]>
1 parent a7367a0 commit e477777

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

INSTALL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
5050
* OpenJpeg >= 2.0 (tested through 2.5; we recommend 2.4 or higher
5151
for multithreading support)
5252
* If you want support for OpenVDB files:
53-
* OpenVDB >= 5.0 (tested through 10.0)
53+
* OpenVDB >= 5.0 (tested through 10.1). Note that using OpenVDB >= 10.0
54+
requires that you compile OIIO with C++17 or higher.
5455
* If you want to use TBB as the thread pool:
5556
* TBB >= 2018 (tested through 2021 and OneTBB)
5657
* If you want support for converting to and from OpenCV data structures,

src/cmake/externalpackages.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ checked_find_package (OpenVDB
235235
VERSION_MIN 5.0
236236
DEPS TBB
237237
DEFINITIONS -DUSE_OPENVDB=1)
238+
if (OpenVDB_FOUND AND OpenVDB_VERSION VERSION_GREATER_EQUAL 10.0 AND CMAKE_CXX_STANDARD VERSION_LESS 17)
239+
message (WARNING "${ColorYellow}OpenVDB >= 10.0 (we found ${OpenVDB_VERSION}) can only be used when we build with C++17 or higher. Disabling OpenVDB support.${ColorReset}")
240+
set (OpeVDB_FOUND 0)
241+
endif ()
238242

239243
checked_find_package (Ptex PREFER_CONFIG)
240244
if (NOT Ptex_FOUND OR NOT Ptex_VERSION)

0 commit comments

Comments
 (0)