Do not provide python libraries for linking if building python module

When building blender as a python module, such as for inclusion in a
wheel, it is not permitted to link against python libraries.
This diff does so by simply unsetting the library when building blender
as a python module, instead of the more heavyweight solution of
switching to the cmake FindPython module.

Reviewed By: LazyDodo, campbellbarton

Ref D15012
This commit is contained in:
Campbell Barton 2022-05-31 18:08:31 +10:00
parent 247ceca629
commit e82141b6b4
1 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibsUnix DEFAULT_MSG
IF(PYTHONLIBSUNIX_FOUND)
# Assign cache items
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
IF(NOT WITH_PYTHON_MODULE)
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
ENDIF()
FIND_FILE(PYTHON_SITE_PACKAGES
NAMES