[Bf-blender-cvs] [4f622c9a080] master: Fix Windows build after recent guardedalloc changes

Brecht Van Lommel noreply at git.blender.org
Wed May 20 02:41:10 CEST 2020


Commit: 4f622c9a080b9f519ee9f7829b154e1401bb96ff
Author: Brecht Van Lommel
Date:   Wed May 20 02:14:49 2020 +0200
Branches: master
https://developer.blender.org/rB4f622c9a080b9f519ee9f7829b154e1401bb96ff

Fix Windows build after recent guardedalloc changes

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

M	intern/guardedalloc/CMakeLists.txt
M	source/blender/makesdna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/CMakeLists.txt
M	tests/gtests/blenlib/BLI_linklist_lockfree_test.cc

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

diff --git a/intern/guardedalloc/CMakeLists.txt b/intern/guardedalloc/CMakeLists.txt
index 1d4f846623c..cb24df65ba0 100644
--- a/intern/guardedalloc/CMakeLists.txt
+++ b/intern/guardedalloc/CMakeLists.txt
@@ -53,6 +53,14 @@ if(WIN32 AND NOT UNIX)
 
     mmap_win.h
   )
+
+  list(APPEND INC_SYS
+    ${PTHREADS_INC}
+  )
+
+  list(APPEND LIB
+    ${PTHREADS_LIBRARIES}
+  )
 endif()
 
 # Jemalloc 5.0.0+ needs extra configuration.
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt
index 1b0bf086269..01e3971a216 100644
--- a/source/blender/makesdna/intern/CMakeLists.txt
+++ b/source/blender/makesdna/intern/CMakeLists.txt
@@ -58,6 +58,10 @@ setup_platform_linker_flags()
 
 add_executable(makesdna ${SRC} ${SRC_DNA_INC})
 
+if(WIN32 AND NOT UNIX)
+  target_link_libraries(makesdna ${PTHREADS_LIBRARIES})
+endif()
+
 # Output dna.c
 add_custom_command(
   OUTPUT
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index cd05aba8794..024bdbe5ed5 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -394,6 +394,10 @@ add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
 target_link_libraries(makesrna bf_dna)
 target_link_libraries(makesrna bf_dna_blenlib)
 
+if(WIN32 AND NOT UNIX)
+  target_link_libraries(makesrna ${PTHREADS_LIBRARIES})
+endif()
+
 # Output rna_*_gen.c
 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
 add_custom_command(
diff --git a/tests/gtests/blenlib/BLI_linklist_lockfree_test.cc b/tests/gtests/blenlib/BLI_linklist_lockfree_test.cc
index 023d02e5075..d1a527d57ac 100644
--- a/tests/gtests/blenlib/BLI_linklist_lockfree_test.cc
+++ b/tests/gtests/blenlib/BLI_linklist_lockfree_test.cc
@@ -87,9 +87,7 @@ TEST(LockfreeLinkList, InsertMultipleConcurrent)
     BLI_task_pool_push(pool, concurrent_insert, POINTER_FROM_INT(i), false, NULL);
   }
   /* Run all the tasks. */
-  BLI_threaded_malloc_begin();
   BLI_task_pool_work_and_wait(pool);
-  BLI_threaded_malloc_end();
   /* Verify we've got all the data properly inserted. */
   EXPECT_EQ(list.head, &list.dummy_node);
   bool *visited_nodes = (bool *)MEM_callocN(sizeof(bool) * num_nodes, "visited nodes");



More information about the Bf-blender-cvs mailing list