Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Meel <ankitjmeel@gmail.com>2021-08-03 22:52:27 +0300
committerAnkit Meel <ankitjmeel@gmail.com>2021-08-03 22:52:27 +0300
commit18d900caca8317d33216bbc778c07b9f6ce3da84 (patch)
tree7850834d41d693c402d309939a997ad94af9cd15
parent41357d556f4e3b286ab4ecfaeb990cc40bf08333 (diff)
macOS: Fix OpenMP dynamic loader error.
-rw-r--r--build_files/cmake/platform/platform_apple.cmake9
-rw-r--r--source/creator/CMakeLists.txt3
2 files changed, 7 insertions, 5 deletions
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 529c01db009..a130d265dff 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -500,14 +500,17 @@ 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}")
+
+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..e928be571a2 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -349,8 +349,7 @@ elseif(APPLE)
set(MAC_BLENDER_TARGET_DYLIBS_DIR "${TARGETDIR_VER}/lib")
else()
set(TARGETDIR_VER Blender.app/Contents/Resources/${BLENDER_VERSION})
- # Dylibs folder for Blender executable. @executable_path is a default
- # rpath, so dropping libraries next to Blender is enough.
+ # Dylibs folder for Blender executable. @executable_path is an rpath.
set(MAC_BLENDER_TARGET_DYLIBS_DIR "$<TARGET_FILE_DIR:blender>")
endif()
# Skip relinking on cpack / install