[Bf-blender-cvs] [71d7d6cd8c4] master: Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.

Brecht Van Lommel noreply at git.blender.org
Mon Apr 2 19:13:13 CEST 2018


Commit: 71d7d6cd8c431b7f4fac8d65a4eaedf3cff6c8f6
Author: Brecht Van Lommel
Date:   Mon Apr 2 18:55:10 2018 +0200
Branches: master
https://developer.blender.org/rB71d7d6cd8c431b7f4fac8d65a4eaedf3cff6c8f6

Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.

Better fix for T54457. It seems Debian compiles OpenVDB without ABI 3
compatibility, while Arch does enable it as is the default in the OpeVDB
CMake build system.

So now there's an option that the distribution can set depending on how
they compile their OpenVDB package.

===================================================================

M	CMakeLists.txt
M	intern/openvdb/CMakeLists.txt
M	intern/openvdb/intern/openvdb_writer.cc

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 566754d4883..f0930866d64 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,6 +251,8 @@ option(WITH_OPENSUBDIV    "Enable OpenSubdiv for surface subdivision" _init_OPEN
 
 option(WITH_OPENVDB       "Enable features relying on OpenVDB" OFF)
 option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF)
+option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
+mark_as_advanced(WITH_OPENVDB_3_ABI_COMPATIBLE)
 
 # GHOST Windowing Library Options
 option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
diff --git a/intern/openvdb/CMakeLists.txt b/intern/openvdb/CMakeLists.txt
index 4b872f25d45..f666dc78e75 100644
--- a/intern/openvdb/CMakeLists.txt
+++ b/intern/openvdb/CMakeLists.txt
@@ -38,9 +38,14 @@ set(SRC
 if(WITH_OPENVDB)
 	add_definitions(
 		-DWITH_OPENVDB
-		-DOPENVDB_3_ABI_COMPATIBLE
 	)
 
+	if(WITH_OPENVDB_3_ABI_COMPATIBLE)
+		add_definitions(
+			-DOPENVDB_3_ABI_COMPATIBLE
+		)
+	endif()
+
 	list(APPEND INC_SYS
 		${BOOST_INCLUDE_DIR}
 		${TBB_INCLUDE_DIRS}
diff --git a/intern/openvdb/intern/openvdb_writer.cc b/intern/openvdb/intern/openvdb_writer.cc
index b83691ac7de..bedcfe65552 100644
--- a/intern/openvdb/intern/openvdb_writer.cc
+++ b/intern/openvdb/intern/openvdb_writer.cc
@@ -45,7 +45,7 @@ void OpenVDBWriter::insert(const openvdb::GridBase::Ptr &grid)
 
 void OpenVDBWriter::insert(const openvdb::GridBase &grid)
 {
-#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER >= 3)
+#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER <= 3) || defined(OPENVDB_3_ABI_COMPATIBLE)
 	m_grids->push_back(grid.copyGrid());
 #else
 	m_grids->push_back(grid.copyGridWithNewTree());



More information about the Bf-blender-cvs mailing list