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:
authorHans Goudey <h.goudey@me.com>2020-08-12 04:59:16 +0300
committerHans Goudey <h.goudey@me.com>2020-08-12 04:59:16 +0300
commitef11238c743e6985fe325280fb13e05d6ec27378 (patch)
tree1dd2605a676bee52296535825b99f000a9c255eb /build_files
parent1f768bbe4145daed111636ca09dd53b25b8d29b5 (diff)
parentec5f39208785c1bbe723054ffe69e1ac2ab470dd (diff)
Merge branch 'master' into property-search-uiproperty-search-ui
Diffstat (limited to 'build_files')
-rw-r--r--build_files/build_environment/CMakeLists.txt1
-rw-r--r--build_files/build_environment/cmake/gmp.cmake88
-rw-r--r--build_files/build_environment/cmake/harvest.cmake2
-rw-r--r--build_files/build_environment/cmake/ispc.cmake1
-rw-r--r--build_files/build_environment/cmake/versions.cmake4
-rwxr-xr-xbuild_files/build_environment/install_deps.sh373
-rw-r--r--build_files/build_environment/patches/cmakelists_gmpxx.txt22
-rw-r--r--build_files/build_environment/patches/config_gmpxx.h668
-rw-r--r--build_files/buildbot/buildbot_utils.py6
-rwxr-xr-xbuild_files/buildbot/worker_bundle_dmg.py17
-rw-r--r--build_files/buildbot/worker_compile.py5
-rw-r--r--build_files/buildbot/worker_pack.py5
-rw-r--r--build_files/cmake/Modules/FindAlembic.cmake2
-rw-r--r--build_files/cmake/Modules/FindBlosc.cmake2
-rw-r--r--build_files/cmake/Modules/FindEmbree.cmake12
-rw-r--r--build_files/cmake/Modules/FindGLEW.cmake2
-rw-r--r--build_files/cmake/Modules/FindGMP.cmake96
-rw-r--r--build_files/cmake/Modules/FindOSL.cmake (renamed from build_files/cmake/Modules/FindOpenShadingLanguage.cmake)0
-rw-r--r--build_files/cmake/Modules/FindOpenCOLLADA.cmake3
-rw-r--r--build_files/cmake/Modules/FindOpenSubdiv.cmake3
-rw-r--r--build_files/cmake/Modules/FindOpenVDB.cmake2
-rw-r--r--build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake (renamed from build_files/cmake/Modules/FindXR-OpenXR-SDK.cmake)2
-rw-r--r--build_files/cmake/Modules/GTest.cmake550
-rw-r--r--build_files/cmake/Modules/GTestAddTests.cmake191
-rw-r--r--build_files/cmake/config/blender_full.cmake1
-rw-r--r--build_files/cmake/config/blender_lite.cmake1
-rw-r--r--build_files/cmake/config/blender_release.cmake1
-rw-r--r--build_files/cmake/macros.cmake23
-rw-r--r--build_files/cmake/platform/platform_apple.cmake12
-rw-r--r--build_files/cmake/platform/platform_unix.cmake14
-rw-r--r--build_files/cmake/platform/platform_win32.cmake7
31 files changed, 1974 insertions, 142 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index 276311fe2d8..c26b90637c3 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -117,6 +117,7 @@ if(WIN32)
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
+ include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(WIN32)
diff --git a/build_files/build_environment/cmake/gmp.cmake b/build_files/build_environment/cmake/gmp.cmake
new file mode 100644
index 00000000000..40d8e04b3a7
--- /dev/null
+++ b/build_files/build_environment/cmake/gmp.cmake
@@ -0,0 +1,88 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(GMP_EXTRA_ARGS -enable-cxx)
+
+if(WIN32)
+ # Shared for windows because static libs will drag in a libgcc dependency.
+ set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
+else()
+ set(GMP_OPTIONS --enable-static --disable-shared )
+endif()
+
+ExternalProject_Add(external_gmp
+ URL ${GMP_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GMP_HASH}
+ PREFIX ${BUILD_DIR}/gmp
+ CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
+ BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
+ INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
+ INSTALL_DIR ${LIBDIR}/gmp
+)
+
+if(MSVC)
+ set_target_properties(external_gmp PROPERTIES FOLDER Mingw)
+endif()
+
+if(BUILD_MODE STREQUAL Release AND WIN32)
+ ExternalProject_Add_Step(external_gmp after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
+ COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
+ COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
+ DEPENDEES install
+ )
+endif()
+
+if(BUILD_MODE STREQUAL Debug AND WIN32)
+ExternalProject_Add_Step(external_gmp after_install
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
+ COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
+ DEPENDEES install
+ )
+endif()
+
+if(WIN32)
+ # gmpxx is somewhat special, it builds on top of the C style gmp library but exposes C++ bindings
+ # given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
+ # with MSVC, while GMP can only be build with mingw.
+ ExternalProject_Add(external_gmpxx
+ URL ${GMP_URI}
+ DOWNLOAD_DIR ${DOWNLOAD_DIR}
+ URL_HASH MD5=${GMP_HASH}
+ PREFIX ${BUILD_DIR}/gmpxx
+ PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
+ ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmpxx ${DEFAULT_CMAKE_FLAGS} -DGMP_LIBRARY=${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib -DGMP_INCLUDE_DIR=${BUILD_DIR}/gmp/src/external_gmp -DCMAKE_DEBUG_POSTFIX=_d
+ INSTALL_DIR ${LIBDIR}/gmpxx
+ )
+ set_target_properties(external_gmpxx PROPERTIES FOLDER Mingw)
+
+ add_dependencies(
+ external_gmpxx
+ external_gmp
+ )
+
+ ExternalProject_Add_Step(external_gmpxx after_install
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmpxx/ ${HARVEST_TARGET}/gmp
+ DEPENDEES install
+ )
+
+endif()
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index 3f5d2044dbc..dbb3a33e705 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -89,6 +89,8 @@ harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
+harvest(gmp/include gmp/include "*.h")
+harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
diff --git a/build_files/build_environment/cmake/ispc.cmake b/build_files/build_environment/cmake/ispc.cmake
index b67351dcf9f..a352f87a9aa 100644
--- a/build_files/build_environment/cmake/ispc.cmake
+++ b/build_files/build_environment/cmake/ispc.cmake
@@ -73,4 +73,3 @@ if(WIN32)
external_flexbison
)
endif()
-
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index ce2a1191f17..30a0b1184c2 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -315,3 +315,7 @@ set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
set(ISPC_VERSION v1.13.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
+
+set(GMP_VERSION 6.2.0)
+set(GMP_URI https://gmplib.org/download/gmp/gmp-${GMP_VERSION}.tar.xz)
+set(GMP_HASH a325e3f09e6d91e62101e59f9bda3ec1)
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index 49d7b8209ee..46f1694ed38 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -374,71 +374,96 @@ NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=true
+# Note about versions: Min is inclusive, Max is exclusive (i.e. XXX_VERSION_MIN <= ACTUAL_VERSION < XXX_VERSION_MAX)
+# XXX_VERSION is officially supported/used version in official builds.
+# XXX_VERSION_SHORT is used for various things, like preferred version (when distribution provides several of them),
+# and to name shortcuts to built libraries' installation directories...
+
CLANG_FORMAT_VERSION_MIN="6.0"
+CLANG_FORMAT_VERSION_MAX="10.0"
PYTHON_VERSION="3.7.7"
+PYTHON_VERSION_SHORT="3.7"
PYTHON_VERSION_MIN="3.7"
+PYTHON_VERSION_MAX="3.9"
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_MIN
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
-NUMPY_VERSION="1.17.0"
+NUMPY_VERSION="1.17.5"
+NUMPY_VERSION_SHORT="1.17"
NUMPY_VERSION_MIN="1.8"
+NUMPY_VERSION_MAX="2.0"
NUMPY_FORCE_BUILD=false
NUMPY_FORCE_REBUILD=false
NUMPY_SKIP=false
BOOST_VERSION="1.70.0"
+BOOST_VERSION_SHORT="1.70"
BOOST_VERSION_MIN="1.49"
+BOOST_VERSION_MAX="2.0"
BOOST_FORCE_BUILD=false
BOOST_FORCE_REBUILD=false
BOOST_SKIP=false
TBB_VERSION="2019"
+TBB_VERSION_SHORT="2019"
TBB_VERSION_UPDATE="_U9" # Used for source packages...
TBB_VERSION_MIN="2018"
+TBB_VERSION_MAX="2021"
TBB_FORCE_BUILD=false
TBB_FORCE_REBUILD=false
TBB_SKIP=false
-OCIO_VERSION="1.1.0"
+OCIO_VERSION="1.1.1"
+OCIO_VERSION_SHORT="1.1"
OCIO_VERSION_MIN="1.0"
+OCIO_VERSION_MAX="1.2"
OCIO_FORCE_BUILD=false
OCIO_FORCE_REBUILD=false
OCIO_SKIP=false
OPENEXR_VERSION="2.4.0"
+OPENEXR_VERSION_SHORT="2.4"
OPENEXR_VERSION_MIN="2.3"
+OPENEXR_VERSION_MAX="3.0"
OPENEXR_FORCE_BUILD=false
OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false
_with_built_openexr=false
-OIIO_VERSION="1.8.13"
-OIIO_VERSION_MIN="1.8.13"
-OIIO_VERSION_MAX="99.99.0" # UNKNOWN currently # Not supported by current OSL...
+OIIO_VERSION="2.1.15"
+OIIO_VERSION_SHORT="2.1"
+OIIO_VERSION_MIN="1.8"
+OIIO_VERSION_MAX="3.0"
OIIO_FORCE_BUILD=false
OIIO_FORCE_REBUILD=false
OIIO_SKIP=false
LLVM_VERSION="9.0.1"
+LLVM_VERSION_SHORT="9.0"
LLVM_VERSION_MIN="6.0"
+LLVM_VERSION_MAX="11.0"
LLVM_VERSION_FOUND=""
LLVM_FORCE_BUILD=false
LLVM_FORCE_REBUILD=false
LLVM_SKIP=false
# OSL needs to be compiled for now!
-OSL_VERSION="1.10.9"
-OSL_VERSION_MIN=$OSL_VERSION
+OSL_VERSION="1.10.10"
+OSL_VERSION_SHORT="1.10"
+OSL_VERSION_MIN="1.10"
+OSL_VERSION_MAX="2.0"
OSL_FORCE_BUILD=false
OSL_FORCE_REBUILD=false
OSL_SKIP=false
# OpenSubdiv needs to be compiled for now
OSD_VERSION="3.4.3"
-OSD_VERSION_MIN=$OSD_VERSION
+OSD_VERSION_SHORT="3.4"
+OSD_VERSION_MIN="3.4"
+OSD_VERSION_MAX="4.0"
OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false
OSD_SKIP=false
@@ -447,46 +472,69 @@ OSD_SKIP=false
OPENVDB_BLOSC_VERSION="1.5.0"
OPENVDB_VERSION="7.0.0"
-OPENVDB_VERSION_MIN=$OPENVDB_VERSION
+OPENVDB_VERSION_SHORT="7.0"
+OPENVDB_VERSION_MIN="7.0"
+OPENVDB_VERSION_MAX="8.0"
OPENVDB_FORCE_BUILD=false
OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false
# Alembic needs to be compiled for now
ALEMBIC_VERSION="1.7.12"
-ALEMBIC_VERSION_MIN=$ALEMBIC_VERSION
+ALEMBIC_VERSION_SHORT="1.7"
+ALEMBIC_VERSION_MIN="1.7"
+ALEMBIC_VERSION_MAX="2.0"
ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
USD_VERSION="20.05"
+USD_VERSION_SHORT="20.05"
+USD_VERSION_MIN="20.05"
+USD_VERSION_MAX="20.06"
USD_FORCE_BUILD=false
USD_FORCE_REBUILD=false
USD_SKIP=false
OPENCOLLADA_VERSION="1.6.68"
+OPENCOLLADA_VERSION_SHORT="1.6"
+OPENCOLLADA_VERSION_MIN="1.6.68"
+OPENCOLLADA_VERSION_MAX="1.7"
OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
EMBREE_VERSION="3.10.0"
+EMBREE_VERSION_SHORT="3.10"
+EMBREE_VERSION_MIN="3.10"
+EMBREE_VERSION_MAX="4.0"
EMBREE_FORCE_BUILD=false
EMBREE_FORCE_REBUILD=false
EMBREE_SKIP=false
-OIDN_VERSION="1.0.0"
+OIDN_VERSION="1.2.1"
+OIDN_VERSION_SHORT="1.2"
+OIDN_VERSION_MIN="1.2.0"
+OIDN_VERSION_MAX="1.3"
OIDN_FORCE_BUILD=false
OIDN_FORCE_REBUILD=false
OIDN_SKIP=false
+ISPC_VERSION="1.14.0"
+
FFMPEG_VERSION="4.2.3"
-FFMPEG_VERSION_MIN="2.8.4"
+FFMPEG_VERSION_SHORT="4.2"
+FFMPEG_VERSION_MIN="3.0"
+FFMPEG_VERSION_MAX="5.0"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
XR_OPENXR_VERSION="1.0.8"
+XR_OPENXR_VERSION_SHORT="1.0"
+XR_OPENXR_VERSION_MIN="1.0.8"
+XR_OPENXR_VERSION_MAX="2.0"
XR_OPENXR_FORCE_BUILD=false
XR_OPENXR_FORCE_REBUILD=false
XR_OPENXR_SKIP=false
@@ -634,36 +682,43 @@ while true; do
--ver-ocio)
OCIO_VERSION="$2"
OCIO_VERSION_MIN=$OCIO_VERSION
+ OCIO_VERSION_SHORT=$OCIO_VERSION
shift; shift; continue
;;
--ver-oiio)
OIIO_VERSION="$2"
OIIO_VERSION_MIN=$OIIO_VERSION
+ OIIO_VERSION_SHORT=$OIIO_VERSION
shift; shift; continue
;;
--ver-llvm)
LLVM_VERSION="$2"
LLVM_VERSION_MIN=$LLVM_VERSION
+ LLVM_VERSION_SHORT=$LLVM_VERSION
shift; shift; continue
;;
--ver-osl)
OSL_VERSION="$2"
OSL_VERSION_MIN=$OSL_VERSION
+ OSL_VERSION_SHORT=$OSL_VERSION
shift; shift; continue
;;
--ver-osd)
OSD_VERSION="$2"
OSD_VERSION_MIN=$OSD_VERSION
+ OSD_VERSION_SHORT=$OSD_VERSION
shift; shift; continue
;;
--ver-openvdb)
OPENVDB_VERSION="$2"
OPENVDB_VERSION_MIN=$OPENVDB_VERSION
+ OPENVDB_VERSION_SHORT=$OPENVDB_VERSION
shift; shift; continue
;;
--ver-xr-openxr)
XR_OPENXR_VERSION="$2"
XR_OPENXR_VERSION_MIN=$XR_OPENXR_VERSION
+ XR_OPENXR_VERSION_SHORT=$XR_OPENXR_VERSION
shift; shift; continue
;;
--build-all)
@@ -1005,6 +1060,8 @@ OIDN_SOURCE=( "https://github.com/OpenImageDenoise/oidn/releases/download/v${OID
#~ OIDN_REPO_UID="dabfd9c80101edae9d25a710160d12d6d963c591"
#~ OIDN_REPO_BRANCH="master"
+ISPC_BINARY=( "https://github.com/ispc/ispc/releases/download/v${ISPC_VERSION}/ispc-v${ISPC_VERSION}-linux.tar.gz" )
+
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
XR_OPENXR_USE_REPO=false
@@ -1030,7 +1087,7 @@ Those libraries should be available as packages in all recent distributions (opt
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
- * libsdl2, libglew, [libglewmx].\""
+ * libsdl2, libglew, [libgmp], [libglewmx].\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -1270,7 +1327,7 @@ _init_python() {
_src=$SRC/Python-$PYTHON_VERSION
_git=false
_inst=$INST/python-$PYTHON_VERSION
- _inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
+ _inst_shortcut=$INST/python-$PYTHON_VERSION_SHORT
}
_update_deps_python() {
@@ -1345,7 +1402,7 @@ compile_Python() {
INFO "If you want to force rebuild of this lib, use the --force-python option."
fi
- run_ldconfig "python-$PYTHON_VERSION_MIN"
+ run_ldconfig "python-$PYTHON_VERSION_SHORT"
}
# ----------------------------------------------------------------------------
@@ -1355,8 +1412,8 @@ _init_numpy() {
_src=$SRC/numpy-$NUMPY_VERSION
_git=false
_inst=$INST/numpy-$NUMPY_VERSION
- _python=$INST/python-$PYTHON_VERSION
- _site=lib/python$PYTHON_VERSION_MIN/site-packages
+ _python=$INST/python-$PYTHON_VERSION_SHORT
+ _site=lib/python$PYTHON_VERSION_SHORT/site-packages
_inst_shortcut=$_python/$_site/numpy
}
@@ -1435,7 +1492,7 @@ compile_Numpy() {
_init_boost() {
_src=$SRC/boost-$BOOST_VERSION
_git=false
- _inst=$INST/boost-$BOOST_VERSION
+ _inst=$INST/boost-$BOOST_VERSION_SHORT
_inst_shortcut=$INST/boost
}
@@ -1528,7 +1585,7 @@ compile_Boost() {
_init_tbb() {
_src=$SRC/TBB-$TBB_VERSION
_git=false
- _inst=$INST/tbb-$TBB_VERSION
+ _inst=$INST/tbb-$TBB_VERSION_SHORT
_inst_shortcut=$INST/tbb
}
@@ -1656,7 +1713,7 @@ _init_ocio() {
else
_git=false
fi
- _inst=$INST/ocio-$OCIO_VERSION
+ _inst=$INST/ocio-$OCIO_VERSION_SHORT
_inst_shortcut=$INST/ocio
}
@@ -1781,7 +1838,7 @@ compile_OCIO() {
_init_openexr() {
_src=$SRC/OpenEXR-$OPENEXR_VERSION
_git=false
- _inst=$INST/openexr-$OPENEXR_VERSION
+ _inst=$INST/openexr-$OPENEXR_VERSION_SHORT
_inst_shortcut=$INST/openexr
}
@@ -1911,7 +1968,7 @@ compile_OPENEXR() {
_init_oiio() {
_src=$SRC/OpenImageIO-$OIIO_VERSION
_git=true
- _inst=$INST/oiio-$OIIO_VERSION
+ _inst=$INST/oiio-$OIIO_VERSION_SHORT
_inst_shortcut=$INST/oiio
}
@@ -2066,7 +2123,7 @@ _init_llvm() {
_src=$SRC/LLVM-$LLVM_VERSION
_src_clang=$SRC/CLANG-$LLVM_VERSION
_git=false
- _inst=$INST/llvm-$LLVM_VERSION
+ _inst=$INST/llvm-$LLVM_VERSION_SHORT
_inst_shortcut=$INST/llvm
}
@@ -2178,7 +2235,7 @@ compile_LLVM() {
_init_osl() {
_src=$SRC/OpenShadingLanguage-$OSL_VERSION
_git=true
- _inst=$INST/osl-$OSL_VERSION
+ _inst=$INST/osl-$OSL_VERSION_SHORT
_inst_shortcut=$INST/osl
}
@@ -2323,7 +2380,7 @@ compile_OSL() {
_init_osd() {
_src=$SRC/OpenSubdiv-$OSD_VERSION
_git=true
- _inst=$INST/osd-$OSD_VERSION
+ _inst=$INST/osd-$OSD_VERSION_SHORT
_inst_shortcut=$INST/osd
}
@@ -2537,7 +2594,7 @@ compile_BLOSC() {
_init_openvdb() {
_src=$SRC/openvdb-$OPENVDB_VERSION
_git=false
- _inst=$INST/openvdb-$OPENVDB_VERSION
+ _inst=$INST/openvdb-$OPENVDB_VERSION_SHORT
_inst_shortcut=$INST/openvdb
}
@@ -2655,7 +2712,7 @@ compile_OPENVDB() {
_init_alembic() {
_src=$SRC/alembic-$ALEMBIC_VERSION
_git=false
- _inst=$INST/alembic-$ALEMBIC_VERSION
+ _inst=$INST/alembic-$ALEMBIC_VERSION_SHORT
_inst_shortcut=$INST/alembic
}
@@ -2760,7 +2817,7 @@ compile_ALEMBIC() {
_init_usd() {
_src=$SRC/USD-$USD_VERSION
_git=false
- _inst=$INST/usd-$USD_VERSION
+ _inst=$INST/usd-$USD_VERSION_SHORT
_inst_shortcut=$INST/usd
}
@@ -2859,7 +2916,7 @@ compile_USD() {
_init_opencollada() {
_src=$SRC/OpenCOLLADA-$OPENCOLLADA_VERSION
_git=true
- _inst=$INST/opencollada-$OPENCOLLADA_VERSION
+ _inst=$INST/opencollada-$OPENCOLLADA_VERSION_SHORT
_inst_shortcut=$INST/opencollada
}
@@ -2965,7 +3022,7 @@ compile_OpenCOLLADA() {
_init_embree() {
_src=$SRC/embree-$EMBREE_VERSION
_git=true
- _inst=$INST/embree-$EMBREE_VERSION
+ _inst=$INST/embree-$EMBREE_VERSION_SHORT
_inst_shortcut=$INST/embree
}
@@ -3075,10 +3132,83 @@ compile_Embree() {
# ----------------------------------------------------------------------------
# Build OpenImageDenoise
+_init_ispc() {
+ _src=$SRC/ispc-v$ISPC_VERSION
+ _inst=$INST/ispc-v$ISPC_VERSION
+ _inst_shortcut=$INST/ispc
+}
+
+_update_deps_ispc() {
+ OIDN_FORCE_REBUILD=true
+ if [ "$_is_building" = true ]; then
+ OIDN_FORCE_BUILD=true
+ fi
+}
+
+clean_ispc() {
+ _init_ispc
+ if [ -d $_inst ]; then
+ _update_deps_ispc
+ fi
+ _clean
+}
+
+install_ISPC() {
+ # To be changed each time we make edits that would modify the compiled results!
+ ispc_magic=0
+ _init_ispc
+
+ # Clean install if needed!
+ magic_compile_check ispc-$ISPC_VERSION $ispc_magic
+ if [ $? -eq 1 ]; then
+ clean_ispc
+ fi
+
+ if [ ! -d $_inst ]; then
+ INFO "Installing Implicit SPMD Program Compiler v$ISPC_VERSION"
+ _is_building=true
+
+ # Rebuild dependencies as well!
+ _update_deps_ispc
+
+ prepare_opt
+
+ if [ ! -d $_src ]; then
+ mkdir -p $SRC
+ download ISPC_BINARY[@] "$_src.tar.gz"
+ INFO "Unpacking ISPC-v$ISPC_VERSION"
+ tar -C $SRC --transform "s,(.*/?)ispc-v$ISPC_VERSION-linux[^/]*(.*),\1ispc-v$ISPC_VERSION\2,x" \
+ -xf $_src.tar.gz
+ fi
+
+ mkdir -p $_inst
+ cp -r $_src/bin $_inst/bin
+
+ if [ -d $_inst ]; then
+ _create_inst_shortcut
+ else
+ ERROR "ISPC-v$ISPC_VERSION failed to install, exiting"
+ exit 1
+ fi
+
+ magic_compile_set ispc-$ISPC_VERSION $ispc_magic
+
+ cd $CWD
+ INFO "Done compiling ISPC-v$ISPC_VERSION!"
+ _is_building=false
+ else
+ INFO "Own ISPC-v$ISPC_VERSION is up to date, nothing to do!"
+ fi
+
+ _ispc_path_bin=$_inst/bin
+ run_ldconfig "ispc"
+}
+
+
_init_oidn() {
_src=$SRC/oidn-$OIDN_VERSION
_git=true
- _inst=$INST/oidn-$OIDN_VERSION
+ _inst=$INST/oidn-$OIDN_VERSION_SHORT
_inst_shortcut=$INST/oidn
}
@@ -3100,6 +3230,9 @@ compile_OIDN() {
return
fi
+ # Latest OIDN requires ISPC compiler tool...
+ install_ISPC
+
# To be changed each time we make edits that would modify the compiled results!
oidn_magic=9
_init_oidn
@@ -3152,6 +3285,7 @@ compile_OIDN() {
cmake_d="$cmake_d -D WITH_EXAMPLE=OFF"
cmake_d="$cmake_d -D WITH_TEST=OFF"
cmake_d="$cmake_d -D OIDN_STATIC_LIB=ON"
+ cmake_d="$cmake_d -D ISPC_DIR_HINT=$_ispc_path_bin"
if [ -d $INST/tbb ]; then
make_d="$make_d TBB_ROOT=$INST/tbb"
@@ -3187,7 +3321,7 @@ compile_OIDN() {
_init_ffmpeg() {
_src=$SRC/ffmpeg-$FFMPEG_VERSION
- _inst=$INST/ffmpeg-$FFMPEG_VERSION
+ _inst=$INST/ffmpeg-$FFMPEG_VERSION_SHORT
_inst_shortcut=$INST/ffmpeg
}
@@ -3316,7 +3450,7 @@ compile_FFmpeg() {
_init_xr_openxr_sdk() {
_src=$SRC/XR-OpenXR-SDK-$XR_OPENXR_VERSION
_git=true
- _inst=$INST/xr-openxr-sdk-$XR_OPENXR_VERSION
+ _inst=$INST/xr-openxr-sdk-$XR_OPENXR_VERSION_SHORT
_inst_shortcut=$INST/xr-openxr-sdk
}
@@ -3524,7 +3658,8 @@ install_DEB() {
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
- libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
+ libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
+ libgmp-dev"
# libglewmx-dev (broken in deb testing currently...)
VORBIS_USE=true
@@ -3554,13 +3689,18 @@ install_DEB() {
PRINT ""
CLANG_FORMAT="clang-format"
- check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
+ check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION
if [ $? -eq 0 ]; then
_packages="$_packages $CLANG_FORMAT"
else
- PRINT ""
- WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
- PRINT ""
+ check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
+ if [ $? -eq 0 ]; then
+ _packages="$_packages $CLANG_FORMAT"
+ else
+ PRINT ""
+ WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
+ PRINT ""
+ fi
fi
if [ "$WITH_JACK" = true ]; then
@@ -3675,7 +3815,7 @@ install_DEB() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
- check_package_version_ge_DEB python3-dev $PYTHON_VERSION_MIN
+ check_package_version_ge_lt_DEB python3-dev $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -3717,7 +3857,7 @@ install_DEB() {
INFO "Forced Boost building, as requested..."
compile_Boost
else
- check_package_version_ge_DEB libboost-dev $BOOST_VERSION_MIN
+ check_package_version_ge_lt_DEB libboost-dev $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libboost-dev
@@ -3738,7 +3878,7 @@ install_DEB() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
- check_package_version_ge_DEB libtbb-dev $TBB_VERSION_MIN
+ check_package_version_ge_lt_DEB libtbb-dev $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libtbb-dev
clean_TBB
@@ -3755,14 +3895,13 @@ install_DEB() {
INFO "Forced OpenColorIO building, as requested..."
compile_OCIO
else
- # XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)!
- #check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
- #if [ $? -eq 0 ]; then
- #install_packages_DEB libopencolorio-dev
- #clean_OCIO
- #else
+ check_package_version_ge_lt_DEB libopencolorio-dev $OCIO_VERSION_MIN $OCIO_VERSION_MAX
+ if [ $? -eq 0 ]; then
+ install_packages_DEB libopencolorio-dev
+ clean_OCIO
+ else
compile_OCIO
- #fi
+ fi
fi
@@ -3773,7 +3912,7 @@ install_DEB() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
- check_package_version_ge_DEB libopenexr-dev $OPENEXR_VERSION_MIN
+ check_package_version_ge_lt_DEB libopenexr-dev $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopenexr-dev
OPENEXR_VERSION=`get_package_version_DEB libopenexr-dev`
@@ -3792,14 +3931,13 @@ install_DEB() {
INFO "Forced OpenImageIO building, as requested..."
compile_OIIO
else
- # XXX Debian Testing / Ubuntu 16.04 pulls in WAY too many deps (gtk2/opencv ?!) incl. OCIO build against libyaml-cpp0.3 so build for now...
- #check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
- #if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
- # install_packages_DEB libopenimageio-dev
- # clean_OIIO
- #else
+ check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX
+ if [ $? -eq 0 -a "$_with_built_openexr" = false ]; then
+ install_packages_DEB libopenimageio-dev
+ clean_OIIO
+ else
compile_OIIO
- #fi
+ fi
fi
@@ -3813,11 +3951,12 @@ install_DEB() {
INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true
else
- check_package_DEB clang-$LLVM_VERSION_MIN
+ check_package_version_ge_lt_DEB llvm-dev $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
- install_packages_DEB llvm-$LLVM_VERSION_MIN-dev clang-$LLVM_VERSION_MIN
+ install_packages_DEB llvm-dev clang
have_llvm=true
- LLVM_VERSION_FOUND=$LLVM_VERSION_MIN
+ LLVM_VERSION=`get_package_version_DEB llvm-dev`
+ LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
_do_compile_llvm=true
@@ -3843,8 +3982,13 @@ install_DEB() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
- # No package currently!
- _do_compile_osl=true
+ check_package_version_ge_lt_DEB libopenshadinglanguage-dev $OSL_VERSION_MIN $OSL_VERSION_MAX
+ if [ $? -eq 0 ]; then
+ install_packages_DEB libopenshadinglanguage-dev
+ clean_OSL
+ else
+ _do_compile_osl=true
+ fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -3876,7 +4020,7 @@ install_DEB() {
INFO "Forced OpenVDB building, as requested..."
compile_OPENVDB
else
- check_package_version_ge_DEB libopenvdb-dev $OPENVDB_VERSION_MIN
+ check_package_version_ge_lt_DEB libopenvdb-dev $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libopenvdb-dev libblosc-dev
clean_OPENVDB
@@ -3937,8 +4081,14 @@ install_DEB() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
- # No package currently!
- _do_compile_embree=true
+ # There is a package, but it does not provide everything that Blender needs...
+ #~ check_package_version_ge_lt_DEB libembree-dev $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
+ #~ if [ $? -eq 0 ]; then
+ #~ install_packages_DEB libembree-dev
+ #~ clean_Embree
+ #~ else
+ _do_compile_embree=true
+ #~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -3974,7 +4124,7 @@ install_DEB() {
# XXX Debian Testing / Ubuntu 16.04 finally includes FFmpeg, so check as usual
check_package_DEB ffmpeg
if [ $? -eq 0 ]; then
- check_package_version_ge_DEB ffmpeg $FFMPEG_VERSION_MIN
+ check_package_version_ge_lt_DEB ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_DEB libavdevice-dev
clean_FFmpeg
@@ -4175,7 +4325,7 @@ install_RPM() {
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
- libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel"
+ libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel gmp-devel"
OPENJPEG_USE=true
VORBIS_USE=true
@@ -4298,7 +4448,7 @@ install_RPM() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
- check_package_version_ge_RPM python3-devel $PYTHON_VERSION_MIN
+ check_package_version_ge_lt_RPM python3-devel $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -4308,7 +4458,7 @@ install_RPM() {
if [ "$NUMPY_SKIP" = true ]; then
WARNING "Skipping NumPy installation, as requested..."
else
- check_package_version_ge_RPM python3-numpy $NUMPY_VERSION_MIN
+ check_package_version_ge_lt_RPM python3-numpy $NUMPY_VERSION_MIN $NUMPY_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM python3-numpy
else
@@ -4341,7 +4491,7 @@ install_RPM() {
INFO "Forced Boost building, as requested..."
_do_compile_boost=true
else
- check_package_version_ge_RPM boost-devel $BOOST_VERSION_MIN
+ check_package_version_ge_lt_RPM boost-devel $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM boost-devel
clean_Boost
@@ -4368,7 +4518,7 @@ install_RPM() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
- check_package_version_ge_RPM tbb-devel $TBB_VERSION_MIN
+ check_package_version_ge_lt_RPM tbb-devel $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM tbb-devel
clean_TBB
@@ -4386,7 +4536,7 @@ install_RPM() {
compile_OCIO
else
if [ "$RPM" = "SUSE" ]; then
- check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN
+ check_package_version_ge_lt_RPM OpenColorIO-devel $OCIO_VERSION_MIN $OCIO_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM OpenColorIO-devel
clean_OCIO
@@ -4406,7 +4556,7 @@ install_RPM() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
- check_package_version_ge_RPM openexr-devel $OPENEXR_VERSION_MIN
+ check_package_version_ge_lt_RPM openexr-devel $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM openexr-devel
OPENEXR_VERSION=`get_package_version_RPM openexr-devel`
@@ -4424,7 +4574,6 @@ install_RPM() {
INFO "Forced OpenImageIO building, as requested..."
compile_OIIO
else
- # XXX RPM distros pulls in too much and depends on old libs, so better to build for now...
#check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX
#if [ $? -eq 0 -a $_with_built_openexr == false ]; then
# install_packages_RPM OpenImageIO-devel
@@ -4450,10 +4599,11 @@ install_RPM() {
else
CLANG_DEV="clang-devel"
fi
- check_package_version_match_RPM $CLANG_DEV $LLVM_VERSION
+ check_package_version_ge_lt_RPM llvm-devel $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM llvm-devel $CLANG_DEV
have_llvm=true
+ LLVM_VERSION=`get_package_version_RPM llvm-devel`
LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM
else
@@ -4480,8 +4630,18 @@ install_RPM() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
- # No package currently!
- _do_compile_osl=true
+ if [ "$RPM" = "SUSE" ]; then
+ OSL_DEV="OpenShadingLanguage-devel"
+ else
+ OSL_DEV="openshadinglanguage-devel"
+ fi
+ check_package_version_ge_lt_RPM $OSL_DEV $OSL_VERSION_MIN $OSL_VERSION_MAX
+ if [ $? -eq 0 ]; then
+ install_packages_RPM $OSL_DEV
+ clean_OSL
+ else
+ _do_compile_osl=true
+ fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -4569,8 +4729,14 @@ install_RPM() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
- # No package...
- _do_compile_embree=true
+ # There is a package, but it does not provide everything that Blender needs...
+ #~ check_package_version_ge_lt_RPM embree-devel $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
+ #~ if [ $? -eq 0 ]; then
+ #~ install_packages_RPM embree-devel
+ #~ clean_Embree
+ #~ else
+ _do_compile_embree=true
+ #~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -4603,7 +4769,7 @@ install_RPM() {
INFO "Forced FFMpeg building, as requested..."
compile_FFmpeg
else
- check_package_version_ge_RPM ffmpeg-devel $FFMPEG_VERSION_MIN
+ check_package_version_ge_lt_RPM ffmpeg-devel $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_RPM ffmpeg ffmpeg-devel
clean_FFmpeg
@@ -4735,7 +4901,7 @@ install_ARCH() {
_packages="$BASE_DEVEL git cmake \
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
- libxml2 yaml-cpp tinyxml python-requests jemalloc"
+ libxml2 yaml-cpp tinyxml python-requests jemalloc gmp"
OPENJPEG_USE=true
VORBIS_USE=true
@@ -4823,7 +4989,7 @@ install_ARCH() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
- check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
+ check_package_version_ge_lt_ARCH python $PYTHON_VERSION_MIN $PYTHON_VERSION_MAX
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
@@ -4833,7 +4999,7 @@ install_ARCH() {
if [ "$NUMPY_SKIP" = true ]; then
WARNING "Skipping NumPy installation, as requested..."
else
- check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN
+ check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN $NUMPY_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH python-numpy
else
@@ -4865,7 +5031,7 @@ install_ARCH() {
INFO "Forced Boost building, as requested..."
compile_Boost
else
- check_package_version_ge_ARCH boost $BOOST_VERSION_MIN
+ check_package_version_ge_lt_ARCH boost $BOOST_VERSION_MIN $BOOST_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH boost
clean_Boost
@@ -4882,7 +5048,7 @@ install_ARCH() {
INFO "Forced TBB building, as requested..."
compile_TBB
else
- check_package_version_ge_ARCH intel-tbb $TBB_VERSION_MIN
+ check_package_version_ge_lt_ARCH intel-tbb $TBB_VERSION_MIN $TBB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH intel-tbb
clean_TBB
@@ -4899,7 +5065,7 @@ install_ARCH() {
INFO "Forced OpenColorIO building, as requested..."
compile_OCIO
else
- check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
+ check_package_version_ge_lt_ARCH opencolorio $OCIO_VERSION_MIN $OCIO_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH opencolorio
clean_OCIO
@@ -4916,7 +5082,7 @@ install_ARCH() {
INFO "Forced ILMBase/OpenEXR building, as requested..."
compile_OPENEXR
else
- check_package_version_ge_ARCH openexr $OPENEXR_VERSION_MIN
+ check_package_version_ge_lt_ARCH openexr $OPENEXR_VERSION_MIN $OPENEXR_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH openexr
OPENEXR_VERSION=`get_package_version_ARCH openexr`
@@ -4955,7 +5121,7 @@ install_ARCH() {
INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true
else
- check_package_version_match_ARCH llvm $LLVM_VERSION_MIN
+ check_package_version_ge_lt_ARCH llvm $LLVM_VERSION_MIN $LLVM_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH llvm clang
have_llvm=true
@@ -4986,14 +5152,13 @@ install_ARCH() {
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
else
- # XXX Compile for now due to requirement of LLVM 3.4 ...
- #check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
- #if [ $? -eq 0 ]; then
- # install_packages_ARCH openshadinglanguage
- # clean_OSL
- #else
+ check_package_version_ge_lt_ARCH openshadinglanguage $OSL_VERSION_MIN $OSL_VERSION_MAX
+ if [ $? -eq 0 ]; then
+ install_packages_ARCH openshadinglanguage
+ clean_OSL
+ else
_do_compile_osl=true
- #fi
+ fi
fi
if [ "$_do_compile_osl" = true ]; then
@@ -5013,7 +5178,7 @@ install_ARCH() {
INFO "Forced OpenSubdiv building, as requested..."
compile_OSD
else
- check_package_version_ge_ARCH opensubdiv $OSD_VERSION_MIN
+ check_package_version_ge_lt_ARCH opensubdiv $OSD_VERSION_MIN $OSD_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH opensubdiv
clean_OSD
@@ -5030,7 +5195,7 @@ install_ARCH() {
INFO "Forced OpenVDB building, as requested..."
compile_OPENVDB
else
- check_package_version_ge_ARCH openvdb $OPENVDB_VERSION_MIN
+ check_package_version_ge_lt_ARCH openvdb $OPENVDB_VERSION_MIN $OPENVDB_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH openvdb
clean_OPENVDB
@@ -5095,13 +5260,14 @@ install_ARCH() {
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
else
- check_package_ARCH embree
- if [ $? -eq 0 ]; then
- install_packages_ARCH embree
- clean_Embree
- else
+ # There is a package, but it does not provide everything that Blender needs...
+ #~ check_package_version_ge_lt_ARCH embree $EMBREE_VERSION_MIN $EMBREE_VERSION_MAX
+ #~ if [ $? -eq 0 ]; then
+ #~ install_packages_ARCH embree
+ #~ clean_Embree
+ #~ else
_do_compile_embree=true
- fi
+ #~ fi
fi
if [ "$_do_compile_embree" = true ]; then
@@ -5134,7 +5300,7 @@ install_ARCH() {
INFO "Forced FFMpeg building, as requested..."
compile_FFmpeg
else
- check_package_version_ge_ARCH ffmpeg $FFMPEG_VERSION_MIN
+ check_package_version_ge_lt_ARCH ffmpeg $FFMPEG_VERSION_MIN $FFMPEG_VERSION_MAX
if [ $? -eq 0 ]; then
install_packages_ARCH ffmpeg
clean_FFmpeg
@@ -5412,6 +5578,7 @@ print_info() {
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
+ _buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
_1="-D WITH_CODEC_SNDFILE=ON"
PRINT " $_1"
diff --git a/build_files/build_environment/patches/cmakelists_gmpxx.txt b/build_files/build_environment/patches/cmakelists_gmpxx.txt
new file mode 100644
index 00000000000..5aa6c404035
--- /dev/null
+++ b/build_files/build_environment/patches/cmakelists_gmpxx.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.1)
+project(libgmpxx)
+
+include_directories(. cxx ${GMP_INCLUDE_DIR})
+add_definitions(-D__GMP_WITHIN_GMPXX)
+add_library(libgmpxx SHARED
+ cxx/dummy.cc
+ cxx/isfuns.cc
+ cxx/ismpf.cc
+ cxx/ismpq.cc
+ cxx/ismpz.cc
+ cxx/ismpznw.cc
+ cxx/limits.cc
+ cxx/osdoprnti.cc
+ cxx/osfuns.cc
+ cxx/osmpf.cc
+ cxx/osmpq.cc
+ cxx/osmpz.cc
+)
+
+target_link_libraries(libgmpxx ${GMP_LIBRARY})
+install(TARGETS libgmpxx DESTINATION lib)
diff --git a/build_files/build_environment/patches/config_gmpxx.h b/build_files/build_environment/patches/config_gmpxx.h
new file mode 100644
index 00000000000..842d6d5d240
--- /dev/null
+++ b/build_files/build_environment/patches/config_gmpxx.h
@@ -0,0 +1,668 @@
+/* config.h. Generated from config.in by configure. */
+/* config.in. Generated from configure.ac by autoheader. */
+
+/*
+
+Copyright 1996-2020 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your
+ option) any later version.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/.
+*/
+
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
+/* The gmp-mparam.h file (a string) the tune program should suggest updating.
+ */
+#define GMP_MPARAM_H_SUGGEST "./mpn/x86_64/coreisbr/gmp-mparam.h"
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define to 1 if alloca() works (via gmp-impl.h). */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((const)) */
+//#define HAVE_ATTRIBUTE_CONST 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((malloc)) */
+//#define HAVE_ATTRIBUTE_MALLOC 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((mode (XX)))
+ */
+//#define HAVE_ATTRIBUTE_MODE 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((noreturn)) */
+//#define HAVE_ATTRIBUTE_NORETURN 1
+
+/* Define to 1 if you have the `attr_get' function. */
+/* #undef HAVE_ATTR_GET */
+
+/* Define to 1 if tests/libtests has calling conventions checking for the CPU
+ */
+/* #undef HAVE_CALLING_CONVENTIONS */
+
+/* Define to 1 if you have the `clock' function. */
+#define HAVE_CLOCK 1
+
+/* Define to 1 if you have the `clock_gettime' function */
+/* #undef HAVE_CLOCK_GETTIME */
+
+/* Define to 1 if you have the `cputime' function. */
+/* #undef HAVE_CPUTIME */
+
+/* Define to 1 if you have the declaration of `fgetc', and to 0 if you don't.
+ */
+#define HAVE_DECL_FGETC 1
+
+/* Define to 1 if you have the declaration of `fscanf', and to 0 if you don't.
+ */
+#define HAVE_DECL_FSCANF 1
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#define HAVE_DECL_OPTARG 1
+
+/* Define to 1 if you have the declaration of `sys_errlist', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_ERRLIST 0
+
+/* Define to 1 if you have the declaration of `sys_nerr', and to 0 if you
+ don't. */
+#define HAVE_DECL_SYS_NERR 0
+
+/* Define to 1 if you have the declaration of `ungetc', and to 0 if you don't.
+ */
+#define HAVE_DECL_UNGETC 1
+
+/* Define to 1 if you have the declaration of `vfprintf', and to 0 if you
+ don't. */
+#define HAVE_DECL_VFPRINTF 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define one of the following to 1 for the format of a `double'.
+ If your format is not among these choices, or you don't know what it is,
+ then leave all undefined.
+ IEEE_LITTLE_SWAPPED means little endian, but with the two 4-byte halves
+ swapped, as used by ARM CPUs in little endian mode. */
+/* #undef HAVE_DOUBLE_IEEE_BIG_ENDIAN */
+#define HAVE_DOUBLE_IEEE_LITTLE_ENDIAN 1
+/* #undef HAVE_DOUBLE_IEEE_LITTLE_SWAPPED */
+/* #undef HAVE_DOUBLE_VAX_D */
+/* #undef HAVE_DOUBLE_VAX_G */
+/* #undef HAVE_DOUBLE_CRAY_CFP */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#define HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `getpagesize' function. */
+#define HAVE_GETPAGESIZE 1
+
+/* Define to 1 if you have the `getrusage' function. */
+/* #undef HAVE_GETRUSAGE */
+
+/* Define to 1 if you have the `getsysinfo' function. */
+/* #undef HAVE_GETSYSINFO */
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if the compiler accepts gcc style __attribute__ ((visibility))
+ and __attribute__ ((alias)) */
+#define HAVE_HIDDEN_ALIAS 1
+
+/* Define one of these to 1 for the host CPU family.
+ If your CPU is not in any of these families, leave all undefined.
+ For an AMD64 chip, define "x86" in ABI=32, but not in ABI=64. */
+/* #undef HAVE_HOST_CPU_FAMILY_alpha */
+/* #undef HAVE_HOST_CPU_FAMILY_m68k */
+/* #undef HAVE_HOST_CPU_FAMILY_power */
+/* #undef HAVE_HOST_CPU_FAMILY_powerpc */
+/* #undef HAVE_HOST_CPU_FAMILY_x86 */
+#define HAVE_HOST_CPU_FAMILY_x86_64 1
+
+/* Define one of the following to 1 for the host CPU, as per the output of
+ ./config.guess. If your CPU is not listed here, leave all undefined. */
+/* #undef HAVE_HOST_CPU_alphaev67 */
+/* #undef HAVE_HOST_CPU_alphaev68 */
+/* #undef HAVE_HOST_CPU_alphaev7 */
+/* #undef HAVE_HOST_CPU_m68020 */
+/* #undef HAVE_HOST_CPU_m68030 */
+/* #undef HAVE_HOST_CPU_m68040 */
+/* #undef HAVE_HOST_CPU_m68060 */
+/* #undef HAVE_HOST_CPU_m68360 */
+/* #undef HAVE_HOST_CPU_powerpc604 */
+/* #undef HAVE_HOST_CPU_powerpc604e */
+/* #undef HAVE_HOST_CPU_powerpc750 */
+/* #undef HAVE_HOST_CPU_powerpc7400 */
+/* #undef HAVE_HOST_CPU_supersparc */
+/* #undef HAVE_HOST_CPU_i386 */
+/* #undef HAVE_HOST_CPU_i586 */
+/* #undef HAVE_HOST_CPU_i686 */
+/* #undef HAVE_HOST_CPU_pentium */
+/* #undef HAVE_HOST_CPU_pentiummmx */
+/* #undef HAVE_HOST_CPU_pentiumpro */
+/* #undef HAVE_HOST_CPU_pentium2 */
+/* #undef HAVE_HOST_CPU_pentium3 */
+/* #undef HAVE_HOST_CPU_pentium4 */
+/* #undef HAVE_HOST_CPU_core2 */
+/* #undef HAVE_HOST_CPU_nehalem */
+/* #undef HAVE_HOST_CPU_westmere */
+/* #undef HAVE_HOST_CPU_sandybridge */
+#define HAVE_HOST_CPU_ivybridge 1
+/* #undef HAVE_HOST_CPU_haswell */
+/* #undef HAVE_HOST_CPU_broadwell */
+/* #undef HAVE_HOST_CPU_skylake */
+/* #undef HAVE_HOST_CPU_silvermont */
+/* #undef HAVE_HOST_CPU_goldmont */
+/* #undef HAVE_HOST_CPU_k8 */
+/* #undef HAVE_HOST_CPU_k10 */
+/* #undef HAVE_HOST_CPU_bulldozer */
+/* #undef HAVE_HOST_CPU_piledriver */
+/* #undef HAVE_HOST_CPU_steamroller */
+/* #undef HAVE_HOST_CPU_excavator */
+/* #undef HAVE_HOST_CPU_zen */
+/* #undef HAVE_HOST_CPU_bobcat */
+/* #undef HAVE_HOST_CPU_jaguar */
+/* #undef HAVE_HOST_CPU_s390_z900 */
+/* #undef HAVE_HOST_CPU_s390_z990 */
+/* #undef HAVE_HOST_CPU_s390_z9 */
+/* #undef HAVE_HOST_CPU_s390_z10 */
+/* #undef HAVE_HOST_CPU_s390_z196 */
+
+/* Define to 1 iff we have a s390 with 64-bit registers. */
+/* #undef HAVE_HOST_CPU_s390_zarch */
+
+/* Define to 1 if the system has the type `intmax_t'. */
+#define HAVE_INTMAX_T 1
+
+/* Define to 1 if the system has the type `intptr_t'. */
+#define HAVE_INTPTR_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <invent.h> header file. */
+/* #undef HAVE_INVENT_H */
+
+/* Define to 1 if you have the <langinfo.h> header file. */
+/* #undef HAVE_LANGINFO_H */
+
+/* Define one of these to 1 for the endianness of `mp_limb_t'.
+ If the endianness is not a simple big or little, or you don't know what
+ it is, then leave both undefined. */
+/* #undef HAVE_LIMB_BIG_ENDIAN */
+#define HAVE_LIMB_LITTLE_ENDIAN 1
+
+/* Define to 1 if you have the `localeconv' function. */
+#define HAVE_LOCALECONV 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define to 1 if the system has the type `long double'. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define to 1 if the system has the type `long long'. */
+#define HAVE_LONG_LONG 1
+
+/* Define to 1 if you have the <machine/hal_sysinfo.h> header file. */
+/* #undef HAVE_MACHINE_HAL_SYSINFO_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mmap' function. */
+/* #undef HAVE_MMAP */
+
+/* Define to 1 if you have the `mprotect' function. */
+#define HAVE_MPROTECT 1
+
+/* Define to 1 each of the following for which a native (ie. CPU specific)
+ implementation of the corresponding routine exists. */
+#define HAVE_NATIVE_mpn_add_n 1
+/* #undef HAVE_NATIVE_mpn_add_n_sub_n */
+#define HAVE_NATIVE_mpn_add_nc 1
+/* #undef HAVE_NATIVE_mpn_addaddmul_1msb0 */
+#define HAVE_NATIVE_mpn_addlsh1_n 1
+#define HAVE_NATIVE_mpn_addlsh2_n 1
+#define HAVE_NATIVE_mpn_addlsh_n 1
+#define HAVE_NATIVE_mpn_addlsh1_nc 1
+#define HAVE_NATIVE_mpn_addlsh2_nc 1
+#define HAVE_NATIVE_mpn_addlsh_nc 1
+/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh_n_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh1_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh2_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addlsh_nc_ip2 */
+/* #undef HAVE_NATIVE_mpn_addmul_1c */
+#define HAVE_NATIVE_mpn_addmul_2 1
+/* #undef HAVE_NATIVE_mpn_addmul_3 */
+/* #undef HAVE_NATIVE_mpn_addmul_4 */
+/* #undef HAVE_NATIVE_mpn_addmul_5 */
+/* #undef HAVE_NATIVE_mpn_addmul_6 */
+/* #undef HAVE_NATIVE_mpn_addmul_7 */
+/* #undef HAVE_NATIVE_mpn_addmul_8 */
+/* #undef HAVE_NATIVE_mpn_addmul_2s */
+#define HAVE_NATIVE_mpn_and_n 1
+#define HAVE_NATIVE_mpn_andn_n 1
+#define HAVE_NATIVE_mpn_bdiv_dbm1c 1
+#define HAVE_NATIVE_mpn_bdiv_q_1 1
+#define HAVE_NATIVE_mpn_pi1_bdiv_q_1 1
+#define HAVE_NATIVE_mpn_cnd_add_n 1
+#define HAVE_NATIVE_mpn_cnd_sub_n 1
+#define HAVE_NATIVE_mpn_com 1
+#define HAVE_NATIVE_mpn_copyd 1
+#define HAVE_NATIVE_mpn_copyi 1
+/* #undef HAVE_NATIVE_mpn_div_qr_1n_pi1 */
+/* #undef HAVE_NATIVE_mpn_div_qr_2 */
+#define HAVE_NATIVE_mpn_divexact_1 1
+/* #undef HAVE_NATIVE_mpn_divexact_by3c */
+#define HAVE_NATIVE_mpn_divrem_1 1
+/* #undef HAVE_NATIVE_mpn_divrem_1c */
+#define HAVE_NATIVE_mpn_divrem_2 1
+/* #undef HAVE_NATIVE_mpn_gcd_1 */
+#define HAVE_NATIVE_mpn_gcd_11 1
+/* #undef HAVE_NATIVE_mpn_gcd_22 */
+#define HAVE_NATIVE_mpn_hamdist 1
+#define HAVE_NATIVE_mpn_invert_limb 1
+#define HAVE_NATIVE_mpn_ior_n 1
+#define HAVE_NATIVE_mpn_iorn_n 1
+#define HAVE_NATIVE_mpn_lshift 1
+#define HAVE_NATIVE_mpn_lshiftc 1
+/* #undef HAVE_NATIVE_mpn_lshsub_n */
+/* #undef HAVE_NATIVE_mpn_mod_1 */
+#define HAVE_NATIVE_mpn_mod_1_1p 1
+/* #undef HAVE_NATIVE_mpn_mod_1c */
+#define HAVE_NATIVE_mpn_mod_1s_2p 1
+#define HAVE_NATIVE_mpn_mod_1s_4p 1
+#define HAVE_NATIVE_mpn_mod_34lsub1 1
+#define HAVE_NATIVE_mpn_modexact_1_odd 1
+#define HAVE_NATIVE_mpn_modexact_1c_odd 1
+#define HAVE_NATIVE_mpn_mul_1 1
+#define HAVE_NATIVE_mpn_mul_1c 1
+#define HAVE_NATIVE_mpn_mul_2 1
+/* #undef HAVE_NATIVE_mpn_mul_3 */
+/* #undef HAVE_NATIVE_mpn_mul_4 */
+/* #undef HAVE_NATIVE_mpn_mul_5 */
+/* #undef HAVE_NATIVE_mpn_mul_6 */
+#define HAVE_NATIVE_mpn_mul_basecase 1
+#define HAVE_NATIVE_mpn_mullo_basecase 1
+#define HAVE_NATIVE_mpn_nand_n 1
+#define HAVE_NATIVE_mpn_nior_n 1
+#define HAVE_NATIVE_mpn_popcount 1
+#define HAVE_NATIVE_mpn_preinv_divrem_1 1
+/* #undef HAVE_NATIVE_mpn_preinv_mod_1 */
+#define HAVE_NATIVE_mpn_redc_1 1
+/* #undef HAVE_NATIVE_mpn_redc_2 */
+#define HAVE_NATIVE_mpn_rsblsh1_n 1
+#define HAVE_NATIVE_mpn_rsblsh2_n 1
+#define HAVE_NATIVE_mpn_rsblsh_n 1
+#define HAVE_NATIVE_mpn_rsblsh1_nc 1
+/* #undef HAVE_NATIVE_mpn_rsblsh2_nc */
+/* #undef HAVE_NATIVE_mpn_rsblsh_nc */
+#define HAVE_NATIVE_mpn_rsh1add_n 1
+#define HAVE_NATIVE_mpn_rsh1add_nc 1
+#define HAVE_NATIVE_mpn_rsh1sub_n 1
+#define HAVE_NATIVE_mpn_rsh1sub_nc 1
+#define HAVE_NATIVE_mpn_rshift 1
+/* #undef HAVE_NATIVE_mpn_sbpi1_bdiv_r */
+#define HAVE_NATIVE_mpn_sqr_basecase 1
+/* #undef HAVE_NATIVE_mpn_sqr_diagonal */
+#define HAVE_NATIVE_mpn_sqr_diag_addlsh1 1
+#define HAVE_NATIVE_mpn_sub_n 1
+#define HAVE_NATIVE_mpn_sub_nc 1
+#define HAVE_NATIVE_mpn_sublsh1_n 1
+#define HAVE_NATIVE_mpn_sublsh2_n 1
+/* #undef HAVE_NATIVE_mpn_sublsh_n */
+/* #undef HAVE_NATIVE_mpn_sublsh1_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh2_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh_nc */
+/* #undef HAVE_NATIVE_mpn_sublsh1_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh2_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh_n_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh1_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh2_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_sublsh_nc_ip1 */
+/* #undef HAVE_NATIVE_mpn_submul_1c */
+/* #undef HAVE_NATIVE_mpn_tabselect */
+/* #undef HAVE_NATIVE_mpn_udiv_qrnnd */
+/* #undef HAVE_NATIVE_mpn_udiv_qrnnd_r */
+/* #undef HAVE_NATIVE_mpn_umul_ppmm */
+/* #undef HAVE_NATIVE_mpn_umul_ppmm_r */
+#define HAVE_NATIVE_mpn_xor_n 1
+#define HAVE_NATIVE_mpn_xnor_n 1
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+/* #undef HAVE_NL_LANGINFO */
+
+/* Define to 1 if you have the <nl_types.h> header file. */
+/* #undef HAVE_NL_TYPES_H */
+
+/* Define to 1 if you have the `obstack_vprintf' function. */
+/* #undef HAVE_OBSTACK_VPRINTF */
+
+/* Define to 1 if you have the `popen' function. */
+#define HAVE_POPEN 1
+
+/* Define to 1 if you have the `processor_info' function. */
+/* #undef HAVE_PROCESSOR_INFO */
+
+/* Define to 1 if <sys/pstat.h> `struct pst_processor' exists and contains
+ `psp_iticksperclktick'. */
+/* #undef HAVE_PSP_ITICKSPERCLKTICK */
+
+/* Define to 1 if you have the `pstat_getprocessor' function. */
+/* #undef HAVE_PSTAT_GETPROCESSOR */
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#define HAVE_PTRDIFF_T 1
+
+/* Define to 1 if the system has the type `quad_t'. */
+/* #undef HAVE_QUAD_T */
+
+/* Define to 1 if you have the `raise' function. */
+#define HAVE_RAISE 1
+
+/* Define to 1 if you have the `read_real_time' function. */
+/* #undef HAVE_READ_REAL_TIME */
+
+/* Define to 1 if you have the `sigaction' function. */
+/* #undef HAVE_SIGACTION */
+
+/* Define to 1 if you have the `sigaltstack' function. */
+/* #undef HAVE_SIGALTSTACK */
+
+/* Define to 1 if you have the `sigstack' function. */
+/* #undef HAVE_SIGSTACK */
+
+/* Tune directory speed_cyclecounter, undef=none, 1=32bits, 2=64bits) */
+#define HAVE_SPEED_CYCLECOUNTER 2
+
+/* Define to 1 if you have the <sstream> header file. */
+#define HAVE_SSTREAM 1
+
+/* Define to 1 if the system has the type `stack_t'. */
+/* #undef HAVE_STACK_T */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if the system has the type `std::locale'. */
+#define HAVE_STD__LOCALE 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strnlen' function. */
+#define HAVE_STRNLEN 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if you have the `sysconf' function. */
+/* #undef HAVE_SYSCONF */
+
+/* Define to 1 if you have the `sysctl' function. */
+/* #undef HAVE_SYSCTL */
+
+/* Define to 1 if you have the `sysctlbyname' function. */
+/* #undef HAVE_SYSCTLBYNAME */
+
+/* Define to 1 if you have the `syssgi' function. */
+/* #undef HAVE_SYSSGI */
+
+/* Define to 1 if you have the <sys/attributes.h> header file. */
+/* #undef HAVE_SYS_ATTRIBUTES_H */
+
+/* Define to 1 if you have the <sys/iograph.h> header file. */
+/* #undef HAVE_SYS_IOGRAPH_H */
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+/* #undef HAVE_SYS_MMAN_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/processor.h> header file. */
+/* #undef HAVE_SYS_PROCESSOR_H */
+
+/* Define to 1 if you have the <sys/pstat.h> header file. */
+/* #undef HAVE_SYS_PSTAT_H */
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+/* #undef HAVE_SYS_RESOURCE_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/sysctl.h> header file. */
+/* #undef HAVE_SYS_SYSCTL_H */
+
+/* Define to 1 if you have the <sys/sysinfo.h> header file. */
+/* #undef HAVE_SYS_SYSINFO_H */
+
+/* Define to 1 if you have the <sys/syssgi.h> header file. */
+/* #undef HAVE_SYS_SYSSGI_H */
+
+/* Define to 1 if you have the <sys/systemcfg.h> header file. */
+/* #undef HAVE_SYS_SYSTEMCFG_H */
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+/* #undef HAVE_SYS_TIMES_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `times' function. */
+/* #undef HAVE_TIMES */
+
+/* Define to 1 if the system has the type `uint_least32_t'. */
+#define HAVE_UINT_LEAST32_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `vsnprintf' function and it works properly. */
+/* #undef HAVE_VSNPRINTF */
+
+/* Define to 1 for Windos/64 */
+#define HOST_DOS64 1
+
+/* Assembler local label prefix */
+#define LSYM_PREFIX "L"
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 to disable the use of inline assembly */
+/* #undef NO_ASM */
+
+/* Name of package */
+#define PACKAGE "gmp"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU MP"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GNU MP 6.2.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "gmp"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://www.gnu.org/software/gmp/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "6.2.0"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* The size of `mp_limb_t', as computed by sizeof. */
+#define SIZEOF_MP_LIMB_T 8
+
+/* The size of `unsigned', as computed by sizeof. */
+#define SIZEOF_UNSIGNED 4
+
+/* The size of `unsigned long', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_LONG 4
+
+/* The size of `unsigned short', as computed by sizeof. */
+#define SIZEOF_UNSIGNED_SHORT 2
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 8
+
+/* Define to 1 if sscanf requires writable inputs */
+/* #undef SSCANF_WRITABLE_INPUT */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Maximum size the tune program can test for SQR_TOOM2_THRESHOLD */
+/* #undef TUNE_SQR_TOOM2_MAX */
+
+/* Version number of package */
+#define VERSION "6.2.0"
+
+/* Define to 1 to enable ASSERT checking, per --enable-assert */
+/* #undef WANT_ASSERT */
+
+/* Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid */
+/* #undef WANT_FAKE_CPUID */
+
+/* Define to 1 when building a fat binary. */
+/* #undef WANT_FAT_BINARY */
+
+/* Define to 1 to enable FFTs for multiplication, per --enable-fft */
+#define WANT_FFT 1
+
+/* Define to 1 to enable old mpn_mul_fft_full for multiplication, per
+ --enable-old-fft-full */
+/* #undef WANT_OLD_FFT_FULL */
+
+/* Define to 1 if --enable-profiling=gprof */
+/* #undef WANT_PROFILING_GPROF */
+
+/* Define to 1 if --enable-profiling=instrument */
+/* #undef WANT_PROFILING_INSTRUMENT */
+
+/* Define to 1 if --enable-profiling=prof */
+/* #undef WANT_PROFILING_PROF */
+
+/* Define one of these to 1 for the desired temporary memory allocation
+ method, per --enable-alloca. */
+#define WANT_TMP_ALLOCA 1
+/* #undef WANT_TMP_REENTRANT */
+/* #undef WANT_TMP_NOTREENTRANT */
+/* #undef WANT_TMP_DEBUG */
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
+
+/* Define to 1 if the assembler understands the mulx instruction */
+/* #undef X86_ASM_MULX */
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+/* #undef YYTEXT_POINTER */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#define restrict __restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+/* #undef volatile */
diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index e8adf5ba810..a0c33155da1 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -33,10 +33,11 @@ def is_tool(name):
return which(name) is not None
class Builder:
- def __init__(self, name, branch):
+ def __init__(self, name, branch, codesign):
self.name = name
self.branch = branch
self.is_release_branch = re.match("^blender-v(.*)-release$", branch) is not None
+ self.codesign = codesign
# Buildbot runs from build/ directory
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
@@ -67,8 +68,9 @@ def create_builder_from_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('builder_name')
parser.add_argument('branch', default='master', nargs='?')
+ parser.add_argument("--codesign", action="store_true")
args = parser.parse_args()
- return Builder(args.builder_name, args.branch)
+ return Builder(args.builder_name, args.branch, args.codesign)
class VersionInfo:
diff --git a/build_files/buildbot/worker_bundle_dmg.py b/build_files/buildbot/worker_bundle_dmg.py
index cd3da85e12a..56e0d7da88e 100755
--- a/build_files/buildbot/worker_bundle_dmg.py
+++ b/build_files/buildbot/worker_bundle_dmg.py
@@ -82,6 +82,10 @@ def create_argument_parser():
type=Path,
help="Optional path to applescript to set up folder looks of DMG."
"If not provided default Blender's one is used.")
+ parser.add_argument(
+ '--codesign',
+ action="store_true",
+ help="Code sign and notarize DMG contents.")
return parser
@@ -395,7 +399,8 @@ def create_final_dmg(app_bundles: List[Path],
dmg_filepath: Path,
background_image_filepath: Path,
volume_name: str,
- applescript: Path) -> None:
+ applescript: Path,
+ codesign: bool) -> None:
"""
Create DMG with all app bundles
@@ -421,7 +426,8 @@ def create_final_dmg(app_bundles: List[Path],
#
# This allows to recurs into the content of bundles without worrying about
# possible interfereice of Application symlink.
- codesign_app_bundles_in_dmg(mount_directory)
+ if codesign:
+ codesign_app_bundles_in_dmg(mount_directory)
copy_background_if_needed(background_image_filepath, mount_directory)
create_applications_link(mount_directory)
@@ -434,7 +440,8 @@ def create_final_dmg(app_bundles: List[Path],
compress_dmg(writable_dmg_filepath, dmg_filepath)
writable_dmg_filepath.unlink()
- codesign_and_notarize_dmg(dmg_filepath)
+ if codesign:
+ codesign_and_notarize_dmg(dmg_filepath)
def ensure_dmg_extension(filepath: Path) -> Path:
@@ -521,6 +528,7 @@ def main():
source_dir = args.source_dir.absolute()
background_image_filepath = get_background_image(args.background_image)
applescript = get_applescript(args.applescript)
+ codesign = args.codesign
app_bundles = collect_and_log_app_bundles(source_dir)
if not app_bundles:
@@ -535,7 +543,8 @@ def main():
dmg_filepath,
background_image_filepath,
volume_name,
- applescript)
+ applescript,
+ codesign)
if __name__ == "__main__":
diff --git a/build_files/buildbot/worker_compile.py b/build_files/buildbot/worker_compile.py
index f1357e1864f..8e19c9436f8 100644
--- a/build_files/buildbot/worker_compile.py
+++ b/build_files/buildbot/worker_compile.py
@@ -24,7 +24,7 @@ import shutil
import buildbot_utils
def get_cmake_options(builder):
- post_install_script = os.path.join(
+ codesign_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
config_file = "build_files/cmake/config/blender_release.cmake"
@@ -36,7 +36,8 @@ def get_cmake_options(builder):
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.platform == 'win':
options.extend(['-G', 'Visual Studio 16 2019', '-A', 'x64'])
- options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
+ if builder.codesign:
+ options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + codesign_script])
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"
diff --git a/build_files/buildbot/worker_pack.py b/build_files/buildbot/worker_pack.py
index 87ee49c87d8..96c8db8e6c8 100644
--- a/build_files/buildbot/worker_pack.py
+++ b/build_files/buildbot/worker_pack.py
@@ -117,6 +117,8 @@ def pack_mac(builder):
if info.is_development_build:
background_image = os.path.join(release_dir, 'buildbot', 'background.tif')
command += ['--background-image', background_image]
+ if builder.codesign:
+ command += ['--codesign']
command += [builder.install_dir]
buildbot_utils.call(command)
@@ -150,7 +152,8 @@ def pack_win(builder):
package_filename = package_name + '.msi'
package_filepath = os.path.join(builder.build_dir, package_filename)
- sign_file_or_directory(package_filepath)
+ if builder.codesign:
+ sign_file_or_directory(package_filepath)
package_files += [(package_filepath, package_filename)]
diff --git a/build_files/cmake/Modules/FindAlembic.cmake b/build_files/cmake/Modules/FindAlembic.cmake
index 2d69613ad84..45cda7ae2c5 100644
--- a/build_files/cmake/Modules/FindAlembic.cmake
+++ b/build_files/cmake/Modules/FindAlembic.cmake
@@ -51,7 +51,7 @@ FIND_LIBRARY(ALEMBIC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALEMBIC DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG ALEMBIC_LIBRARY ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARY})
diff --git a/build_files/cmake/Modules/FindBlosc.cmake b/build_files/cmake/Modules/FindBlosc.cmake
index bec934ad7c3..e0baa2d3382 100644
--- a/build_files/cmake/Modules/FindBlosc.cmake
+++ b/build_files/cmake/Modules/FindBlosc.cmake
@@ -53,7 +53,7 @@ FIND_LIBRARY(BLOSC_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Blosc DEFAULT_MSG
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
IF(BLOSC_FOUND)
diff --git a/build_files/cmake/Modules/FindEmbree.cmake b/build_files/cmake/Modules/FindEmbree.cmake
index fa613f62308..90cf23d3e13 100644
--- a/build_files/cmake/Modules/FindEmbree.cmake
+++ b/build_files/cmake/Modules/FindEmbree.cmake
@@ -7,9 +7,6 @@
# EMBREE_ROOT_DIR, The base directory to search for Embree.
# This can also be an environment variable.
# EMBREEFOUND, If false, do not try to use Embree.
-#
-# also defined, but not for general use are
-# EMBREE_LIBRARY, where to find the Embree library.
#=============================================================================
# Copyright 2018 Blender Foundation.
@@ -70,15 +67,6 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
ENDFOREACH()
-FIND_LIBRARY(EMBREE_LIBRARY
- NAMES
- libembree3
- HINTS
- ${_embree_SEARCH_DIRS}
- PATH_SUFFIXES
- lib64 lib
-)
-
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
diff --git a/build_files/cmake/Modules/FindGLEW.cmake b/build_files/cmake/Modules/FindGLEW.cmake
index 652b0835807..390e3878d6a 100644
--- a/build_files/cmake/Modules/FindGLEW.cmake
+++ b/build_files/cmake/Modules/FindGLEW.cmake
@@ -51,7 +51,7 @@ FIND_LIBRARY(GLEW_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG
GLEW_LIBRARY GLEW_INCLUDE_DIR)
IF(GLEW_FOUND)
diff --git a/build_files/cmake/Modules/FindGMP.cmake b/build_files/cmake/Modules/FindGMP.cmake
new file mode 100644
index 00000000000..4469f32c785
--- /dev/null
+++ b/build_files/cmake/Modules/FindGMP.cmake
@@ -0,0 +1,96 @@
+# - Find GMP library
+# Find the native GMP includes and library
+# This module defines
+# GMP_INCLUDE_DIRS, where to find gmp.h, Set when
+# GMP_INCLUDE_DIR is found.
+# GMP_LIBRARIES, libraries to link against to use GMP.
+# GMP_ROOT_DIR, The base directory to search for GMP.
+# This can also be an environment variable.
+# GMP_FOUND, If false, do not try to use GMP.
+#
+# also defined, but not for general use are
+# GMP_LIBRARY, where to find the GMP library.
+
+#=============================================================================
+# Copyright 2011 Blender Foundation.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+# If GMP_ROOT_DIR was defined in the environment, use it.
+IF(NOT GMP_ROOT_DIR AND NOT $ENV{GMP_ROOT_DIR} STREQUAL "")
+ SET(GMP_ROOT_DIR $ENV{GMP_ROOT_DIR})
+ENDIF()
+
+SET(_gmp_SEARCH_DIRS
+ ${GMP_ROOT_DIR}
+ /opt/lib/gmp
+)
+
+FIND_PATH(GMP_INCLUDE_DIR
+ NAMES
+ gmp.h
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/gmp
+)
+
+FIND_PATH(GMPXX_INCLUDE_DIR
+ NAMES
+ gmpxx.h
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ include/gmp
+)
+
+FIND_LIBRARY(GMP_LIBRARY
+ NAMES
+ gmp
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib
+ )
+
+FIND_LIBRARY(GMPXX_LIBRARY
+ NAMES
+ gmpxx
+ HINTS
+ ${_gmp_SEARCH_DIRS}
+ PATH_SUFFIXES
+ lib64 lib
+ )
+
+if(GMP_INCLUDE_DIR)
+ SET(_version_regex "^#define[ \t]+__GNU_MP_VERSION[ \t]+\"([^\"]+)\".*")
+ file(STRINGS "${GMP_INCLUDE_DIR}/gmp.h"
+ GMP_VERSION REGEX "${_version_regex}")
+ string(REGEX REPLACE "${_version_regex}" "\\1"
+ GMP_VERSION "${GMP_VERSION}")
+ unset(_version_regex)
+endif()
+
+# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG
+ GMP_LIBRARY GMPXX_LIBRARY GMP_INCLUDE_DIR GMPXX_INCLUDE_DIR)
+
+IF(GMP_FOUND)
+ SET(GMP_LIBRARIES ${GMP_LIBRARY} ${GMPXX_LIBRARY})
+ SET(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR})
+ENDIF(GMP_FOUND)
+
+MARK_AS_ADVANCED(
+ GMP_INCLUDE_DIR
+ GMP_LIBRARY
+ GMPXX_INCLUDE_DIR
+ GMPXX_LIBRARY
+)
diff --git a/build_files/cmake/Modules/FindOpenShadingLanguage.cmake b/build_files/cmake/Modules/FindOSL.cmake
index 07ed2c86e19..07ed2c86e19 100644
--- a/build_files/cmake/Modules/FindOpenShadingLanguage.cmake
+++ b/build_files/cmake/Modules/FindOSL.cmake
diff --git a/build_files/cmake/Modules/FindOpenCOLLADA.cmake b/build_files/cmake/Modules/FindOpenCOLLADA.cmake
index acf9e9ed9ce..239d46499b9 100644
--- a/build_files/cmake/Modules/FindOpenCOLLADA.cmake
+++ b/build_files/cmake/Modules/FindOpenCOLLADA.cmake
@@ -7,9 +7,6 @@
# OPENCOLLADA_ROOT_DIR, The base directory to search for OpenCOLLADA.
# This can also be an environment variable.
# OPENCOLLADA_FOUND, If false, do not try to use OpenCOLLADA.
-#
-# also defined, but not for general use are
-# OPENCOLLADA_LIBRARY, where to find the OpenCOLLADA library.
#=============================================================================
# Copyright 2011 Blender Foundation.
diff --git a/build_files/cmake/Modules/FindOpenSubdiv.cmake b/build_files/cmake/Modules/FindOpenSubdiv.cmake
index d7a8567a399..2c9fbf0ba60 100644
--- a/build_files/cmake/Modules/FindOpenSubdiv.cmake
+++ b/build_files/cmake/Modules/FindOpenSubdiv.cmake
@@ -7,9 +7,6 @@
# OPENSUBDIV_ROOT_DIR, the base directory to search for OpenSubdiv.
# This can also be an environment variable.
# OPENSUBDIV_FOUND, if false, do not try to use OpenSubdiv.
-#
-# also defined, but not for general use are
-# OPENSUBDIV_LIBRARY, where to find the OpenSubdiv library.
#=============================================================================
# Copyright 2013 Blender Foundation.
diff --git a/build_files/cmake/Modules/FindOpenVDB.cmake b/build_files/cmake/Modules/FindOpenVDB.cmake
index 2a1378e3a2b..5f24231fcf4 100644
--- a/build_files/cmake/Modules/FindOpenVDB.cmake
+++ b/build_files/cmake/Modules/FindOpenVDB.cmake
@@ -53,7 +53,7 @@ FIND_LIBRARY(OPENVDB_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENVDB DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB DEFAULT_MSG
OPENVDB_LIBRARY OPENVDB_INCLUDE_DIR)
IF(OPENVDB_FOUND)
diff --git a/build_files/cmake/Modules/FindXR-OpenXR-SDK.cmake b/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake
index 71b40ec1bde..567a0101b4a 100644
--- a/build_files/cmake/Modules/FindXR-OpenXR-SDK.cmake
+++ b/build_files/cmake/Modules/FindXR_OpenXR_SDK.cmake
@@ -59,7 +59,7 @@ FIND_LIBRARY(XR_OPENXR_SDK_LOADER_LIBRARY
# handle the QUIETLY and REQUIRED arguments and set XR_OPENXR_SDK_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OPENXR_SDK DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XR_OpenXR_SDK DEFAULT_MSG
XR_OPENXR_SDK_LOADER_LIBRARY XR_OPENXR_SDK_INCLUDE_DIR)
IF(XR_OPENXR_SDK_FOUND)
diff --git a/build_files/cmake/Modules/GTest.cmake b/build_files/cmake/Modules/GTest.cmake
new file mode 100644
index 00000000000..9a82fc49628
--- /dev/null
+++ b/build_files/cmake/Modules/GTest.cmake
@@ -0,0 +1,550 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+GoogleTest
+----------
+
+.. versionadded:: 3.9
+
+This module defines functions to help use the Google Test infrastructure. Two
+mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
+around for some time, originally via ``find_package(GTest)``.
+:command:`gtest_discover_tests` was introduced in CMake 3.10.
+
+The (older) :command:`gtest_add_tests` scans source files to identify tests.
+This is usually effective, with some caveats, including in cross-compiling
+environments, and makes setting additional properties on tests more convenient.
+However, its handling of parameterized tests is less comprehensive, and it
+requires re-running CMake to detect changes to the list of tests.
+
+The (newer) :command:`gtest_discover_tests` discovers tests by asking the
+compiled test executable to enumerate its tests. This is more robust and
+provides better handling of parameterized tests, and does not require CMake
+to be re-run when tests change. However, it may not work in a cross-compiling
+environment, and setting test properties is less convenient.
+
+More details can be found in the documentation of the respective functions.
+
+Both commands are intended to replace use of :command:`add_test` to register
+tests, and will create a separate CTest test for each Google Test test case.
+Note that this is in some cases less efficient, as common set-up and tear-down
+logic cannot be shared by multiple test cases executing in the same instance.
+However, it provides more fine-grained pass/fail information to CTest, which is
+usually considered as more beneficial. By default, the CTest test name is the
+same as the Google Test name (i.e. ``suite.testcase``); see also
+``TEST_PREFIX`` and ``TEST_SUFFIX``.
+
+.. command:: gtest_add_tests
+
+ Automatically add tests with CTest by scanning source code for Google Test
+ macros::
+
+ gtest_add_tests(TARGET target
+ [SOURCES src1...]
+ [EXTRA_ARGS arg1...]
+ [WORKING_DIRECTORY dir]
+ [TEST_PREFIX prefix]
+ [TEST_SUFFIX suffix]
+ [SKIP_DEPENDENCY]
+ [TEST_LIST outVar]
+ )
+
+ ``gtest_add_tests`` attempts to identify tests by scanning source files.
+ Although this is generally effective, it uses only a basic regular expression
+ match, which can be defeated by atypical test declarations, and is unable to
+ fully "split" parameterized tests. Additionally, it requires that CMake be
+ re-run to discover any newly added, removed or renamed tests (by default,
+ this means that CMake is re-run when any test source file is changed, but see
+ ``SKIP_DEPENDENCY``). However, it has the advantage of declaring tests at
+ CMake time, which somewhat simplifies setting additional properties on tests,
+ and always works in a cross-compiling environment.
+
+ The options are:
+
+ ``TARGET target``
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
+
+ ``SOURCES src1...``
+ When provided, only the listed files will be scanned for test cases. If
+ this option is not given, the :prop_tgt:`SOURCES` property of the
+ specified ``target`` will be used to obtain the list of sources.
+
+ ``EXTRA_ARGS arg1...``
+ Any extra arguments to pass on the command line to each test case.
+
+ ``WORKING_DIRECTORY dir``
+ Specifies the directory in which to run the discovered test cases. If this
+ option is not provided, the current binary directory is used.
+
+ ``TEST_PREFIX prefix``
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same source files are being used in
+ multiple calls to ``gtest_add_test()`` but with different ``EXTRA_ARGS``.
+
+ ``TEST_SUFFIX suffix``
+ Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
+
+ ``SKIP_DEPENDENCY``
+ Normally, the function creates a dependency which will cause CMake to be
+ re-run if any of the sources being scanned are changed. This is to ensure
+ that the list of discovered tests is updated. If this behavior is not
+ desired (as may be the case while actually writing the test cases), this
+ option can be used to prevent the dependency from being added.
+
+ ``TEST_LIST outVar``
+ The variable named by ``outVar`` will be populated in the calling scope
+ with the list of discovered test cases. This allows the caller to do
+ things like manipulate test properties of the discovered tests.
+
+ .. code-block:: cmake
+
+ include(GoogleTest)
+ add_executable(FooTest FooUnitTest.cxx)
+ gtest_add_tests(TARGET FooTest
+ TEST_SUFFIX .noArgs
+ TEST_LIST noArgsTests
+ )
+ gtest_add_tests(TARGET FooTest
+ EXTRA_ARGS --someArg someValue
+ TEST_SUFFIX .withArgs
+ TEST_LIST withArgsTests
+ )
+ set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
+ set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)
+
+ For backward compatibility, the following form is also supported::
+
+ gtest_add_tests(exe args files...)
+
+ ``exe``
+ The path to the test executable or the name of a CMake target.
+ ``args``
+ A ;-list of extra arguments to be passed to executable. The entire
+ list must be passed as a single argument. Enclose it in quotes,
+ or pass ``""`` for no arguments.
+ ``files...``
+ A list of source files to search for tests and test fixtures.
+ Alternatively, use ``AUTO`` to specify that ``exe`` is the name
+ of a CMake executable target whose sources should be scanned.
+
+ .. code-block:: cmake
+
+ include(GoogleTest)
+ set(FooTestArgs --foo 1 --bar 2)
+ add_executable(FooTest FooUnitTest.cxx)
+ gtest_add_tests(FooTest "${FooTestArgs}" AUTO)
+
+.. command:: gtest_discover_tests
+
+ Automatically add tests with CTest by querying the compiled test executable
+ for available tests::
+
+ gtest_discover_tests(target
+ [EXTRA_ARGS arg1...]
+ [WORKING_DIRECTORY dir]
+ [TEST_PREFIX prefix]
+ [TEST_SUFFIX suffix]
+ [NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
+ [PROPERTIES name1 value1...]
+ [TEST_LIST var]
+ [DISCOVERY_TIMEOUT seconds]
+ [XML_OUTPUT_DIR dir]
+ [DISCOVERY_MODE <POST_BUILD|PRE_TEST>]
+ )
+
+ ``gtest_discover_tests()`` sets up a post-build command on the test executable
+ that generates the list of tests by parsing the output from running the test
+ with the ``--gtest_list_tests`` argument. Compared to the source parsing
+ approach of :command:`gtest_add_tests`, this ensures that the full list of
+ tests, including instantiations of parameterized tests, is obtained. Since
+ test discovery occurs at build time, it is not necessary to re-run CMake when
+ the list of tests changes.
+ However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set
+ in order to function in a cross-compiling environment.
+
+ Additionally, setting properties on tests is somewhat less convenient, since
+ the tests are not available at CMake time. Additional test properties may be
+ assigned to the set of tests as a whole using the ``PROPERTIES`` option. If
+ more fine-grained test control is needed, custom content may be provided
+ through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES`
+ directory property. The set of discovered tests is made accessible to such a
+ script via the ``<target>_TESTS`` variable.
+
+ The options are:
+
+ ``target``
+ Specifies the Google Test executable, which must be a known CMake
+ executable target. CMake will substitute the location of the built
+ executable when running the test.
+
+ ``EXTRA_ARGS arg1...``
+ Any extra arguments to pass on the command line to each test case.
+
+ ``WORKING_DIRECTORY dir``
+ Specifies the directory in which to run the discovered test cases. If this
+ option is not provided, the current binary directory is used.
+
+ ``TEST_PREFIX prefix``
+ Specifies a ``prefix`` to be prepended to the name of each discovered test
+ case. This can be useful when the same test executable is being used in
+ multiple calls to ``gtest_discover_tests()`` but with different
+ ``EXTRA_ARGS``.
+
+ ``TEST_SUFFIX suffix``
+ Similar to ``TEST_PREFIX`` except the ``suffix`` is appended to the name of
+ every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
+ be specified.
+
+ ``NO_PRETTY_TYPES``
+ By default, the type index of type-parameterized tests is replaced by the
+ actual type name in the CTest test name. If this behavior is undesirable
+ (e.g. because the type names are unwieldy), this option will suppress this
+ behavior.
+
+ ``NO_PRETTY_VALUES``
+ By default, the value index of value-parameterized tests is replaced by the
+ actual value in the CTest test name. If this behavior is undesirable
+ (e.g. because the value strings are unwieldy), this option will suppress
+ this behavior.
+
+ ``PROPERTIES name1 value1...``
+ Specifies additional properties to be set on all tests discovered by this
+ invocation of ``gtest_discover_tests()``.
+
+ ``TEST_LIST var``
+ Make the list of tests available in the variable ``var``, rather than the
+ default ``<target>_TESTS``. This can be useful when the same test
+ executable is being used in multiple calls to ``gtest_discover_tests()``.
+ Note that this variable is only available in CTest.
+
+ ``DISCOVERY_TIMEOUT num``
+ Specifies how long (in seconds) CMake will wait for the test to enumerate
+ available tests. If the test takes longer than this, discovery (and your
+ build) will fail. Most test executables will enumerate their tests very
+ quickly, but under some exceptional circumstances, a test may require a
+ longer timeout. The default is 5. See also the ``TIMEOUT`` option of
+ :command:`execute_process`.
+
+ .. note::
+
+ In CMake versions 3.10.1 and 3.10.2, this option was called ``TIMEOUT``.
+ This clashed with the ``TIMEOUT`` test property, which is one of the
+ common properties that would be set with the ``PROPERTIES`` keyword,
+ usually leading to legal but unintended behavior. The keyword was
+ changed to ``DISCOVERY_TIMEOUT`` in CMake 3.10.3 to address this
+ problem. The ambiguous behavior of the ``TIMEOUT`` keyword in 3.10.1
+ and 3.10.2 has not been preserved.
+
+ ``XML_OUTPUT_DIR dir``
+ If specified, the parameter is passed along with ``--gtest_output=xml:``
+ to test executable. The actual file name is the same as the test target,
+ including prefix and suffix. This should be used instead of
+ ``EXTRA_ARGS --gtest_output=xml`` to avoid race conditions writing the
+ XML result output when using parallel test execution.
+
+ ``DISCOVERY_MODE``
+ Provides greater control over when ``gtest_discover_tests()`` performs test
+ discovery. By default, ``POST_BUILD`` sets up a post-build command
+ to perform test discovery at build time. In certain scenarios, like
+ cross-compiling, this ``POST_BUILD`` behavior is not desirable.
+ By contrast, ``PRE_TEST`` delays test discovery until just prior to test
+ execution. This way test discovery occurs in the target environment
+ where the test has a better chance at finding appropriate runtime
+ dependencies.
+
+ ``DISCOVERY_MODE`` defaults to the value of the
+ ``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable if it is not
+ passed when calling ``gtest_discover_tests()``. This provides a mechanism
+ for globally selecting a preferred test discovery behavior without having
+ to modify each call site.
+
+#]=======================================================================]
+
+# Save project's policies
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
+#------------------------------------------------------------------------------
+function(gtest_add_tests)
+
+ if (ARGC LESS 1)
+ message(FATAL_ERROR "No arguments supplied to gtest_add_tests()")
+ endif()
+
+ set(options
+ SKIP_DEPENDENCY
+ )
+ set(oneValueArgs
+ TARGET
+ WORKING_DIRECTORY
+ TEST_PREFIX
+ TEST_SUFFIX
+ TEST_LIST
+ )
+ set(multiValueArgs
+ SOURCES
+ EXTRA_ARGS
+ )
+ set(allKeywords ${options} ${oneValueArgs} ${multiValueArgs})
+
+ unset(sources)
+ if("${ARGV0}" IN_LIST allKeywords)
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(autoAddSources YES)
+ else()
+ # Non-keyword syntax, convert to keyword form
+ if (ARGC LESS 3)
+ message(FATAL_ERROR "gtest_add_tests() without keyword options requires at least 3 arguments")
+ endif()
+ set(ARGS_TARGET "${ARGV0}")
+ set(ARGS_EXTRA_ARGS "${ARGV1}")
+ if(NOT "${ARGV2}" STREQUAL "AUTO")
+ set(ARGS_SOURCES "${ARGV}")
+ list(REMOVE_AT ARGS_SOURCES 0 1)
+ endif()
+ endif()
+
+ # The non-keyword syntax allows the first argument to be an arbitrary
+ # executable rather than a target if source files are also provided. In all
+ # other cases, both forms require a target.
+ if(NOT TARGET "${ARGS_TARGET}" AND NOT ARGS_SOURCES)
+ message(FATAL_ERROR "${ARGS_TARGET} does not define an existing CMake target")
+ endif()
+ if(NOT ARGS_WORKING_DIRECTORY)
+ unset(workDir)
+ else()
+ set(workDir WORKING_DIRECTORY "${ARGS_WORKING_DIRECTORY}")
+ endif()
+
+ if(NOT ARGS_SOURCES)
+ get_property(ARGS_SOURCES TARGET ${ARGS_TARGET} PROPERTY SOURCES)
+ endif()
+
+ unset(testList)
+
+ set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
+ set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
+
+ foreach(source IN LISTS ARGS_SOURCES)
+ if(NOT ARGS_SKIP_DEPENDENCY)
+ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${source})
+ endif()
+ file(READ "${source}" contents)
+ string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests "${contents}")
+ foreach(hit ${found_tests})
+ string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
+
+ # Parameterized tests have a different signature for the filter
+ if("x${test_type}" STREQUAL "xTEST_P")
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
+ elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
+ elseif("x${test_type}" STREQUAL "xTYPED_TEST")
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" gtest_test_name ${hit})
+ else()
+ message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
+ continue()
+ endif()
+
+ # Make sure tests disabled in GTest get disabled in CTest
+ if(gtest_test_name MATCHES "(^|\\.)DISABLED_")
+ # Add the disabled test if CMake is new enough
+ # Note that this check is to allow backwards compatibility so this
+ # module can be copied locally in projects to use with older CMake
+ # versions
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401)
+ string(REGEX REPLACE
+ "(^|\\.)DISABLED_" "\\1"
+ orig_test_name "${gtest_test_name}"
+ )
+ set(ctest_test_name
+ ${ARGS_TEST_PREFIX}${orig_test_name}${ARGS_TEST_SUFFIX}
+ )
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_also_run_disabled_tests
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
+ list(APPEND testList ${ctest_test_name})
+ endif()
+ else()
+ set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ list(APPEND testList ${ctest_test_name})
+ endif()
+ endforeach()
+ endforeach()
+
+ if(ARGS_TEST_LIST)
+ set(${ARGS_TEST_LIST} ${testList} PARENT_SCOPE)
+ endif()
+
+endfunction()
+
+#------------------------------------------------------------------------------
+
+function(gtest_discover_tests TARGET)
+ cmake_parse_arguments(
+ ""
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES"
+ "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
+ "EXTRA_ARGS;PROPERTIES"
+ ${ARGN}
+ )
+
+ if(NOT _WORKING_DIRECTORY)
+ set(_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+ endif()
+ if(NOT _TEST_LIST)
+ set(_TEST_LIST ${TARGET}_TESTS)
+ endif()
+ if(NOT _DISCOVERY_TIMEOUT)
+ set(_DISCOVERY_TIMEOUT 5)
+ endif()
+ if(NOT _DISCOVERY_MODE)
+ if(NOT CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE)
+ set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE "POST_BUILD")
+ endif()
+ set(_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
+ endif()
+
+ get_property(
+ has_counter
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ SET
+ )
+ if(has_counter)
+ get_property(
+ counter
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ )
+ math(EXPR counter "${counter} + 1")
+ else()
+ set(counter 1)
+ endif()
+ set_property(
+ TARGET ${TARGET}
+ PROPERTY CTEST_DISCOVERED_TEST_COUNTER
+ ${counter}
+ )
+
+ # Define rule to generate test list for aforementioned test executable
+ # Blender: use _ instead of [] to avoid problems with zsh regex.
+ set(ctest_file_base "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_${counter}_")
+ set(ctest_include_file "${ctest_file_base}_include.cmake")
+ set(ctest_tests_file "${ctest_file_base}_tests.cmake")
+ get_property(crosscompiling_emulator
+ TARGET ${TARGET}
+ PROPERTY CROSSCOMPILING_EMULATOR
+ )
+
+ if(_DISCOVERY_MODE STREQUAL "POST_BUILD")
+ add_custom_command(
+ TARGET ${TARGET} POST_BUILD
+ BYPRODUCTS "${ctest_tests_file}"
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TARGET=${TARGET}"
+ -D "TEST_EXECUTABLE=$<TARGET_FILE:${TARGET}>"
+ -D "TEST_EXECUTOR=${crosscompiling_emulator}"
+ -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}"
+ -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}"
+ -D "TEST_PROPERTIES=${_PROPERTIES}"
+ -D "TEST_PREFIX=${_TEST_PREFIX}"
+ -D "TEST_SUFFIX=${_TEST_SUFFIX}"
+ -D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
+ -D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
+ -D "TEST_LIST=${_TEST_LIST}"
+ -D "CTEST_FILE=${ctest_tests_file}"
+ -D "TEST_DISCOVERY_TIMEOUT=${_DISCOVERY_TIMEOUT}"
+ -D "TEST_XML_OUTPUT_DIR=${_XML_OUTPUT_DIR}"
+ -P "${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}"
+ VERBATIM
+ )
+
+ file(WRITE "${ctest_include_file}"
+ "if(EXISTS \"${ctest_tests_file}\")\n"
+ " include(\"${ctest_tests_file}\")\n"
+ "else()\n"
+ " add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)\n"
+ "endif()\n"
+ )
+ elseif(_DISCOVERY_MODE STREQUAL "PRE_TEST")
+
+ get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL
+ PROPERTY GENERATOR_IS_MULTI_CONFIG
+ )
+
+ if(GENERATOR_IS_MULTI_CONFIG)
+ set(ctest_tests_file "${ctest_file_base}_tests-$<CONFIG>.cmake")
+ endif()
+
+ string(CONCAT ctest_include_content
+ "if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
+ " if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
+ " include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
+ " gtest_discover_tests_impl(" "\n"
+ " TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
+ " TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
+ " TEST_WORKING_DIR" " [==[" "${_WORKING_DIRECTORY}" "]==]" "\n"
+ " TEST_EXTRA_ARGS" " [==[" "${_EXTRA_ARGS}" "]==]" "\n"
+ " TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
+ " TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
+ " TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
+ " NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
+ " NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
+ " TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
+ " CTEST_FILE" " [==[" "${ctest_tests_file}" "]==]" "\n"
+ " TEST_DISCOVERY_TIMEOUT" " [==[" "${_DISCOVERY_TIMEOUT}" "]==]" "\n"
+ " TEST_XML_OUTPUT_DIR" " [==[" "${_XML_OUTPUT_DIR}" "]==]" "\n"
+ " )" "\n"
+ " endif()" "\n"
+ " include(\"${ctest_tests_file}\")" "\n"
+ "else()" "\n"
+ " add_test(${TARGET}_NOT_BUILT ${TARGET}_NOT_BUILT)" "\n"
+ "endif()" "\n"
+ )
+
+ if(GENERATOR_IS_MULTI_CONFIG)
+ foreach(_config ${CMAKE_CONFIGURATION_TYPES})
+ file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
+ endforeach()
+ file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
+ else()
+ file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
+ file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
+ endif()
+
+ else()
+ message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
+ endif()
+
+ # Add discovered tests to directory TEST_INCLUDE_FILES
+ set_property(DIRECTORY
+ APPEND PROPERTY TEST_INCLUDE_FILES "${ctest_include_file}"
+ )
+
+endfunction()
+
+###############################################################################
+
+set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
+ ${CMAKE_CURRENT_LIST_DIR}/GTestAddTests.cmake
+)
+
+# Restore project's policies
+cmake_policy(POP)
diff --git a/build_files/cmake/Modules/GTestAddTests.cmake b/build_files/cmake/Modules/GTestAddTests.cmake
new file mode 100644
index 00000000000..8be07b8e2e5
--- /dev/null
+++ b/build_files/cmake/Modules/GTestAddTests.cmake
@@ -0,0 +1,191 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# Blender: disable ASAN leak detection when trying to discover tests.
+set(ENV{ASAN_OPTIONS} "detect_leaks=0")
+
+cmake_minimum_required(VERSION ${CMAKE_VERSION})
+
+# Overwrite possibly existing ${_CTEST_FILE} with empty file
+set(flush_tests_MODE WRITE)
+
+# Flushes script to ${_CTEST_FILE}
+macro(flush_script)
+ file(${flush_tests_MODE} "${_CTEST_FILE}" "${script}")
+ set(flush_tests_MODE APPEND)
+
+ set(script "")
+endmacro()
+
+# Flushes tests_buffer to tests
+macro(flush_tests_buffer)
+ list(APPEND tests "${tests_buffer}")
+ set(tests_buffer "")
+endmacro()
+
+macro(add_command NAME)
+ set(_args "")
+ foreach(_arg ${ARGN})
+ if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
+ string(APPEND _args " [==[${_arg}]==]")
+ else()
+ string(APPEND _args " ${_arg}")
+ endif()
+ endforeach()
+ string(APPEND script "${NAME}(${_args})\n")
+ string(LENGTH "${script}" _script_len)
+ if(${_script_len} GREATER "50000")
+ flush_script()
+ endif()
+ # Unsets macro local variables to prevent leakage outside of this macro.
+ unset(_args)
+ unset(_script_len)
+endmacro()
+
+function(gtest_discover_tests_impl)
+
+ cmake_parse_arguments(
+ ""
+ ""
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_EXECUTOR;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
+ "TEST_EXTRA_ARGS;TEST_PROPERTIES"
+ ${ARGN}
+ )
+
+ set(prefix "${_TEST_PREFIX}")
+ set(suffix "${_TEST_SUFFIX}")
+ set(extra_args ${_TEST_EXTRA_ARGS})
+ set(properties ${_TEST_PROPERTIES})
+ set(script)
+ set(suite)
+ set(tests)
+ set(tests_buffer)
+
+ # Run test executable to get list of available tests
+ if(NOT EXISTS "${_TEST_EXECUTABLE}")
+ message(FATAL_ERROR
+ "Specified test executable does not exist.\n"
+ " Path: '${_TEST_EXECUTABLE}'"
+ )
+ endif()
+ execute_process(
+ COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
+ WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
+ TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
+ OUTPUT_VARIABLE output
+ RESULT_VARIABLE result
+ )
+ if(NOT ${result} EQUAL 0)
+ string(REPLACE "\n" "\n " output "${output}")
+ message(FATAL_ERROR
+ "Error running test executable.\n"
+ " Path: '${_TEST_EXECUTABLE}'\n"
+ " Result: ${result}\n"
+ " Output:\n"
+ " ${output}\n"
+ )
+ endif()
+
+ # Preserve semicolon in test-parameters
+ string(REPLACE [[;]] [[\;]] output "${output}")
+ string(REPLACE "\n" ";" output "${output}")
+
+ # Parse output
+ foreach(line ${output})
+ # Skip header
+ if(NOT line MATCHES "gtest_main\\.cc")
+ # Do we have a module name or a test name?
+ if(NOT line MATCHES "^ ")
+ # Module; remove trailing '.' to get just the name...
+ string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
+ if(line MATCHES "#" AND NOT _NO_PRETTY_TYPES)
+ string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
+ else()
+ set(pretty_suite "${suite}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
+ else()
+ # Test name; strip spaces and comments to get just the name...
+ string(REGEX REPLACE " +" "" test "${line}")
+ if(test MATCHES "#" AND NOT _NO_PRETTY_VALUES)
+ string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
+ else()
+ string(REGEX REPLACE "#.*" "" pretty_test "${test}")
+ endif()
+ string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
+ string(REGEX REPLACE "#.*" "" test "${test}")
+ if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
+ set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
+ else()
+ unset(TEST_XML_OUTPUT_PARAM)
+ endif()
+
+ # sanitize test name for further processing downstream
+ set(testname "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ # escape \
+ string(REPLACE [[\]] [[\\]] testname "${testname}")
+ # escape ;
+ string(REPLACE [[;]] [[\;]] testname "${testname}")
+ # escape $
+ string(REPLACE [[$]] [[\$]] testname "${testname}")
+
+ # ...and add to script
+ add_command(add_test
+ "${testname}"
+ ${_TEST_EXECUTOR}
+ "${_TEST_EXECUTABLE}"
+ "--gtest_filter=${suite}.${test}"
+ "--gtest_also_run_disabled_tests"
+ ${TEST_XML_OUTPUT_PARAM}
+ ${extra_args}
+ )
+ if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
+ add_command(set_tests_properties
+ "${testname}"
+ PROPERTIES DISABLED TRUE
+ )
+ endif()
+ add_command(set_tests_properties
+ "${testname}"
+ PROPERTIES
+ WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
+ SKIP_REGULAR_EXPRESSION "\\\\[ SKIPPED \\\\]"
+ ${properties}
+ )
+ list(APPEND tests_buffer "${testname}")
+ list(LENGTH tests_buffer tests_buffer_length)
+ if(${tests_buffer_length} GREATER "250")
+ flush_tests_buffer()
+ endif()
+ endif()
+ endif()
+ endforeach()
+
+
+ # Create a list of all discovered tests, which users may use to e.g. set
+ # properties on the tests
+ flush_tests_buffer()
+ add_command(set ${_TEST_LIST} ${tests})
+
+ # Write CTest script
+ flush_script()
+
+endfunction()
+
+if(CMAKE_SCRIPT_MODE_FILE)
+ gtest_discover_tests_impl(
+ NO_PRETTY_TYPES ${NO_PRETTY_TYPES}
+ NO_PRETTY_VALUES ${NO_PRETTY_VALUES}
+ TEST_EXECUTABLE ${TEST_EXECUTABLE}
+ TEST_EXECUTOR ${TEST_EXECUTOR}
+ TEST_WORKING_DIR ${TEST_WORKING_DIR}
+ TEST_PREFIX ${TEST_PREFIX}
+ TEST_SUFFIX ${TEST_SUFFIX}
+ TEST_LIST ${TEST_LIST}
+ CTEST_FILE ${CTEST_FILE}
+ TEST_DISCOVERY_TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
+ TEST_XML_OUTPUT_DIR ${TEST_XML_OUTPUT_DIR}
+ TEST_EXTRA_ARGS ${TEST_EXTRA_ARGS}
+ TEST_PROPERTIES ${TEST_PROPERTIES}
+ )
+endif()
diff --git a/build_files/cmake/config/blender_full.cmake b/build_files/cmake/config/blender_full.cmake
index 41bee263e22..7d3284af158 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -15,6 +15,7 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index 68b9bd1d94d..16c15961c59 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -20,6 +20,7 @@ set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake
index e6fc73a75ed..ddd9aa1d766 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -16,6 +16,7 @@ set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
+set(WITH_GMP OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 708efc3d2f7..51cfadecc3e 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -169,6 +169,26 @@ function(blender_include_dirs_sys
include_directories(SYSTEM ${_ALL_INCS})
endfunction()
+# Set include paths for header files included with "*.h" syntax.
+# This enables auto-complete suggestions for user header files on Xcode.
+# Build process is not affected since the include paths are the same
+# as in HEADER_SEARCH_PATHS.
+function(blender_user_header_search_paths
+ name
+ includes
+ )
+
+ if(XCODE)
+ set(_ALL_INCS "")
+ foreach(_INC ${includes})
+ get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
+ # _ALL_INCS is a space-separated string of file paths in quotes.
+ set(_ALL_INCS "${_ALL_INCS} \"${_ABS_INC}\"")
+ endforeach()
+ set_target_properties(${name} PROPERTIES XCODE_ATTRIBUTE_USER_HEADER_SEARCH_PATHS "${_ALL_INCS}")
+ endif()
+endfunction()
+
function(blender_source_group
name
sources
@@ -317,6 +337,7 @@ function(blender_add_lib__impl
# works fine without having the includes
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${name}" "${sources}")
+ blender_user_header_search_paths("${name}" "${includes}")
list_assert_duplicates("${sources}")
list_assert_duplicates("${includes}")
@@ -397,7 +418,7 @@ function(setup_heavy_lib_pool)
list(APPEND _HEAVY_LIBS "cycles_device" "cycles_kernel")
endif()
if(WITH_LIBMV)
- list(APPEND _HEAVY_LIBS "bf_intern_libmv")
+ list(APPEND _HEAVY_LIBS "extern_ceres" "bf_intern_libmv")
endif()
if(WITH_OPENVDB)
list(APPEND _HEAVY_LIBS "bf_intern_openvdb")
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index a80b0b56901..5949e761551 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -430,13 +430,21 @@ if(WITH_OPENMP)
endif()
if(WITH_XR_OPENXR)
- find_package(OpenXR-SDK)
- if(NOT OPENXR_SDK_FOUND)
+ find_package(XR_OpenXR_SDK)
+ if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
endif()
+if(WITH_GMP)
+ find_package(GMP)
+ if(NOT GMP_FOUND)
+ message(WARNING "GMP not found, disabling WITH_GMP")
+ set(WITH_GMP OFF)
+ endif()
+endif()
+
set(EXETYPE MACOSX_BUNDLE)
set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index c5e8893424b..83909a0cf66 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -234,10 +234,10 @@ endif()
if(WITH_CYCLES_OSL)
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
- if(NOT OSL_ROOT)
+ if(EXISTS ${CYCLES_OSL} AND NOT OSL_ROOT)
set(OSL_ROOT ${CYCLES_OSL})
endif()
- find_package_wrapper(OpenShadingLanguage)
+ find_package_wrapper(OSL)
if(OSL_FOUND)
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
@@ -428,13 +428,21 @@ if(WITH_TBB)
endif()
if(WITH_XR_OPENXR)
- find_package(XR-OpenXR-SDK)
+ find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
endif()
endif()
+if(WITH_GMP)
+ find_package_wrapper(GMP)
+ if(NOT GMP_FOUND)
+ message(WARNING "GMP not found, disabling WITH_GMP")
+ set(WITH_GMP OFF)
+ endif()
+endif()
+
if(EXISTS ${LIBDIR})
without_system_libs_end()
endif()
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 01d48364435..dfcd5d75444 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -750,3 +750,10 @@ if(WITH_XR_OPENXR)
set(WITH_XR_OPENXR OFF)
endif()
endif()
+
+if(WITH_GMP)
+ set(GMP_INCLUDE_DIRS ${LIBDIR}/gmp/include)
+ set(GMP_LIBRARIES ${LIBDIR}/gmp/lib/libgmp-10.lib optimized ${LIBDIR}/gmp/lib/libgmpxx.lib debug ${LIBDIR}/gmp/lib/libgmpxx_d.lib)
+ set(GMP_ROOT_DIR ${LIBDIR}/gmp)
+ set(GMP_FOUND On)
+endif()