[Bf-blender-cvs] [3dcb158] openvdb: Cycles: disable -Wfloat-conversion and -Wdouble-promotion for OpenVDB for now, and quiet warning.

Kévin Dietrich noreply at git.blender.org
Tue Jun 9 02:02:54 CEST 2015


Commit: 3dcb158f059444e758cefcccdf89b2f10ea779a1
Author: Kévin Dietrich
Date:   Sun Jun 7 20:14:59 2015 +0200
Branches: openvdb
https://developer.blender.org/rB3dcb158f059444e758cefcccdf89b2f10ea779a1

Cycles: disable -Wfloat-conversion and -Wdouble-promotion for OpenVDB
for now, and quiet warning.

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

M	intern/cycles/CMakeLists.txt
M	intern/cycles/util/util_openvdb.h

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

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index b02dafc..6c1264f 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -149,6 +149,7 @@ endif()
 if(WITH_OPENVDB)
 	add_definitions(-DWITH_OPENVDB)
 	add_definitions(-DOPENVDB_USE_BLOSC)
+	add_definitions(-DDWREAL_IS_DOUBLE=0)
 	include_directories(
 		${OPENVDB_INCLUDE_DIRS}
 	)
@@ -205,8 +206,6 @@ include_directories(
 	${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO
 	${OPENEXR_INCLUDE_DIR}
 	${OPENEXR_INCLUDE_DIRS}
-	# TODO(kevin)
-	${OPENVDB_INCLUDE_DIRS}
 	${PUGIXML_INCLUDE_DIR}
 )
 
diff --git a/intern/cycles/util/util_openvdb.h b/intern/cycles/util/util_openvdb.h
index ea3c4f9..cb38211 100644
--- a/intern/cycles/util/util_openvdb.h
+++ b/intern/cycles/util/util_openvdb.h
@@ -38,10 +38,22 @@ CCL_NAMESPACE_END
 
 #ifdef WITH_OPENVDB
 
+/* They are too many implicit float conversions happening in OpenVDB, disabling
+ * errors for now (kevin) */
+#ifdef __GNUC__
+#	pragma GCC diagnostic push
+#	pragma GCC diagnostic ignored "-Wfloat-conversion"
+#	pragma GCC diagnostic ignored "-Wdouble-promotion"
+#endif
+
 #include <openvdb/openvdb.h>
 #include <openvdb/tools/Interpolation.h>
 #include <openvdb/tools/RayIntersector.h>
 
+#ifdef __GNUC__
+#	pragma GCC diagnostic pop
+#endif
+
 CCL_NAMESPACE_BEGIN
 
 #if defined(HAS_CPP11_FEATURES)




More information about the Bf-blender-cvs mailing list