[Bf-blender-cvs] [c63393e58ce] tmp_openmpfix: macOS: Fix for dylib loader issues.

Ankit Meel noreply at git.blender.org
Tue Aug 3 22:30:15 CEST 2021


Commit: c63393e58ce4e4b6bd2d574bff24fffacb349a2c
Author: Ankit Meel
Date:   Tue Aug 3 22:25:11 2021 +0530
Branches: tmp_openmpfix
https://developer.blender.org/rBc63393e58ce4e4b6bd2d574bff24fffacb349a2c

macOS: Fix for dylib loader issues.

Also some logging for buildbot

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

M	build_files/cmake/platform/platform_apple.cmake
M	source/creator/CMakeLists.txt

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

diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a85e9f23277 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,19 @@ endif()
 # makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
 # CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next to each binary.
 #
-# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used, but
-# needs no changes since it already looks for dylibs next to the executable by
-# default (@executable_path).
+# For the installed Blender executable, CMAKE_INSTALL_RPATH will be used
+# to locate the dylibs at @executable_path, next to the Blender executable.
 #
 # For the installed Python module, CMAKE_INSTALL_RPATH is modified to find the
 # dylib in an adjacent folder.
 set(CMAKE_SKIP_BUILD_RPATH FALSE)
-list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
+if(WITH_OPENMP)
+  list(APPEND CMAKE_BUILD_RPATH   "${OpenMP_LIBRARY_DIR}")
+endif()
+
+set(CMAKE_SKIP_INSTALL_RPATH FALSE)
+list(APPEND CMAKE_INSTALL_RPATH "@executable_path")
+
 if(WITH_PYTHON_MODULE)
   list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
 endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index f7179dfb7e9..52e9e449642 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1044,12 +1044,16 @@ elseif(APPLE)
     Blender.app/Contents/
   )
 
+  message(WARNING "OPENMP_CUSTOM=${OPENMP_CUSTOM} WITH_OPENMP=${WITH_OPENMP}")
   if(WITH_OPENMP AND OPENMP_CUSTOM)
+    message(WARNING "OpenMP_LIBRARY=${OpenMP_LIBRARY}")
+    message(WARNING "MAC_BLENDER_TARGET_DYLIBS_DIR=${MAC_BLENDER_TARGET_DYLIBS_DIR}")
     install(
       FILES "${OpenMP_LIBRARY}"
       DESTINATION "${MAC_BLENDER_TARGET_DYLIBS_DIR}"
     )
   endif()
+  message(FATAL_ERROR "")
 
   if(WITH_COMPILER_ASAN)
     install(



More information about the Bf-blender-cvs mailing list