diff options
author | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-11-10 15:17:42 +0300 |
commit | 7246c387435769a169ac24c91434c615df6434b4 (patch) | |
tree | 61842e3e0ce85e80720fdd7476d44d2e629f59fd /build_files/build_environment/cmake/download.cmake | |
parent | c5f55d17096d373791363e46004176e3f7f7ae52 (diff) | |
parent | 0b4bd3ddc016298e868169a541cf6c132b10c587 (diff) |
Merge branch 'master' into asset-browser-grid-viewasset-browser-grid-view
Diffstat (limited to 'build_files/build_environment/cmake/download.cmake')
-rw-r--r-- | build_files/build_environment/cmake/download.cmake | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 6f0dd80ea6a..8d75f0ff0ed 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -14,6 +14,20 @@ function(download_source dep) else() set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE}) endif() + # Validate all required variables are set and give an explicit error message + # rather than CMake erroring out later on with a more ambigious error. + if (NOT DEFINED TARGET_FILE) + message(FATAL_ERROR "${dep}_FILE variable not set") + endif() + if (NOT DEFINED TARGET_HASH) + message(FATAL_ERROR "${dep}_HASH variable not set") + endif() + if (NOT DEFINED TARGET_HASH_TYPE) + message(FATAL_ERROR "${dep}_HASH_TYPE variable not set") + endif() + if (NOT DEFINED TARGET_URI) + message(FATAL_ERROR "${dep}_URI variable not set") + endif() set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE}) message("Checking source : ${dep} (${TARGET_FILE})") if(NOT EXISTS ${TARGET_FILE}) @@ -25,6 +39,36 @@ function(download_source dep) SHOW_PROGRESS ) endif() + if(EXISTS ${TARGET_FILE}) + # Sometimes the download fails, but that is not a + # fail condition for "file(DOWNLOAD" it will warn about + # a crc mismatch and just carry on, we need to explicitly + # catch this and remove the bogus 0 byte file so we can + # retry without having to go find the file and manually + # delete it. + file (SIZE ${TARGET_FILE} TARGET_SIZE) + if(${TARGET_SIZE} EQUAL 0) + file(REMOVE ${TARGET_FILE}) + message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...") + endif() + + # If we are using sources from the blender repo also + # validate that the hashes match, this takes a + # little more time, but protects us when we are + # building a release package and one of the packages + # is missing or incorrect. + # + # For regular platform maintenaince this is not needed + # since the actual build of the dep will notify the + # platform maintainer if there is a problem with the + # source package and refuse to build. + if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH) + file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH) + if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH}) + message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}") + endif() + endif() + endif() endfunction(download_source) download_source(ZLIB) @@ -51,7 +95,6 @@ download_source(OSL) download_source(PYTHON) download_source(TBB) download_source(OPENVDB) -download_source(NANOVDB) download_source(NUMPY) download_source(LAME) download_source(OGG) @@ -71,7 +114,6 @@ download_source(WEBP) download_source(SPNAV) download_source(JEMALLOC) download_source(XML2) -download_source(TINYXML) download_source(YAMLCPP) download_source(EXPAT) download_source(PUGIXML) @@ -89,6 +131,8 @@ download_source(MESA) download_source(NASM) download_source(XR_OPENXR_SDK) download_source(WL_PROTOCOLS) +download_source(WAYLAND) +download_source(WAYLAND_LIBDECOR) download_source(ISPC) download_source(GMP) download_source(POTRACE) @@ -101,6 +145,7 @@ download_source(FMT) download_source(ROBINMAP) download_source(IMATH) download_source(PYSTRING) +download_source(OPENPGL) download_source(LEVEL_ZERO) download_source(DPCPP) download_source(VCINTRINSICS) |