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:
authorRay Molenkamp <github@lazydodo.com>2019-12-06 20:12:03 +0300
committerRay Molenkamp <github@lazydodo.com>2019-12-06 20:12:03 +0300
commit6df2ede3414422372ac3b0b229b401e973b98509 (patch)
tree66c356a060b4a6c9b9aec40fa2e7e492ee283cb0 /build_files/cmake/platform/platform_win32_bundle_crt.cmake
parent19a89797c3a37f0e5b8957857536b539e2ea938a (diff)
Cleanup/Windows: Separate out the MS-CRT into a subfolder
In older versions the ms crt was only a few dlls, in recent versions this jumped to over 40 leading to quite a bit of clutter in our bin folder. This change moves the CRT into its own folder. For developers that generally already have the runtime globaly available on their machine, there is a new cmake option (WITH_WINDOWS_BUNDLE_CRT, default ON) that you can use to toggle installing the runtime to the blender bin folder, and save some time during the initial build, this option is off by default for only the developer profile. Reviewed By: brecht Differential Revision: https://developer.blender.org/D6132
Diffstat (limited to 'build_files/cmake/platform/platform_win32_bundle_crt.cmake')
-rw-r--r--build_files/cmake/platform/platform_win32_bundle_crt.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/build_files/cmake/platform/platform_win32_bundle_crt.cmake b/build_files/cmake/platform/platform_win32_bundle_crt.cmake
new file mode 100644
index 00000000000..a4aa608b013
--- /dev/null
+++ b/build_files/cmake/platform/platform_win32_bundle_crt.cmake
@@ -0,0 +1,36 @@
+if(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)
+
+ # Install the CRT to the blender.crt Sub folder.
+ install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ./blender.crt COMPONENT Libraries)
+
+ # Generating the manifest is a relativly expensive operation since
+ # it is collecting an sha1 hash for every file required. so only do
+ # this work when the libs have either changed or the manifest does
+ # not exist yet.
+
+ string(SHA1 libshash "${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}")
+ set(manifest_trigger_file "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/crt_${libshash}")
+
+ if(NOT EXISTS ${manifest_trigger_file})
+ set(CRTLIBS "")
+ foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
+ get_filename_component(filename ${lib} NAME)
+ file(SHA1 "${lib}" sha1_file)
+ set(CRTLIBS "${CRTLIBS} <file name=\"${filename}\" hash=\"${sha1_file}\" hashalg=\"SHA1\" />\n")
+ endforeach()
+ configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.crt.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.crt.manifest @ONLY)
+ file(TOUCH ${manifest_trigger_file})
+ endif()
+
+ install(FILES ${CMAKE_CURRENT_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()
+configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
+
+
+
+