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:
Diffstat (limited to 'build_files/cmake/Modules/FindPythonLibsUnix.cmake')
-rw-r--r--build_files/cmake/Modules/FindPythonLibsUnix.cmake16
1 files changed, 11 insertions, 5 deletions
diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
index 1e88621303f..0afe1299330 100644
--- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake
+++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
@@ -34,11 +34,17 @@ SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
MARK_AS_ADVANCED(PYTHON_VERSION)
-# See: http://docs.python.org/extending/embedding.html#linking-requirements
-# for why this is needed
-SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
-MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
-
+if(APPLE)
+ if(WITH_PYTHON_MODULE)
+ set(PYTHON_LINKFLAGS "-undefined dynamic_lookup")
+ else()
+ set(PYTHON_LINKFLAGS)
+ endif()
+else()
+ # See: http://docs.python.org/extending/embedding.html#linking-requirements
+ SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
+ MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
+endif()
# if the user passes these defines as args, we don't want to overwrite
SET(_IS_INC_DEF OFF)