Fix Python Module build on Windows
Don't install libraries in blender.shared and don't generate manifest as it's not working and not important to have a clean directory here. Always detect MSVC_REDIST_DIR as it is used by oneAPI. The way InstallRequiredSystemLibraries is called it already only sets some variables and doesn't install anything by itself. Pull Request: https://projects.blender.org/blender/blender/pulls/105999
This commit is contained in:
parent
ac0ed09735
commit
6e51f8d202
|
@ -1299,16 +1299,29 @@ macro(windows_install_shared_manifest)
|
|||
endif()
|
||||
if(WINDOWS_INSTALL_DEBUG)
|
||||
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Debug")
|
||||
endif()
|
||||
if(WINDOWS_INSTALL_RELEASE)
|
||||
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Release;RelWithDebInfo;MinSizeRel")
|
||||
endif()
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
# Blender executable with manifest.
|
||||
if(WINDOWS_INSTALL_DEBUG)
|
||||
list(APPEND WINDOWS_SHARED_MANIFEST_DEBUG ${WINDOWS_INSTALL_FILES})
|
||||
endif()
|
||||
if(WINDOWS_INSTALL_RELEASE)
|
||||
list(APPEND WINDOWS_SHARED_MANIFEST_RELEASE ${WINDOWS_INSTALL_FILES})
|
||||
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Release;RelWithDebInfo;MinSizeRel")
|
||||
endif()
|
||||
install(FILES ${WINDOWS_INSTALL_FILES}
|
||||
CONFIGURATIONS ${WINDOWS_CONFIGURATIONS}
|
||||
DESTINATION "./blender.shared"
|
||||
)
|
||||
else()
|
||||
# Python module without manifest.
|
||||
install(FILES ${WINDOWS_INSTALL_FILES}
|
||||
CONFIGURATIONS ${WINDOWS_CONFIGURATIONS}
|
||||
DESTINATION "./bpy"
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(windows_generate_manifest)
|
||||
|
@ -1325,11 +1338,19 @@ macro(windows_generate_manifest)
|
|||
endmacro()
|
||||
|
||||
macro(windows_generate_shared_manifest)
|
||||
if(WINDOWS_SHARED_MANIFEST_DEBUG)
|
||||
windows_generate_manifest(
|
||||
FILES "${WINDOWS_SHARED_MANIFEST_DEBUG}"
|
||||
OUTPUT "${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest"
|
||||
NAME "blender.shared"
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest
|
||||
DESTINATION "./blender.shared"
|
||||
CONFIGURATIONS Debug
|
||||
)
|
||||
endif()
|
||||
if(WINDOWS_SHARED_MANIFEST_RELEASE)
|
||||
windows_generate_manifest(
|
||||
FILES "${WINDOWS_SHARED_MANIFEST_RELEASE}"
|
||||
OUTPUT "${CMAKE_BINARY_DIR}/Release/blender.shared.manifest"
|
||||
|
@ -1340,9 +1361,5 @@ macro(windows_generate_shared_manifest)
|
|||
DESTINATION "./blender.shared"
|
||||
CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest
|
||||
DESTINATION "./blender.shared"
|
||||
CONFIGURATIONS Debug
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
|
@ -114,12 +114,13 @@ add_definitions(-D_WIN32_WINNT=0x603)
|
|||
# First generate the manifest for tests since it will not need the dependency on the CRT.
|
||||
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY)
|
||||
|
||||
if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
# Always detect CRT paths, but only manually install with WITH_WINDOWS_BUNDLE_CRT.
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
# ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles
|
||||
# redirects for this dll, for details see #88813.
|
||||
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
|
@ -141,7 +142,9 @@ if(WITH_WINDOWS_BUNDLE_CRT)
|
|||
install(FILES ${CMAKE_BINARY_DIR}/blender.crt.manifest DESTINATION ./blender.crt)
|
||||
set(BUNDLECRT "<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.crt\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
|
||||
endif()
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
set(BUNDLECRT "${BUNDLECRT}<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.shared\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
|
||||
endif()
|
||||
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
|
||||
|
||||
|
||||
|
|
|
@ -353,10 +353,12 @@ elseif(WIN32)
|
|||
set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/bpy/${BLENDER_VERSION})
|
||||
# Important the DLL's are next to `__init__.pyd` otherwise it won't load.
|
||||
set(TARGETDIR_LIB ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/bpy)
|
||||
set(TARGETDIR_EXE ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/bpy)
|
||||
else()
|
||||
set(TARGETDIR_VER ${BLENDER_VERSION})
|
||||
set(TARGETDIR_TEXT .)
|
||||
set(TARGETDIR_LIB .)
|
||||
set(TARGETDIR_LIB ./blender.shared)
|
||||
set(TARGETDIR_EXE .)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(WITH_PYTHON_MODULE)
|
||||
|
@ -1006,7 +1008,7 @@ elseif(WIN32)
|
|||
FILES
|
||||
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python${_PYTHON_VERSION_NO_DOTS}.dll
|
||||
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python3.dll
|
||||
DESTINATION ${TARGETDIR_LIB}
|
||||
DESTINATION ${TARGETDIR_EXE}
|
||||
CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
|
||||
)
|
||||
|
||||
|
@ -1014,7 +1016,7 @@ elseif(WIN32)
|
|||
FILES
|
||||
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python${_PYTHON_VERSION_NO_DOTS}_d.dll
|
||||
${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python3_d.dll
|
||||
DESTINATION ${TARGETDIR_LIB}
|
||||
DESTINATION ${TARGETDIR_EXE}
|
||||
CONFIGURATIONS Debug
|
||||
)
|
||||
endif()
|
||||
|
@ -1252,7 +1254,7 @@ elseif(WIN32)
|
|||
${CMAKE_SOURCE_DIR}/release/windows/batch/blender_factory_startup.cmd
|
||||
${CMAKE_SOURCE_DIR}/release/windows/batch/blender_oculus.cmd
|
||||
${CMAKE_SOURCE_DIR}/release/windows/batch/oculus.json
|
||||
DESTINATION ${TARGETDIR_LIB}
|
||||
DESTINATION ${TARGETDIR_EXE}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -1280,7 +1282,7 @@ elseif(WIN32)
|
|||
if(PLATFORM_BUNDLED_LIBRARIES)
|
||||
install(
|
||||
FILES ${PLATFORM_BUNDLED_LIBRARIES}
|
||||
DESTINATION ${TARGETDIR_LIB}
|
||||
DESTINATION ${TARGETDIR_EXE}
|
||||
)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
|
@ -1513,7 +1515,7 @@ if((DEFINED LIBDIR) AND TARGETDIR_LIB)
|
|||
)
|
||||
install(DIRECTORY
|
||||
${USD_LIBRARY_DIR}/usd
|
||||
DESTINATION "./blender.shared"
|
||||
DESTINATION ${TARGETDIR_LIB}
|
||||
)
|
||||
elseif(USD_PYTHON_SUPPORT)
|
||||
install(DIRECTORY
|
||||
|
|
Loading…
Reference in New Issue