[Bf-blender-cvs] [6a0ed670fd6] soc-2021-adaptive-cloth: bli: generational_arena: fix: compile error when gtests not enabled

ishbosamiya noreply at git.blender.org
Mon Jul 5 17:33:40 CEST 2021


Commit: 6a0ed670fd6a0ccebef52bc01eaee8b6949b7376
Author: ishbosamiya
Date:   Sat Jul 3 18:13:33 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB6a0ed670fd6a0ccebef52bc01eaee8b6949b7376

bli: generational_arena: fix: compile error when gtests not enabled

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

M	source/blender/blenlib/BLI_generational_arena.hh
M	source/blender/blenlib/CMakeLists.txt

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

diff --git a/source/blender/blenlib/BLI_generational_arena.hh b/source/blender/blenlib/BLI_generational_arena.hh
index b88316ca39b..127916bc6f0 100644
--- a/source/blender/blenlib/BLI_generational_arena.hh
+++ b/source/blender/blenlib/BLI_generational_arena.hh
@@ -74,7 +74,9 @@
 #include "BLI_assert.h"
 #include "BLI_vector.hh"
 
-#include "testing/testing.h"
+#ifdef WITH_GTESTS
+#  include "testing/testing.h"
+#endif /* WITH_GTESTS */
 
 namespace blender::generational_arena {
 
@@ -656,7 +658,9 @@ class Arena {
   /* all private static methods */
   /* all private non-static methods */
 
+#ifdef WITH_GTESTS
   FRIEND_TEST(generational_arena, GetNextFreeLocations);
+#endif /* WITH_GTESTS */
 
   blender::Vector<usize> get_next_free_locations() const
   {
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 0268c7c0cba..0e35ccaccf9 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -347,6 +347,10 @@ if(WITH_GMP)
   )
 endif()
 
+if(WITH_GTESTS)
+  add_definitions(-DWITH_GTESTS)
+endif()
+
 if(WIN32)
   list(APPEND INC
     ../../../intern/utfconv



More information about the Bf-blender-cvs mailing list