Merge branch 'master' into tracking_tools
This commit is contained in:
@@ -265,11 +265,13 @@ ForEachMacros:
|
||||
- SET_SLOT_PROBING_BEGIN
|
||||
- MAP_SLOT_PROBING_BEGIN
|
||||
- VECTOR_SET_SLOT_PROBING_BEGIN
|
||||
- WL_ARRAY_FOR_EACH
|
||||
- FOREACH_SPECTRUM_CHANNEL
|
||||
|
||||
StatementMacros:
|
||||
- PyObject_HEAD
|
||||
- PyObject_VAR_HEAD
|
||||
- ccl_gpu_kernel_postfix
|
||||
|
||||
MacroBlockBegin: "^BSDF_CLOSURE_CLASS_BEGIN$"
|
||||
MacroBlockEnd: "^BSDF_CLOSURE_CLASS_END$"
|
||||
MacroBlockBegin: "^OSL_CLOSURE_STRUCT_BEGIN$"
|
||||
MacroBlockEnd: "^OSL_CLOSURE_STRUCT_END$"
|
||||
|
827
CMakeLists.txt
827
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
28
GNUmakefile
28
GNUmakefile
@@ -162,6 +162,7 @@ CPU:=$(shell uname -m)
|
||||
# Source and Build DIR's
|
||||
BLENDER_DIR:=$(shell pwd -P)
|
||||
BUILD_TYPE:=Release
|
||||
BLENDER_IS_PYTHON_MODULE:=
|
||||
|
||||
# CMake arguments, assigned to local variable to make it mutable.
|
||||
CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS)
|
||||
@@ -229,9 +230,18 @@ endif
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# additional targets for the build configuration
|
||||
# Additional targets for the build configuration
|
||||
|
||||
# support 'make debug'
|
||||
# NOTE: These targets can be combined and are applied in reverse order listed here.
|
||||
# So it's important that `bpy` comes before `release` (for example)
|
||||
# `make bpy release` first loads `release` configuration, then `bpy`.
|
||||
# This is important as `bpy` will turn off some settings enabled by release.
|
||||
|
||||
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_bpy
|
||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
|
||||
BLENDER_IS_PYTHON_MODULE:=1
|
||||
endif
|
||||
ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_debug
|
||||
BUILD_TYPE:=Debug
|
||||
@@ -256,10 +266,6 @@ ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_headless
|
||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS)
|
||||
endif
|
||||
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_bpy
|
||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
|
||||
endif
|
||||
|
||||
ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
|
||||
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
|
||||
@@ -297,8 +303,10 @@ endif
|
||||
# use the default build path can still use utility helpers.
|
||||
ifeq ($(OS), Darwin)
|
||||
BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
|
||||
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
|
||||
else
|
||||
BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
|
||||
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin"
|
||||
endif
|
||||
|
||||
|
||||
@@ -355,8 +363,12 @@ all: .FORCE
|
||||
@echo Building Blender ...
|
||||
$(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install
|
||||
@echo
|
||||
@echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild.
|
||||
@echo Blender successfully built, run from: $(BLENDER_BIN)
|
||||
@echo Edit build configuration with: \"$(BUILD_DIR)/CMakeCache.txt\" run make again to rebuild.
|
||||
@if test -z "$(BLENDER_IS_PYTHON_MODULE)"; then \
|
||||
echo Blender successfully built, run from: $(BLENDER_BIN); \
|
||||
else \
|
||||
echo Blender successfully built as a Python module, \"bpy\" can be imported from: $(BLENDER_BIN_DIR); \
|
||||
fi
|
||||
@echo
|
||||
|
||||
debug: all
|
||||
|
@@ -29,10 +29,12 @@ cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(ExternalProject)
|
||||
include(cmake/check_software.cmake)
|
||||
include(cmake/versions.cmake)
|
||||
include(cmake/options.cmake)
|
||||
# versions.cmake needs to be included after options.cmake due to the BLENDER_PLATFORM_ARM variable being needed.
|
||||
include(cmake/versions.cmake)
|
||||
include(cmake/boost_build_options.cmake)
|
||||
include(cmake/download.cmake)
|
||||
include(cmake/macros.cmake)
|
||||
|
||||
if(ENABLE_MINGW64)
|
||||
include(cmake/setup_mingw64.cmake)
|
||||
@@ -51,13 +53,12 @@ include(cmake/imath.cmake)
|
||||
include(cmake/openexr.cmake)
|
||||
include(cmake/brotli.cmake)
|
||||
include(cmake/freetype.cmake)
|
||||
include(cmake/epoxy.cmake)
|
||||
include(cmake/freeglut.cmake)
|
||||
include(cmake/glew.cmake)
|
||||
include(cmake/alembic.cmake)
|
||||
include(cmake/opensubdiv.cmake)
|
||||
include(cmake/sdl.cmake)
|
||||
include(cmake/opencollada.cmake)
|
||||
include(cmake/llvm.cmake)
|
||||
if(APPLE)
|
||||
include(cmake/openmp.cmake)
|
||||
endif()
|
||||
@@ -75,6 +76,7 @@ include(cmake/osl.cmake)
|
||||
include(cmake/tbb.cmake)
|
||||
include(cmake/openvdb.cmake)
|
||||
include(cmake/python.cmake)
|
||||
include(cmake/llvm.cmake)
|
||||
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
|
||||
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
|
||||
set(USE_PIP_NUMPY ON)
|
||||
@@ -92,10 +94,20 @@ include(cmake/pugixml.cmake)
|
||||
include(cmake/ispc.cmake)
|
||||
include(cmake/openimagedenoise.cmake)
|
||||
include(cmake/embree.cmake)
|
||||
include(cmake/openpgl.cmake)
|
||||
include(cmake/fmt.cmake)
|
||||
include(cmake/robinmap.cmake)
|
||||
if(NOT APPLE)
|
||||
include(cmake/xr_openxr.cmake)
|
||||
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
|
||||
include(cmake/dpcpp.cmake)
|
||||
include(cmake/dpcpp_deps.cmake)
|
||||
endif()
|
||||
if(NOT WIN32)
|
||||
include(cmake/igc.cmake)
|
||||
include(cmake/gmmlib.cmake)
|
||||
include(cmake/ocloc.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenColorIO and dependencies.
|
||||
@@ -128,6 +140,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
|
||||
include(cmake/vpx.cmake)
|
||||
include(cmake/x264.cmake)
|
||||
include(cmake/xvidcore.cmake)
|
||||
include(cmake/aom.cmake)
|
||||
include(cmake/ffmpeg.cmake)
|
||||
include(cmake/fftw.cmake)
|
||||
include(cmake/sndfile.cmake)
|
||||
@@ -157,6 +170,8 @@ if(UNIX AND NOT APPLE)
|
||||
include(cmake/libglu.cmake)
|
||||
include(cmake/mesa.cmake)
|
||||
include(cmake/wayland_protocols.cmake)
|
||||
# Can be removed when the build-bot upgrades to v1.20.x or newer.
|
||||
include(cmake/wayland.cmake)
|
||||
endif()
|
||||
|
||||
include(cmake/harvest.cmake)
|
||||
|
@@ -42,4 +42,5 @@ endif()
|
||||
add_dependencies(
|
||||
external_alembic
|
||||
external_openexr
|
||||
external_imath
|
||||
)
|
||||
|
45
build_files/build_environment/cmake/aom.cmake
Normal file
45
build_files/build_environment/cmake/aom.cmake
Normal file
@@ -0,0 +1,45 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
if(WIN32)
|
||||
# The default generator on windows is msbuild, which we do not
|
||||
# want to use for this dep, as needs to build with mingw
|
||||
set(AOM_GENERATOR "Ninja")
|
||||
# The default flags are full of MSVC options given this will be
|
||||
# building with mingw, it'll have an unhappy time with that and
|
||||
# we need to clear them out.
|
||||
set(AOM_CMAKE_FLAGS )
|
||||
# CMake will correctly identify phreads being available, however
|
||||
# we do not want to use them, as that gains a dependency on
|
||||
# libpthreadswin.dll which we do not want. when pthreads is not
|
||||
# available oam will use a pthreads emulation layer using win32 threads
|
||||
set(AOM_EXTRA_ARGS_WIN32 -DCMAKE_HAVE_PTHREAD_H=OFF)
|
||||
else()
|
||||
set(AOM_GENERATOR "Unix Makefiles")
|
||||
set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
|
||||
endif()
|
||||
|
||||
set(AOM_EXTRA_ARGS
|
||||
-DENABLE_TESTDATA=OFF
|
||||
-DENABLE_TESTS=OFF
|
||||
-DENABLE_TOOLS=OFF
|
||||
-DENABLE_EXAMPLES=OFF
|
||||
${AOM_EXTRA_ARGS_WIN32}
|
||||
)
|
||||
|
||||
# This is slightly different from all other deps in the way that
|
||||
# aom uses cmake as a build system, but still needs the environment setup
|
||||
# to include perl so we manually setup the environment and call
|
||||
# cmake directly for the configure, build and install commands.
|
||||
|
||||
ExternalProject_Add(external_aom
|
||||
URL file://${PACKAGE_DIR}/${AOM_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
|
||||
PREFIX ${BUILD_DIR}/aom
|
||||
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
|
||||
cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
|
||||
${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build .
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
|
||||
INSTALL_DIR ${LIBDIR}/aom
|
||||
)
|
@@ -12,21 +12,13 @@ if(UNIX)
|
||||
automake
|
||||
bison
|
||||
${_libtoolize_name}
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
tclsh
|
||||
yasm
|
||||
)
|
||||
|
||||
if(NOT APPLE)
|
||||
set(_required_software
|
||||
${_required_software}
|
||||
|
||||
# Needed for Mesa.
|
||||
meson
|
||||
ninja
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(_software ${_required_software})
|
||||
find_program(_software_find NAMES ${_software})
|
||||
if(NOT _software_find)
|
||||
@@ -54,13 +46,10 @@ if(UNIX)
|
||||
" ${_software_missing}\n"
|
||||
"\n"
|
||||
"On Debian and Ubuntu:\n"
|
||||
" apt install autoconf automake libtool yasm tcl ninja-build meson python3-mako\n"
|
||||
" apt install autoconf automake bison libtool yasm tcl ninja-build meson python3-mako\n"
|
||||
"\n"
|
||||
"On macOS Intel (with homebrew):\n"
|
||||
" brew install autoconf automake bison libtool pkg-config yasm\n"
|
||||
"\n"
|
||||
"On macOS ARM (with homebrew):\n"
|
||||
" brew install autoconf automake bison flex libtool pkg-config yasm\n"
|
||||
"On macOS (with homebrew):\n"
|
||||
" brew install autoconf automake bison flex libtool meson ninja pkg-config yasm\n"
|
||||
"\n"
|
||||
"Other platforms:\n"
|
||||
" Install equivalent packages.\n")
|
||||
|
@@ -14,6 +14,20 @@ function(download_source dep)
|
||||
else()
|
||||
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
|
||||
endif()
|
||||
# Validate all required variables are set and give an explicit error message
|
||||
# rather than CMake erroring out later on with a more ambigious error.
|
||||
if (NOT DEFINED TARGET_FILE)
|
||||
message(FATAL_ERROR "${dep}_FILE variable not set")
|
||||
endif()
|
||||
if (NOT DEFINED TARGET_HASH)
|
||||
message(FATAL_ERROR "${dep}_HASH variable not set")
|
||||
endif()
|
||||
if (NOT DEFINED TARGET_HASH_TYPE)
|
||||
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
|
||||
endif()
|
||||
if (NOT DEFINED TARGET_URI)
|
||||
message(FATAL_ERROR "${dep}_URI variable not set")
|
||||
endif()
|
||||
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
|
||||
message("Checking source : ${dep} (${TARGET_FILE})")
|
||||
if(NOT EXISTS ${TARGET_FILE})
|
||||
@@ -25,6 +39,36 @@ function(download_source dep)
|
||||
SHOW_PROGRESS
|
||||
)
|
||||
endif()
|
||||
if(EXISTS ${TARGET_FILE})
|
||||
# Sometimes the download fails, but that is not a
|
||||
# fail condition for "file(DOWNLOAD" it will warn about
|
||||
# a crc mismatch and just carry on, we need to explicitly
|
||||
# catch this and remove the bogus 0 byte file so we can
|
||||
# retry without having to go find the file and manually
|
||||
# delete it.
|
||||
file (SIZE ${TARGET_FILE} TARGET_SIZE)
|
||||
if(${TARGET_SIZE} EQUAL 0)
|
||||
file(REMOVE ${TARGET_FILE})
|
||||
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")
|
||||
endif()
|
||||
|
||||
# If we are using sources from the blender repo also
|
||||
# validate that the hashes match, this takes a
|
||||
# little more time, but protects us when we are
|
||||
# building a release package and one of the packages
|
||||
# is missing or incorrect.
|
||||
#
|
||||
# For regular platform maintenaince this is not needed
|
||||
# since the actual build of the dep will notify the
|
||||
# platform maintainer if there is a problem with the
|
||||
# source package and refuse to build.
|
||||
if(NOT PACKAGE_USE_UPSTREAM_SOURCES)
|
||||
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
|
||||
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
|
||||
message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction(download_source)
|
||||
|
||||
download_source(ZLIB)
|
||||
@@ -36,7 +80,7 @@ download_source(BLOSC)
|
||||
download_source(PTHREADS)
|
||||
download_source(OPENEXR)
|
||||
download_source(FREETYPE)
|
||||
download_source(GLEW)
|
||||
download_source(EPOXY)
|
||||
download_source(FREEGLUT)
|
||||
download_source(ALEMBIC)
|
||||
download_source(OPENSUBDIV)
|
||||
@@ -51,7 +95,6 @@ download_source(OSL)
|
||||
download_source(PYTHON)
|
||||
download_source(TBB)
|
||||
download_source(OPENVDB)
|
||||
download_source(NANOVDB)
|
||||
download_source(NUMPY)
|
||||
download_source(LAME)
|
||||
download_source(OGG)
|
||||
@@ -89,15 +132,34 @@ download_source(MESA)
|
||||
download_source(NASM)
|
||||
download_source(XR_OPENXR_SDK)
|
||||
download_source(WL_PROTOCOLS)
|
||||
download_source(WAYLAND)
|
||||
download_source(ISPC)
|
||||
download_source(GMP)
|
||||
download_source(POTRACE)
|
||||
download_source(HARU)
|
||||
download_source(ZSTD)
|
||||
download_source(SSE2NEON)
|
||||
download_source(FLEX)
|
||||
download_source(BROTLI)
|
||||
download_source(FMT)
|
||||
download_source(ROBINMAP)
|
||||
download_source(IMATH)
|
||||
download_source(PYSTRING)
|
||||
download_source(OPENPGL)
|
||||
download_source(LEVEL_ZERO)
|
||||
download_source(DPCPP)
|
||||
download_source(VCINTRINSICS)
|
||||
download_source(OPENCLHEADERS)
|
||||
download_source(ICDLOADER)
|
||||
download_source(MP11)
|
||||
download_source(SPIRV_HEADERS)
|
||||
download_source(IGC)
|
||||
download_source(IGC_LLVM)
|
||||
download_source(IGC_OPENCL_CLANG)
|
||||
download_source(IGC_VCINTRINSICS)
|
||||
download_source(IGC_SPIRV_HEADERS)
|
||||
download_source(IGC_SPIRV_TOOLS)
|
||||
download_source(IGC_SPIRV_TRANSLATOR)
|
||||
download_source(GMMLIB)
|
||||
download_source(OCLOC)
|
||||
download_source(AOM)
|
||||
|
109
build_files/build_environment/cmake/dpcpp.cmake
Normal file
109
build_files/build_environment/cmake/dpcpp.cmake
Normal file
@@ -0,0 +1,109 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(LLVM_GENERATOR "Ninja")
|
||||
else()
|
||||
set(LLVM_GENERATOR "Unix Makefiles")
|
||||
endif()
|
||||
|
||||
set(DPCPP_CONFIGURE_ARGS
|
||||
# When external deps dpcpp needs are not found it will automatically
|
||||
# download the during the configure stage using FetchContent. Given
|
||||
# we need to keep an archive of all source used during build for compliance
|
||||
# reasons it CANNOT download anything we do not know about. By setting
|
||||
# this property to ON, all downloads are disabled, and we will have to
|
||||
# provide the missing deps some other way, a build error beats a compliance
|
||||
# violation
|
||||
--cmake-opt FETCHCONTENT_FULLY_DISCONNECTED=ON
|
||||
)
|
||||
set(DPCPP_SOURCE_ROOT ${BUILD_DIR}/dpcpp/src/external_dpcpp/)
|
||||
set(DPCPP_EXTRA_ARGS
|
||||
# When external deps dpcpp needs are not found it will automatically
|
||||
# download the during the configure stage using FetchContent. Given
|
||||
# we need to keep an archive of all source used during build for compliance
|
||||
# reasons it CANNOT download anything we do not know about. By setting
|
||||
# this property to ON, all downloads are disabled, and we will have to
|
||||
# provide the missing deps some other way, a build or configure error
|
||||
# beats a compliance violation
|
||||
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
|
||||
-DLLVMGenXIntrinsics_SOURCE_DIR=${BUILD_DIR}/vcintrinsics/src/external_vcintrinsics/
|
||||
-DOpenCL_HEADERS=file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
|
||||
-DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE}
|
||||
-DBOOST_MP11_SOURCE_DIR=${BUILD_DIR}/mp11/src/external_mp11/
|
||||
-DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT}
|
||||
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include
|
||||
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/spirvheaders/src/external_spirvheaders/
|
||||
# Below here is copied from an invocation of buildbot/config.py
|
||||
-DLLVM_ENABLE_ASSERTIONS=ON
|
||||
-DLLVM_TARGETS_TO_BUILD=X86
|
||||
-DLLVM_EXTERNAL_PROJECTS=sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
|
||||
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/sycl
|
||||
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/llvm-spirv
|
||||
-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
|
||||
-DXPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
|
||||
-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xptifw
|
||||
-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/libdevice
|
||||
-DLLVM_ENABLE_PROJECTS=clang^^sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
|
||||
-DLIBCLC_TARGETS_TO_BUILD=
|
||||
-DLIBCLC_GENERATE_REMANGLED_VARIANTS=OFF
|
||||
-DSYCL_BUILD_PI_HIP_PLATFORM=AMD
|
||||
-DLLVM_BUILD_TOOLS=ON
|
||||
-DSYCL_ENABLE_WERROR=OFF
|
||||
-DSYCL_INCLUDE_TESTS=ON
|
||||
-DLLVM_ENABLE_DOXYGEN=OFF
|
||||
-DLLVM_ENABLE_SPHINX=OFF
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DSYCL_ENABLE_XPTI_TRACING=ON
|
||||
-DLLVM_ENABLE_LLD=OFF
|
||||
-DXPTI_ENABLE_WERROR=OFF
|
||||
-DSYCL_CLANG_EXTRA_FLAGS=
|
||||
-DSYCL_ENABLE_PLUGINS=level_zero
|
||||
-DCMAKE_INSTALL_RPATH=\$ORIGIN
|
||||
-DPython3_ROOT_DIR=${LIBDIR}/python/
|
||||
-DPython3_EXECUTABLE=${PYTHON_BINARY}
|
||||
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
|
||||
-DLLDB_ENABLE_CURSES=OFF
|
||||
-DLLVM_ENABLE_TERMINFO=OFF
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_dpcpp
|
||||
URL file://${PACKAGE_DIR}/${DPCPP_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${DPCPP_HASH_TYPE}=${DPCPP_HASH}
|
||||
PREFIX ${BUILD_DIR}/dpcpp
|
||||
CMAKE_GENERATOR ${LLVM_GENERATOR}
|
||||
SOURCE_SUBDIR llvm
|
||||
LIST_SEPARATOR ^^
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp ${DEFAULT_CMAKE_FLAGS} ${DPCPP_EXTRA_ARGS}
|
||||
#CONFIGURE_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
|
||||
#BUILD_COMMAND echo "." #${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/dpcpp/src/external_dpcpp < ${PATCH_DIR}/dpcpp.diff
|
||||
INSTALL_DIR ${LIBDIR}/dpcpp
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
external_dpcpp
|
||||
external_python
|
||||
external_python_site_packages
|
||||
external_vcintrinsics
|
||||
external_openclheaders
|
||||
external_icdloader
|
||||
external_mp11
|
||||
external_level-zero
|
||||
external_spirvheaders
|
||||
)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release AND WIN32)
|
||||
ExternalProject_Add_Step(external_dpcpp after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cl.exe
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cpp.exe
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang.exe
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/dpcpp ${HARVEST_TARGET}/dpcpp
|
||||
)
|
||||
endif()
|
61
build_files/build_environment/cmake/dpcpp_deps.cmake
Normal file
61
build_files/build_environment/cmake/dpcpp_deps.cmake
Normal file
@@ -0,0 +1,61 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# These are build time requirements for dpcpp
|
||||
# We only have to unpack these dpcpp will build
|
||||
# them.
|
||||
|
||||
ExternalProject_Add(external_vcintrinsics
|
||||
URL file://${PACKAGE_DIR}/${VCINTRINSICS_FILE}
|
||||
URL_HASH ${VCINTRINSICS_HASH_TYPE}=${VCINTRINSICS_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/vcintrinsics
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
||||
|
||||
# opencl headers do not have to be unpacked, dpcpp will do it
|
||||
# but it wouldn't hurt to do it anyway as an opertunity to validate
|
||||
# the hash is correct.
|
||||
ExternalProject_Add(external_openclheaders
|
||||
URL file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
|
||||
URL_HASH ${OPENCLHEADERS_HASH_TYPE}=${OPENCLHEADERS_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/openclheaders
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
||||
|
||||
# icdloader does not have to be unpacked, dpcpp will do it
|
||||
# but it wouldn't hurt to do it anyway as an opertunity to validate
|
||||
# the hash is correct.
|
||||
ExternalProject_Add(external_icdloader
|
||||
URL file://${PACKAGE_DIR}/${ICDLOADER_FILE}
|
||||
URL_HASH ${ICDLOADER_HASH_TYPE}=${ICDLOADER_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/icdloader
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_mp11
|
||||
URL file://${PACKAGE_DIR}/${MP11_FILE}
|
||||
URL_HASH ${MP11_HASH_TYPE}=${MP11_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/mp11
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_spirvheaders
|
||||
URL file://${PACKAGE_DIR}/${SPIRV_HEADERS_FILE}
|
||||
URL_HASH ${SPIRV_HEADERS_HASH_TYPE}=${SPIRV_HEADERS_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/spirvheaders
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
@@ -10,18 +10,12 @@ set(EMBREE_EXTRA_ARGS
|
||||
-DEMBREE_RAY_MASK=ON
|
||||
-DEMBREE_FILTER_FUNCTION=ON
|
||||
-DEMBREE_BACKFACE_CULLING=OFF
|
||||
-DEMBREE_MAX_ISA=AVX2
|
||||
-DEMBREE_TASKING_SYSTEM=TBB
|
||||
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
|
||||
-DTBB_ROOT=${LIBDIR}/tbb
|
||||
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
|
||||
)
|
||||
|
||||
if(BLENDER_PLATFORM_ARM)
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
${EMBREE_EXTRA_ARGS}
|
||||
-DEMBREE_MAX_ISA=NEON)
|
||||
else()
|
||||
if (NOT BLENDER_PLATFORM_ARM)
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
${EMBREE_EXTRA_ARGS}
|
||||
-DEMBREE_MAX_ISA=AVX2)
|
||||
@@ -30,23 +24,10 @@ endif()
|
||||
if(TBB_STATIC_LIBRARY)
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
${EMBREE_EXTRA_ARGS}
|
||||
-DEMBREE_TBB_LIBRARY_NAME=tbb_static
|
||||
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static
|
||||
-DEMBREE_TBB_COMPONENT=tbb_static
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
list(APPEND EMBREE_EXTRA_ARGS
|
||||
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_debug
|
||||
-DEMBREE_TBB_LIBRARY_NAME=tbb_debug
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
set(EMBREE_BUILD_DIR)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_embree
|
||||
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
|
25
build_files/build_environment/cmake/epoxy.cmake
Normal file
25
build_files/build_environment/cmake/epoxy.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
if(WIN32)
|
||||
set(EPOXY_LIB_TYPE shared)
|
||||
else()
|
||||
set(EPOXY_LIB_TYPE static)
|
||||
endif()
|
||||
ExternalProject_Add(external_epoxy
|
||||
URL file://${PACKAGE_DIR}/${EPOXY_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH}
|
||||
PREFIX ${BUILD_DIR}/epoxy
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff
|
||||
CONFIGURE_COMMAND ${CONFIGURE_ENV} && meson setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false
|
||||
BUILD_COMMAND ninja
|
||||
INSTALL_COMMAND ninja install
|
||||
)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release AND WIN32)
|
||||
ExternalProject_Add_Step(external_epoxy after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/epoxy/include ${HARVEST_TARGET}/epoxy/include
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/bin/epoxy-0.dll ${HARVEST_TARGET}/epoxy/bin/epoxy-0.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/lib/epoxy.lib ${HARVEST_TARGET}/epoxy/lib/epoxy.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
@@ -1,9 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
|
||||
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
|
||||
set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include -I${mingw_LIBDIR}/aom/include")
|
||||
set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib -L${mingw_LIBDIR}/aom/lib")
|
||||
set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
|
||||
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:)
|
||||
set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:${mingw_LIBDIR}/aom/lib/pkgconfig:)
|
||||
|
||||
if(WIN32)
|
||||
set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
|
||||
@@ -79,6 +79,7 @@ ExternalProject_Add(external_ffmpeg
|
||||
--disable-librtmp
|
||||
--enable-libx264
|
||||
--enable-libxvid
|
||||
--enable-libaom
|
||||
--disable-libopencore-amrnb
|
||||
--disable-libopencore-amrwb
|
||||
--disable-libdc1394
|
||||
@@ -125,6 +126,7 @@ add_dependencies(
|
||||
external_vorbis
|
||||
external_ogg
|
||||
external_lame
|
||||
external_aom
|
||||
)
|
||||
if(WIN32)
|
||||
add_dependencies(
|
||||
|
@@ -1,16 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(GLEW_EXTRA_ARGS
|
||||
-DBUILD_UTILS=Off
|
||||
-DBUILD_SHARED_LIBS=Off
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_glew
|
||||
URL file://${PACKAGE_DIR}/${GLEW_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${GLEW_HASH_TYPE}=${GLEW_HASH}
|
||||
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
|
||||
PREFIX ${BUILD_DIR}/glew
|
||||
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/glew
|
||||
)
|
13
build_files/build_environment/cmake/gmmlib.cmake
Normal file
13
build_files/build_environment/cmake/gmmlib.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(GMMLIB_EXTRA_ARGS
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_gmmlib
|
||||
URL file://${PACKAGE_DIR}/${GMMLIB_FILE}
|
||||
URL_HASH ${GMMLIB_HASH_TYPE}=${GMMLIB_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/gmmlib
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmmlib ${DEFAULT_CMAKE_FLAGS} ${GMMLIB_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/gmmlib
|
||||
)
|
@@ -11,187 +11,192 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
|
||||
|
||||
if(WIN32)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
add_custom_target(Harvest_Release_Results
|
||||
COMMAND # jpeg rename libfile + copy include
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
|
||||
# png
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
|
||||
# freeglut-> opengl
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
|
||||
# glew-> opengl
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
|
||||
# tiff
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
|
||||
DEPENDS
|
||||
)
|
||||
endif()
|
||||
|
||||
else(WIN32)
|
||||
|
||||
function(harvest from to)
|
||||
set(pattern "")
|
||||
foreach(f ${ARGN})
|
||||
set(pattern ${f})
|
||||
endforeach()
|
||||
|
||||
if(pattern STREQUAL "")
|
||||
get_filename_component(dirpath ${to} DIRECTORY)
|
||||
get_filename_component(filename ${to} NAME)
|
||||
install(
|
||||
FILES ${LIBDIR}/${from}
|
||||
DESTINATION ${HARVEST_TARGET}/${dirpath}
|
||||
RENAME ${filename})
|
||||
else()
|
||||
install(
|
||||
DIRECTORY ${LIBDIR}/${from}/
|
||||
DESTINATION ${HARVEST_TARGET}/${to}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING PATTERN ${pattern}
|
||||
PATTERN "pkgconfig" EXCLUDE
|
||||
PATTERN "cmake" EXCLUDE
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
PATTERN "tests" EXCLUDE)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
add_custom_target(Harvest_Release_Results
|
||||
COMMAND # jpeg rename libfile + copy include
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
|
||||
# png
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
|
||||
# freeglut-> opengl
|
||||
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
|
||||
DEPENDS
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
harvest(alembic/include alembic/include "*.h")
|
||||
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
|
||||
harvest(alembic/bin alembic/bin "*")
|
||||
harvest(brotli/include brotli/include "*.h")
|
||||
harvest(brotli/lib brotli/lib "*.a")
|
||||
harvest(boost/include boost/include "*")
|
||||
harvest(boost/lib boost/lib "*.a")
|
||||
harvest(imath/include imath/include "*.h")
|
||||
harvest(imath/lib imath/lib "*.a")
|
||||
harvest(ffmpeg/include ffmpeg/include "*.h")
|
||||
harvest(ffmpeg/lib ffmpeg/lib "*.a")
|
||||
harvest(fftw3/include fftw3/include "*.h")
|
||||
harvest(fftw3/lib fftw3/lib "*.a")
|
||||
harvest(flac/lib sndfile/lib "libFLAC.a")
|
||||
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(jpeg/include jpeg/include "*.h")
|
||||
harvest(jpeg/lib jpeg/lib "libjpeg.a")
|
||||
harvest(lame/lib ffmpeg/lib "*.a")
|
||||
if(NOT APPLE)
|
||||
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
|
||||
harvest(level-zero/lib level-zero/lib "*.so*")
|
||||
endif()
|
||||
harvest(llvm/bin llvm/bin "clang-format")
|
||||
if(BUILD_CLANG_TOOLS)
|
||||
harvest(llvm/bin llvm/bin "clang-tidy")
|
||||
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
|
||||
endif()
|
||||
harvest(llvm/include llvm/include "*")
|
||||
harvest(llvm/bin llvm/bin "llvm-config")
|
||||
harvest(llvm/lib llvm/lib "libLLVM*.a")
|
||||
harvest(llvm/lib llvm/lib "libclang*.a")
|
||||
harvest(llvm/lib/clang llvm/lib/clang "*.h")
|
||||
if(APPLE)
|
||||
harvest(openmp/lib openmp/lib "*")
|
||||
harvest(openmp/include openmp/include "*.h")
|
||||
endif()
|
||||
if(BLENDER_PLATFORM_ARM)
|
||||
harvest(sse2neon sse2neon "*.h")
|
||||
endif()
|
||||
harvest(ogg/lib ffmpeg/lib "*.a")
|
||||
harvest(openal/include openal/include "*.h")
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(openal/lib openal/lib "*.a")
|
||||
|
||||
harvest(blosc/include blosc/include "*.h")
|
||||
harvest(blosc/lib blosc/lib "*.a")
|
||||
|
||||
harvest(zlib/include zlib/include "*.h")
|
||||
harvest(zlib/lib zlib/lib "*.a")
|
||||
|
||||
harvest(xml2/include xml2/include "*.h")
|
||||
harvest(xml2/lib xml2/lib "*.a")
|
||||
|
||||
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
|
||||
else()
|
||||
harvest(blosc/lib openvdb/lib "*.a")
|
||||
harvest(xml2/lib opencollada/lib "*.a")
|
||||
endif()
|
||||
harvest(opencollada/include/opencollada opencollada/include "*.h")
|
||||
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
|
||||
harvest(opencolorio/include opencolorio/include "*.h")
|
||||
harvest(opencolorio/lib opencolorio/lib "*.a")
|
||||
harvest(opencolorio/lib/static opencolorio/lib "*.a")
|
||||
harvest(openexr/include openexr/include "*.h")
|
||||
harvest(openexr/lib openexr/lib "*.a")
|
||||
harvest(openimageio/bin openimageio/bin "idiff")
|
||||
harvest(openimageio/bin openimageio/bin "maketx")
|
||||
harvest(openimageio/bin openimageio/bin "oiiotool")
|
||||
harvest(openimageio/include openimageio/include "*")
|
||||
harvest(openimageio/lib openimageio/lib "*.a")
|
||||
harvest(openimagedenoise/include openimagedenoise/include "*")
|
||||
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
|
||||
harvest(embree/include embree/include "*.h")
|
||||
harvest(embree/lib embree/lib "*.a")
|
||||
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
|
||||
harvest(openjpeg/lib openjpeg/lib "*.a")
|
||||
harvest(opensubdiv/include opensubdiv/include "*.h")
|
||||
harvest(opensubdiv/lib opensubdiv/lib "*.a")
|
||||
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
|
||||
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
|
||||
harvest(openvdb/lib openvdb/lib "*.a")
|
||||
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
|
||||
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
|
||||
harvest(osl/bin osl/bin "oslc")
|
||||
harvest(osl/include osl/include "*.h")
|
||||
harvest(osl/lib osl/lib "*.a")
|
||||
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
|
||||
harvest(png/include png/include "*.h")
|
||||
harvest(png/lib png/lib "*.a")
|
||||
harvest(pugixml/include pugixml/include "*.hpp")
|
||||
harvest(pugixml/lib pugixml/lib "*.a")
|
||||
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
|
||||
harvest(python/include python/include "*h")
|
||||
harvest(python/lib python/lib "*")
|
||||
harvest(sdl/include/SDL2 sdl/include "*.h")
|
||||
harvest(sdl/lib sdl/lib "libSDL2.a")
|
||||
harvest(sndfile/include sndfile/include "*.h")
|
||||
harvest(sndfile/lib sndfile/lib "*.a")
|
||||
harvest(spnav/include spnav/include "*.h")
|
||||
harvest(spnav/lib spnav/lib "*.a")
|
||||
harvest(tbb/include tbb/include "*.h")
|
||||
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
|
||||
harvest(theora/lib ffmpeg/lib "*.a")
|
||||
harvest(tiff/include tiff/include "*.h")
|
||||
harvest(tiff/lib tiff/lib "*.a")
|
||||
harvest(vorbis/lib ffmpeg/lib "*.a")
|
||||
harvest(opus/lib ffmpeg/lib "*.a")
|
||||
harvest(vpx/lib ffmpeg/lib "*.a")
|
||||
harvest(x264/lib ffmpeg/lib "*.a")
|
||||
harvest(xvidcore/lib ffmpeg/lib "*.a")
|
||||
harvest(webp/lib webp/lib "*.a")
|
||||
harvest(webp/include webp/include "*.h")
|
||||
harvest(usd/include usd/include "*.h")
|
||||
harvest(usd/lib/usd usd/lib/usd "*")
|
||||
harvest(usd/plugin usd/plugin "*")
|
||||
harvest(potrace/include potrace/include "*.h")
|
||||
harvest(potrace/lib potrace/lib "*.a")
|
||||
harvest(haru/include haru/include "*.h")
|
||||
harvest(haru/lib haru/lib "*.a")
|
||||
harvest(zstd/include zstd/include "*.h")
|
||||
harvest(zstd/lib zstd/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
harvest(mesa/lib64 mesa/lib "*.so*")
|
||||
endif()
|
||||
function(harvest from to)
|
||||
set(pattern "")
|
||||
foreach(f ${ARGN})
|
||||
set(pattern ${f})
|
||||
endforeach()
|
||||
|
||||
if(pattern STREQUAL "")
|
||||
get_filename_component(dirpath ${to} DIRECTORY)
|
||||
get_filename_component(filename ${to} NAME)
|
||||
install(
|
||||
FILES ${LIBDIR}/${from}
|
||||
DESTINATION ${HARVEST_TARGET}/${dirpath}
|
||||
RENAME ${filename}
|
||||
)
|
||||
else()
|
||||
install(
|
||||
DIRECTORY ${LIBDIR}/${from}/
|
||||
DESTINATION ${HARVEST_TARGET}/${to}
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING PATTERN ${pattern}
|
||||
PATTERN "pkgconfig" EXCLUDE
|
||||
PATTERN "cmake" EXCLUDE
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
PATTERN "tests" EXCLUDE
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
harvest(alembic/include alembic/include "*.h")
|
||||
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
|
||||
harvest(alembic/bin alembic/bin "*")
|
||||
harvest(brotli/include brotli/include "*.h")
|
||||
harvest(brotli/lib brotli/lib "*.a")
|
||||
harvest(boost/include boost/include "*")
|
||||
harvest(boost/lib boost/lib "*.a")
|
||||
harvest(imath/include imath/include "*.h")
|
||||
harvest(imath/lib imath/lib "*.a")
|
||||
harvest(ffmpeg/include ffmpeg/include "*.h")
|
||||
harvest(ffmpeg/lib ffmpeg/lib "*.a")
|
||||
harvest(fftw3/include fftw3/include "*.h")
|
||||
harvest(fftw3/lib fftw3/lib "*.a")
|
||||
harvest(flac/lib sndfile/lib "libFLAC.a")
|
||||
harvest(freetype/include freetype/include "*.h")
|
||||
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
|
||||
harvest(epoxy/include epoxy/include "*.h")
|
||||
harvest(epoxy/lib epoxy/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(jpeg/include jpeg/include "*.h")
|
||||
harvest(jpeg/lib jpeg/lib "libjpeg.a")
|
||||
harvest(lame/lib ffmpeg/lib "*.a")
|
||||
if(NOT APPLE)
|
||||
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
|
||||
harvest(level-zero/lib level-zero/lib "*.so*")
|
||||
endif()
|
||||
harvest(llvm/bin llvm/bin "clang-format")
|
||||
if(BUILD_CLANG_TOOLS)
|
||||
harvest(llvm/bin llvm/bin "clang-tidy")
|
||||
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
|
||||
endif()
|
||||
harvest(llvm/include llvm/include "*")
|
||||
harvest(llvm/bin llvm/bin "llvm-config")
|
||||
harvest(llvm/lib llvm/lib "libLLVM*.a")
|
||||
harvest(llvm/lib llvm/lib "libclang*.a")
|
||||
harvest(llvm/lib/clang llvm/lib/clang "*.h")
|
||||
if(APPLE)
|
||||
harvest(openmp/lib openmp/lib "*")
|
||||
harvest(openmp/include openmp/include "*.h")
|
||||
endif()
|
||||
if(BLENDER_PLATFORM_ARM)
|
||||
harvest(sse2neon sse2neon "*.h")
|
||||
endif()
|
||||
harvest(ogg/lib ffmpeg/lib "*.a")
|
||||
harvest(openal/include openal/include "*.h")
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(openal/lib openal/lib "*.a")
|
||||
|
||||
harvest(blosc/include blosc/include "*.h")
|
||||
harvest(blosc/lib blosc/lib "*.a")
|
||||
|
||||
harvest(zlib/include zlib/include "*.h")
|
||||
harvest(zlib/lib zlib/lib "*.a")
|
||||
|
||||
harvest(xml2/include xml2/include "*.h")
|
||||
harvest(xml2/lib xml2/lib "*.a")
|
||||
|
||||
harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
|
||||
harvest(wayland/bin wayland/bin "wayland-scanner")
|
||||
else()
|
||||
harvest(blosc/lib openvdb/lib "*.a")
|
||||
harvest(xml2/lib opencollada/lib "*.a")
|
||||
endif()
|
||||
harvest(opencollada/include/opencollada opencollada/include "*.h")
|
||||
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
|
||||
harvest(opencolorio/include opencolorio/include "*.h")
|
||||
harvest(opencolorio/lib opencolorio/lib "*.a")
|
||||
harvest(opencolorio/lib/static opencolorio/lib "*.a")
|
||||
harvest(openexr/include openexr/include "*.h")
|
||||
harvest(openexr/lib openexr/lib "*.a")
|
||||
harvest(openimageio/bin openimageio/bin "idiff")
|
||||
harvest(openimageio/bin openimageio/bin "maketx")
|
||||
harvest(openimageio/bin openimageio/bin "oiiotool")
|
||||
harvest(openimageio/include openimageio/include "*")
|
||||
harvest(openimageio/lib openimageio/lib "*.a")
|
||||
harvest(openimagedenoise/include openimagedenoise/include "*")
|
||||
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
|
||||
harvest(embree/include embree/include "*.h")
|
||||
harvest(embree/lib embree/lib "*.a")
|
||||
harvest(openpgl/include openpgl/include "*.h")
|
||||
harvest(openpgl/lib openpgl/lib "*.a")
|
||||
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake")
|
||||
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h")
|
||||
harvest(openjpeg/lib openjpeg/lib "*.a")
|
||||
harvest(opensubdiv/include opensubdiv/include "*.h")
|
||||
harvest(opensubdiv/lib opensubdiv/lib "*.a")
|
||||
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
|
||||
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
|
||||
harvest(openvdb/lib openvdb/lib "*.a")
|
||||
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
|
||||
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
|
||||
harvest(osl/bin osl/bin "oslc")
|
||||
harvest(osl/include osl/include "*.h")
|
||||
harvest(osl/lib osl/lib "*.a")
|
||||
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
|
||||
harvest(png/include png/include "*.h")
|
||||
harvest(png/lib png/lib "*.a")
|
||||
harvest(pugixml/include pugixml/include "*.hpp")
|
||||
harvest(pugixml/lib pugixml/lib "*.a")
|
||||
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
|
||||
harvest(python/include python/include "*h")
|
||||
harvest(python/lib python/lib "*")
|
||||
harvest(sdl/include/SDL2 sdl/include "*.h")
|
||||
harvest(sdl/lib sdl/lib "libSDL2.a")
|
||||
harvest(sndfile/include sndfile/include "*.h")
|
||||
harvest(sndfile/lib sndfile/lib "*.a")
|
||||
harvest(spnav/include spnav/include "*.h")
|
||||
harvest(spnav/lib spnav/lib "*.a")
|
||||
harvest(tbb/include tbb/include "*.h")
|
||||
harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
|
||||
harvest(theora/lib ffmpeg/lib "*.a")
|
||||
harvest(tiff/include tiff/include "*.h")
|
||||
harvest(tiff/lib tiff/lib "*.a")
|
||||
harvest(vorbis/lib ffmpeg/lib "*.a")
|
||||
harvest(opus/lib ffmpeg/lib "*.a")
|
||||
harvest(vpx/lib ffmpeg/lib "*.a")
|
||||
harvest(x264/lib ffmpeg/lib "*.a")
|
||||
harvest(xvidcore/lib ffmpeg/lib "*.a")
|
||||
harvest(aom/lib ffmpeg/lib "*.a")
|
||||
harvest(webp/lib webp/lib "*.a")
|
||||
harvest(webp/include webp/include "*.h")
|
||||
harvest(usd/include usd/include "*.h")
|
||||
harvest(usd/lib/usd usd/lib/usd "*")
|
||||
harvest(usd/plugin usd/plugin "*")
|
||||
harvest(potrace/include potrace/include "*.h")
|
||||
harvest(potrace/lib potrace/lib "*.a")
|
||||
harvest(haru/include haru/include "*.h")
|
||||
harvest(haru/lib haru/lib "*.a")
|
||||
harvest(zstd/include zstd/include "*.h")
|
||||
harvest(zstd/lib zstd/lib "*.a")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
harvest(libglu/lib mesa/lib "*.so*")
|
||||
harvest(mesa/lib64 mesa/lib "*.so*")
|
||||
|
||||
harvest(dpcpp dpcpp "*")
|
||||
harvest(igc dpcpp/lib/igc "*")
|
||||
harvest(ocloc dpcpp/lib/ocloc "*")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
126
build_files/build_environment/cmake/igc.cmake
Normal file
126
build_files/build_environment/cmake/igc.cmake
Normal file
@@ -0,0 +1,126 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
unpack_only(igc_vcintrinsics)
|
||||
unpack_only(igc_spirv_headers)
|
||||
unpack_only(igc_spirv_tools)
|
||||
|
||||
#
|
||||
# igc_opencl_clang contains patches that need to be applied
|
||||
# to external_igc_llvm and igc_spirv_translator, we unpack
|
||||
# igc_opencl_clang first, then have the patch stages of
|
||||
# external_igc_llvm and igc_spirv_translator apply them.
|
||||
#
|
||||
|
||||
ExternalProject_Add(external_igc_opencl_clang
|
||||
URL file://${PACKAGE_DIR}/${IGC_OPENCL_CLANG_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${IGC_OPENCL_CLANG_HASH_TYPE}=${IGC_OPENCL_CLANG_HASH}
|
||||
PREFIX ${BUILD_DIR}/igc_opencl_clang
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ < ${PATCH_DIR}/igc_opencl_clang.diff
|
||||
)
|
||||
|
||||
set(IGC_OPENCL_CLANG_PATCH_DIR ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/patches)
|
||||
set(IGC_LLVM_SOURCE_DIR ${BUILD_DIR}/igc_llvm/src/external_igc_llvm)
|
||||
set(IGC_SPIRV_TRANSLATOR_SOURCE_DIR ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator)
|
||||
|
||||
ExternalProject_Add(external_igc_llvm
|
||||
URL file://${PACKAGE_DIR}/${IGC_LLVM_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${IGC_LLVM_HASH_TYPE}=${IGC_LLVM_HASH}
|
||||
PREFIX ${BUILD_DIR}/igc_llvm
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-OpenCL-3.0-support.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch
|
||||
)
|
||||
add_dependencies(
|
||||
external_igc_llvm
|
||||
external_igc_opencl_clang
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_igc_spirv_translator
|
||||
URL file://${PACKAGE_DIR}/${IGC_SPIRV_TRANSLATOR_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${IGC_SPIRV_TRANSLATOR_HASH_TYPE}=${IGC_SPIRV_TRANSLATOR_HASH}
|
||||
PREFIX ${BUILD_DIR}/igc_spirv_translator
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0001-update-SPIR-V-headers-for-SPV_INTEL_split_barrier.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch &&
|
||||
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0003-Support-cl_bf16_conversions.patch
|
||||
)
|
||||
add_dependencies(
|
||||
external_igc_spirv_translator
|
||||
external_igc_opencl_clang
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(IGC_GENERATOR "Ninja")
|
||||
set(IGC_TARGET Windows64)
|
||||
else()
|
||||
set(IGC_GENERATOR "Unix Makefiles")
|
||||
set(IGC_TARGET Linux64)
|
||||
endif()
|
||||
|
||||
set(IGC_EXTRA_ARGS
|
||||
-DIGC_OPTION__ARCHITECTURE_TARGET=${IGC_TARGET}
|
||||
-DIGC_OPTION__ARCHITECTURE_HOST=${IGC_TARGET}
|
||||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
list(APPEND IGC_EXTRA_ARGS
|
||||
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||
-DFLEX_INCLUDE_DIR=${LIBDIR}/flex/include
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_igc
|
||||
URL file://${PACKAGE_DIR}/${IGC_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${IGC_HASH_TYPE}=${IGC_HASH}
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igc ${DEFAULT_CMAKE_FLAGS} ${IGC_EXTRA_ARGS}
|
||||
|
||||
# IGC is pretty set in its way where sub projects ought to live, for some it offers
|
||||
# hooks to supply alternatives folders, other are just hardocded with no way to configure
|
||||
# we symlink everything here, since it's less work than trying to convince the cmake
|
||||
# scripts to accept alternative locations.
|
||||
#
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_llvm/src/external_igc_llvm/ ${BUILD_DIR}/igc/src/llvm-project &&
|
||||
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/opencl-clang &&
|
||||
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/llvm-spirv &&
|
||||
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_tools/src/external_igc_spirv_tools/ ${BUILD_DIR}/igc/src/SPIRV-Tools &&
|
||||
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_headers/src/external_igc_spirv_headers/ ${BUILD_DIR}/igc/src/SPIRV-Headers &&
|
||||
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_vcintrinsics/src/external_igc_vcintrinsics/ ${BUILD_DIR}/igc/src/vc-intrinsics
|
||||
PREFIX ${BUILD_DIR}/igc
|
||||
INSTALL_DIR ${LIBDIR}/igc
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --strip
|
||||
CMAKE_GENERATOR ${IGC_GENERATOR}
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
external_igc
|
||||
external_igc_vcintrinsics
|
||||
external_igc_llvm
|
||||
external_igc_opencl_clang
|
||||
external_igc_vcintrinsics
|
||||
external_igc_spirv_headers
|
||||
external_igc_spirv_tools
|
||||
external_igc_spirv_translator
|
||||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
add_dependencies(
|
||||
external_igc
|
||||
external_flex
|
||||
)
|
||||
endif()
|
@@ -6,6 +6,7 @@ if(WIN32)
|
||||
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
|
||||
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
|
||||
-DARM_ENABLED=Off
|
||||
-DPython3_FIND_REGISTRY=NEVER
|
||||
)
|
||||
elseif(APPLE)
|
||||
# Use bison and flex installed via Homebrew.
|
||||
@@ -27,7 +28,7 @@ elseif(UNIX)
|
||||
set(ISPC_EXTRA_ARGS_UNIX
|
||||
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang
|
||||
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++
|
||||
-DARM_ENABLED=Off
|
||||
-DARM_ENABLED=${BLENDER_PLATFORM_ARM}
|
||||
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
|
||||
)
|
||||
endif()
|
||||
@@ -43,6 +44,8 @@ set(ISPC_EXTRA_ARGS
|
||||
-DISPC_INCLUDE_TESTS=Off
|
||||
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
|
||||
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
|
||||
-DPython3_ROOT_DIR=${LIBDIR}/python/
|
||||
-DPython3_EXECUTABLE=${PYTHON_BINARY}
|
||||
${ISPC_EXTRA_ARGS_WIN}
|
||||
${ISPC_EXTRA_ARGS_APPLE}
|
||||
${ISPC_EXTRA_ARGS_UNIX}
|
||||
@@ -61,6 +64,7 @@ ExternalProject_Add(external_ispc
|
||||
add_dependencies(
|
||||
external_ispc
|
||||
ll
|
||||
external_python
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
if(WIN32)
|
||||
# cmake for windows
|
||||
# CMAKE for MS-Windows.
|
||||
set(JPEG_EXTRA_ARGS
|
||||
-DNASM=${NASM_PATH}
|
||||
-DWITH_JPEG8=ON
|
||||
@@ -33,8 +33,8 @@ if(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
else(WIN32)
|
||||
# cmake for unix
|
||||
else()
|
||||
# CMAKE for UNIX.
|
||||
set(JPEG_EXTRA_ARGS
|
||||
-DWITH_JPEG8=ON
|
||||
-DENABLE_STATIC=ON
|
||||
|
@@ -25,11 +25,14 @@ set(LLVM_EXTRA_ARGS
|
||||
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
|
||||
-DLLVM_ENABLE_UNWIND_TABLES=OFF
|
||||
-DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA}
|
||||
-DPython3_ROOT_DIR=${LIBDIR}/python/
|
||||
-DPython3_EXECUTABLE=${PYTHON_BINARY}
|
||||
${LLVM_XML2_ARGS}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(LLVM_GENERATOR "Ninja")
|
||||
list(APPEND LLVM_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
|
||||
else()
|
||||
set(LLVM_GENERATOR "Unix Makefiles")
|
||||
endif()
|
||||
@@ -74,3 +77,8 @@ if(APPLE)
|
||||
external_xml2
|
||||
)
|
||||
endif()
|
||||
|
||||
add_dependencies(
|
||||
ll
|
||||
external_python
|
||||
)
|
||||
|
18
build_files/build_environment/cmake/macros.cmake
Normal file
18
build_files/build_environment/cmake/macros.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# shorthand to only unpack a certain dependency
|
||||
macro(unpack_only name)
|
||||
string(TOUPPER ${name} UPPER_NAME)
|
||||
set(TARGET_FILE ${${UPPER_NAME}_FILE})
|
||||
set(TARGET_HASH_TYPE ${${UPPER_NAME}_HASH_TYPE})
|
||||
set(TARGET_HASH ${${UPPER_NAME}_HASH})
|
||||
ExternalProject_Add(external_${name}
|
||||
URL file://${PACKAGE_DIR}/${TARGET_FILE}
|
||||
URL_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/${name}
|
||||
CONFIGURE_COMMAND echo .
|
||||
BUILD_COMMAND echo .
|
||||
INSTALL_COMMAND echo .
|
||||
)
|
||||
endmacro()
|
24
build_files/build_environment/cmake/ocloc.cmake
Normal file
24
build_files/build_environment/cmake/ocloc.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
set(OCLOC_EXTRA_ARGS
|
||||
-DNEO_SKIP_UNIT_TESTS=1
|
||||
-DNEO_BUILD_WITH_OCL=0
|
||||
-DBUILD_WITH_L0=0
|
||||
-DIGC_DIR=${LIBDIR}/igc
|
||||
-DGMM_DIR=${LIBDIR}/gmmlib
|
||||
)
|
||||
|
||||
ExternalProject_Add(external_ocloc
|
||||
URL file://${PACKAGE_DIR}/${OCLOC_FILE}
|
||||
URL_HASH ${OCLOC_HASH_TYPE}=${OCLOC_HASH}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
PREFIX ${BUILD_DIR}/ocloc
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ocloc ${DEFAULT_CMAKE_FLAGS} ${OCLOC_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/ocloc
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
external_ocloc
|
||||
external_igc
|
||||
external_gmmlib
|
||||
)
|
@@ -9,6 +9,7 @@ set(OIDN_EXTRA_ARGS
|
||||
-DOIDN_STATIC_RUNTIME=OFF
|
||||
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
|
||||
-DOIDN_FILTER_RTLIGHTMAP=OFF
|
||||
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
@@ -38,6 +39,7 @@ add_dependencies(
|
||||
external_openimagedenoise
|
||||
external_tbb
|
||||
external_ispc
|
||||
external_python
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
@@ -18,9 +18,15 @@ if(WIN32)
|
||||
set(PNG_LIBNAME libpng16_static${LIBEXT})
|
||||
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
|
||||
set(OPENJPEG_POSTFIX _msvc)
|
||||
if(BUILD_MODE STREQUAL Debug)
|
||||
set(TIFF_POSTFIX d)
|
||||
else()
|
||||
set(TIFF_POSTFIX)
|
||||
endif()
|
||||
else()
|
||||
set(PNG_LIBNAME libpng${LIBEXT})
|
||||
set(OIIO_SIMD_FLAGS)
|
||||
set(TIFF_POSTFIX)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
@@ -65,7 +71,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
|
||||
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
|
||||
-DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
|
||||
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
|
||||
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
|
||||
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${TIFF_POSTFIX}${LIBEXT}
|
||||
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
|
||||
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
|
||||
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include
|
||||
|
49
build_files/build_environment/cmake/openpgl.cmake
Normal file
49
build_files/build_environment/cmake/openpgl.cmake
Normal file
@@ -0,0 +1,49 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Note the utility apps may use png/tiff/gif system libraries, but the
|
||||
# library itself does not depend on them, so should give no problems.
|
||||
|
||||
set(OPENPGL_EXTRA_ARGS
|
||||
-DOPENPGL_BUILD_PYTHON=OFF
|
||||
-DOPENPGL_BUILD_STATIC=ON
|
||||
-DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
|
||||
-DTBB_ROOT=${LIBDIR}/tbb
|
||||
-Dembree_DIR=${LIBDIR}/embree/lib/cmake/embree-${EMBREE_VERSION}
|
||||
-DCMAKE_DEBUG_POSTFIX=_d
|
||||
)
|
||||
|
||||
if(TBB_STATIC_LIBRARY)
|
||||
set(OPENPGL_EXTRA_ARGS
|
||||
${OPENPGL_EXTRA_ARGS}
|
||||
-DOPENPGL_TBB_COMPONENT=tbb_static
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_openpgl
|
||||
URL file://${PACKAGE_DIR}/${OPENPGL_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH}
|
||||
PREFIX ${BUILD_DIR}/openpgl
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS}
|
||||
INSTALL_DIR ${LIBDIR}/openpgl
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
external_openpgl
|
||||
external_tbb
|
||||
external_embree
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_openpgl after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openpgl ${HARVEST_TARGET}/openpgl
|
||||
DEPENDEES install
|
||||
)
|
||||
else()
|
||||
ExternalProject_Add_Step(external_openpgl after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/openpgl_d.lib ${HARVEST_TARGET}/openpgl/lib/openpgl_d.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
@@ -15,7 +15,7 @@ message("BuildMode = ${BUILD_MODE}")
|
||||
|
||||
if(BUILD_MODE STREQUAL "Debug")
|
||||
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
|
||||
else(BUILD_MODE STREQUAL "Debug")
|
||||
else()
|
||||
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
|
||||
endif()
|
||||
|
||||
@@ -38,6 +38,7 @@ message("BUILD_DIR = ${BUILD_DIR}")
|
||||
if(WIN32)
|
||||
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
|
||||
set(LIBEXT ".lib")
|
||||
set(SHAREDLIBEXT ".lib")
|
||||
set(LIBPREFIX "")
|
||||
|
||||
# For OIIO and OSL
|
||||
@@ -96,6 +97,7 @@ if(WIN32)
|
||||
else()
|
||||
set(PATCH_CMD patch)
|
||||
set(LIBEXT ".a")
|
||||
set(SHAREDLIBEXT ".so")
|
||||
set(LIBPREFIX "lib")
|
||||
|
||||
if(APPLE)
|
||||
|
@@ -27,6 +27,7 @@ if(WIN32)
|
||||
PREFIX ${BUILD_DIR}/python
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE}
|
||||
PATCH_COMMAND ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff
|
||||
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
|
||||
)
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
ExternalProject_Add(external_sse2neon
|
||||
GIT_REPOSITORY ${SSE2NEON_GIT}
|
||||
GIT_TAG ${SSE2NEON_GIT_HASH}
|
||||
URL file://${PACKAGE_DIR}/${SSE2NEON_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${SSE2NEON_HASH_TYPE}=${SSE2NEON_HASH}
|
||||
PREFIX ${BUILD_DIR}/sse2neon
|
||||
CONFIGURE_COMMAND echo sse2neon - Nothing to configure
|
||||
BUILD_COMMAND echo sse2neon - nothing to build
|
||||
|
@@ -3,6 +3,8 @@
|
||||
set(TIFF_EXTRA_ARGS
|
||||
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
|
||||
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
|
||||
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
|
||||
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include
|
||||
-DPNG_STATIC=ON
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-Dlzma=OFF
|
||||
@@ -24,10 +26,12 @@ add_dependencies(
|
||||
external_tiff
|
||||
external_zlib
|
||||
)
|
||||
|
||||
if(WIN32 AND BUILD_MODE STREQUAL Debug)
|
||||
ExternalProject_Add_Step(external_tiff after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
|
||||
DEPENDEES install
|
||||
)
|
||||
if(WIN32)
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_tiff after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
|
||||
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -45,15 +45,15 @@ set(PTHREADS_HASH f3bf81bb395840b3446197bcf4ecd653)
|
||||
set(PTHREADS_HASH_TYPE MD5)
|
||||
set(PTHREADS_FILE pthreads4w-code-${PTHREADS_VERSION}.zip)
|
||||
|
||||
set(OPENEXR_VERSION 3.1.4)
|
||||
set(OPENEXR_VERSION 3.1.5)
|
||||
set(OPENEXR_URI https://github.com/AcademySoftwareFoundation/openexr/archive/v${OPENEXR_VERSION}.tar.gz)
|
||||
set(OPENEXR_HASH e990be1ff765797bc2d93a8060e1c1f2)
|
||||
set(OPENEXR_HASH a92f38eedd43e56c0af56d4852506886)
|
||||
set(OPENEXR_HASH_TYPE MD5)
|
||||
set(OPENEXR_FILE openexr-${OPENEXR_VERSION}.tar.gz)
|
||||
|
||||
set(IMATH_VERSION 3.1.4)
|
||||
set(IMATH_VERSION 3.1.5)
|
||||
set(IMATH_URI https://github.com/AcademySoftwareFoundation/Imath/archive/v${OPENEXR_VERSION}.tar.gz)
|
||||
set(IMATH_HASH fddf14ec73e12c34e74c3c175e311a3f)
|
||||
set(IMATH_HASH dd375574276c54872b7b3d54053baff0)
|
||||
set(IMATH_HASH_TYPE MD5)
|
||||
set(IMATH_FILE imath-${IMATH_VERSION}.tar.gz)
|
||||
|
||||
@@ -80,11 +80,11 @@ set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85)
|
||||
set(FREETYPE_HASH_TYPE MD5)
|
||||
set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz)
|
||||
|
||||
set(GLEW_VERSION 1.13.0)
|
||||
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
|
||||
set(GLEW_HASH 7cbada3166d2aadfc4169c4283701066)
|
||||
set(GLEW_HASH_TYPE MD5)
|
||||
set(GLEW_FILE glew-${GLEW_VERSION}.tgz)
|
||||
set(EPOXY_VERSION 1.5.10)
|
||||
set(EPOXY_URI https://github.com/anholt/libepoxy/archive/refs/tags/${EPOXY_VERSION}.tar.gz)
|
||||
set(EPOXY_HASH f0730aad115c952e77591fcc805b1dc1)
|
||||
set(EPOXY_HASH_TYPE MD5)
|
||||
set(EPOXY_FILE libepoxy-${EPOXY_VERSION}.tar.gz)
|
||||
|
||||
set(FREEGLUT_VERSION 3.0.0)
|
||||
set(FREEGLUT_URI http://prdownloads.sourceforge.net/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
|
||||
@@ -147,7 +147,7 @@ set(OPENIMAGEIO_HASH de45fb38501c4581062b522b53b6141c)
|
||||
set(OPENIMAGEIO_HASH_TYPE MD5)
|
||||
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
|
||||
|
||||
# 8.0.0 is currently oiio's preferred vesion although never versions may be available.
|
||||
# 8.0.0 is currently oiio's preferred version although never versions may be available.
|
||||
# the preferred version can be found in oiio's externalpackages.cmake
|
||||
set(FMT_VERSION 8.0.0)
|
||||
set(FMT_URI https://github.com/fmtlib/fmt/archive/refs/tags/${FMT_VERSION}.tar.gz)
|
||||
@@ -155,7 +155,7 @@ set(FMT_HASH 7bce0e9e022e586b178b150002e7c2339994e3c2bbe44027e9abb0d60f9cce83)
|
||||
set(FMT_HASH_TYPE SHA256)
|
||||
set(FMT_FILE fmt-${FMT_VERSION}.tar.gz)
|
||||
|
||||
# 0.6.2 is currently oiio's preferred vesion although never versions may be available.
|
||||
# 0.6.2 is currently oiio's preferred version although never versions may be available.
|
||||
# the preferred version can be found in oiio's externalpackages.cmake
|
||||
set(ROBINMAP_VERSION v0.6.2)
|
||||
set(ROBINMAP_URI https://github.com/Tessil/robin-map/archive/refs/tags/${ROBINMAP_VERSION}.tar.gz)
|
||||
@@ -163,9 +163,9 @@ set(ROBINMAP_HASH c08ec4b1bf1c85eb0d6432244a6a89862229da1cb834f3f90fba8dc35d8c8e
|
||||
set(ROBINMAP_HASH_TYPE SHA256)
|
||||
set(ROBINMAP_FILE robinmap-${ROBINMAP_VERSION}.tar.gz)
|
||||
|
||||
set(TIFF_VERSION 4.3.0)
|
||||
set(TIFF_VERSION 4.4.0)
|
||||
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
|
||||
set(TIFF_HASH 0a2e4744d1426a8fc8211c0cdbc3a1b3)
|
||||
set(TIFF_HASH 376f17f189e9d02280dfe709b2b2bbea)
|
||||
set(TIFF_HASH_TYPE MD5)
|
||||
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
|
||||
|
||||
@@ -410,9 +410,9 @@ set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
|
||||
set(SQLITE_HASH_TYPE SHA1)
|
||||
set(SQLITE_FILE sqlite-src-3240000.zip)
|
||||
|
||||
set(EMBREE_VERSION 3.13.3)
|
||||
set(EMBREE_VERSION 3.13.4)
|
||||
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
||||
set(EMBREE_HASH f62766ba54e48a2f327c3a22596e7133)
|
||||
set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be)
|
||||
set(EMBREE_HASH_TYPE MD5)
|
||||
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
|
||||
|
||||
@@ -458,6 +458,12 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/
|
||||
set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
|
||||
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
||||
|
||||
set(WAYLAND_VERSION 1.21.0)
|
||||
set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903)
|
||||
set(WAYLAND_HASH_TYPE MD5)
|
||||
|
||||
set(ISPC_VERSION v1.17.0)
|
||||
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
|
||||
set(ISPC_HASH 4f476a3109332a77fe839a9014c60ca9)
|
||||
@@ -488,8 +494,11 @@ set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
|
||||
set(ZSTD_HASH_TYPE SHA256)
|
||||
set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
|
||||
|
||||
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
|
||||
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
||||
set(SSE2NEON_VERSION fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
|
||||
set(SSE2NEON_URI https://github.com/DLTcollab/sse2neon/archive/${SSE2NEON_VERSION}.tar.gz)
|
||||
set(SSE2NEON_HASH 0780253525d299c31775ef95853698d03db9c7739942af8570000f4a25a5d605)
|
||||
set(SSE2NEON_HASH_TYPE SHA256)
|
||||
set(SSE2NEON_FILE sse2neon-${SSE2NEON_VERSION}.tar.gz)
|
||||
|
||||
set(BROTLI_VERSION v1.0.9)
|
||||
set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz)
|
||||
@@ -497,8 +506,152 @@ set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46
|
||||
set(BROTLI_HASH_TYPE SHA256)
|
||||
set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz)
|
||||
|
||||
set(OPENPGL_VERSION v0.3.1-beta)
|
||||
set(OPENPGL_SHORT_VERSION 0.3.1)
|
||||
set(OPENPGL_URI https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/${OPENPGL_VERSION}.tar.gz)
|
||||
set(OPENPGL_HASH 3830098c485c962018932766199527aab453a8029528dbbc04d4454d82431e2c)
|
||||
set(OPENPGL_HASH_TYPE SHA256)
|
||||
set(OPENPGL_FILE openpgl-${OPENPGL_VERSION}.tar.gz)
|
||||
|
||||
set(LEVEL_ZERO_VERSION v1.7.15)
|
||||
set(LEVEL_ZERO_URI https://github.com/oneapi-src/level-zero/archive/refs/tags/${LEVEL_ZERO_VERSION}.tar.gz)
|
||||
set(LEVEL_ZERO_HASH c39bb05a8e5898aa6c444e1704105b93d3f1888b9c333f8e7e73825ffbfb2617)
|
||||
set(LEVEL_ZERO_HASH_TYPE SHA256)
|
||||
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)
|
||||
|
||||
set(DPCPP_VERSION 20220812)
|
||||
set(DPCPP_URI https://github.com/intel/llvm/archive/refs/tags/sycl-nightly/${DPCPP_VERSION}.tar.gz)
|
||||
set(DPCPP_HASH 0e3c95346c295f5cf80f3a42d80b1c49481955898530242636ddc002627248d6)
|
||||
set(DPCPP_HASH_TYPE SHA256)
|
||||
set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
|
||||
|
||||
########################
|
||||
### DPCPP DEPS BEGIN ###
|
||||
########################
|
||||
# The following deps are build time requirements for dpcpp, when possible
|
||||
# the source in the dpcpp source tree for the version chosen is documented
|
||||
# by each dep, these will only have to be downloaded and unpacked, dpcpp
|
||||
# will take care of building them, unpack is being done in dpcpp_deps.cmake
|
||||
|
||||
# Source llvm/lib/SYCLLowerIR/CMakeLists.txt
|
||||
set(VCINTRINSICS_VERSION 984bb27baacce6ee5c716c2e64845f2a1928025b)
|
||||
set(VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/${VCINTRINSICS_VERSION}.tar.gz)
|
||||
set(VCINTRINSICS_HASH abea415a15a0dd11fdc94dee8fb462910f2548311b787e02f42509789e1b0d7b)
|
||||
set(VCINTRINSICS_HASH_TYPE SHA256)
|
||||
set(VCINTRINSICS_FILE vc-intrinsics-${VCINTRINSICS_VERSION}.tar.gz)
|
||||
|
||||
# Source opencl/CMakeLists.txt
|
||||
set(OPENCLHEADERS_VERSION dcd5bede6859d26833cd85f0d6bbcee7382dc9b3)
|
||||
set(OPENCLHEADERS_URI https://github.com/KhronosGroup/OpenCL-Headers/archive/${OPENCLHEADERS_VERSION}.tar.gz)
|
||||
set(OPENCLHEADERS_HASH ca8090359654e94f2c41e946b7e9d826253d795ae809ce7c83a7d3c859624693)
|
||||
set(OPENCLHEADERS_HASH_TYPE SHA256)
|
||||
set(OPENCLHEADERS_FILE opencl_headers-${OPENCLHEADERS_VERSION}.tar.gz)
|
||||
|
||||
# Source opencl/CMakeLists.txt
|
||||
set(ICDLOADER_VERSION aec3952654832211636fc4af613710f80e203b0a)
|
||||
set(ICDLOADER_URI https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${ICDLOADER_VERSION}.tar.gz)
|
||||
set(ICDLOADER_HASH e1880551d67bd8dc31d13de63b94bbfd6b1f315b6145dad1ffcd159b89bda93c)
|
||||
set(ICDLOADER_HASH_TYPE SHA256)
|
||||
set(ICDLOADER_FILE icdloader-${ICDLOADER_VERSION}.tar.gz)
|
||||
|
||||
# Source sycl/cmake/modules/AddBoostMp11Headers.cmake
|
||||
# Using external MP11 here, getting AddBoostMp11Headers.cmake to recognize
|
||||
# our copy in boost directly was more trouble than it was worth.
|
||||
set(MP11_VERSION 7bc4e1ae9b36ec8ee635c3629b59ec525bbe82b9)
|
||||
set(MP11_URI https://github.com/boostorg/mp11/archive/${MP11_VERSION}.tar.gz)
|
||||
set(MP11_HASH 071ee2bd3952ec89882edb3af25dd1816f6b61723f66e42eea32f4d02ceef426)
|
||||
set(MP11_HASH_TYPE SHA256)
|
||||
set(MP11_FILE mp11-${MP11_VERSION}.tar.gz)
|
||||
|
||||
# Source llvm-spirv/CMakeLists.txt (repo)
|
||||
# Source llvm-spirv/spirv-headers-tag.conf (hash)
|
||||
set(SPIRV_HEADERS_VERSION 36c0c1596225e728bd49abb7ef56a3953e7ed468)
|
||||
set(SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/${SPIRV_HEADERS_VERSION}.tar.gz)
|
||||
set(SPIRV_HEADERS_HASH 7a5c89633f8740456fe8adee052033e134476d267411d1336c0cb1e587a9229a)
|
||||
set(SPIRV_HEADERS_HASH_TYPE SHA256)
|
||||
set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
|
||||
|
||||
######################
|
||||
### DPCPP DEPS END ###
|
||||
######################
|
||||
|
||||
##########################################
|
||||
### Intel Graphics Compiler DEPS BEGIN ###
|
||||
##########################################
|
||||
# The following deps are build time requirements for the intel graphics
|
||||
# compiler, the versions used are taken from the following location
|
||||
# https://github.com/intel/intel-graphics-compiler/releases
|
||||
|
||||
set(IGC_VERSION 1.0.11222)
|
||||
set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz)
|
||||
set(IGC_HASH d92f0608dcbb52690855685f9447282e5c09c0ba98ae35fabf114fcf8b1e9fcf)
|
||||
set(IGC_HASH_TYPE SHA256)
|
||||
set(IGC_FILE igc-${IGC_VERSION}.tar.gz)
|
||||
|
||||
set(IGC_LLVM_VERSION llvmorg-11.1.0)
|
||||
set(IGC_LLVM_URI https://github.com/llvm/llvm-project/archive/refs/tags/${IGC_LLVM_VERSION}.tar.gz)
|
||||
set(IGC_LLVM_HASH 53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79)
|
||||
set(IGC_LLVM_HASH_TYPE SHA256)
|
||||
set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
|
||||
|
||||
# WARNING WARNING WARNING
|
||||
#
|
||||
# IGC_OPENCL_CLANG contains patches for some of its dependencies.
|
||||
#
|
||||
# Whenever IGC_OPENCL_CLANG_VERSION changes, one *MUST* inspect
|
||||
# IGC_OPENCL_CLANG's patches folder and update igc.cmake to account for
|
||||
# any added or removed patches.
|
||||
#
|
||||
# WARNING WARNING WARNING
|
||||
|
||||
set(IGC_OPENCL_CLANG_VERSION bbdd1587f577397a105c900be114b56755d1f7dc)
|
||||
set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz)
|
||||
set(IGC_OPENCL_CLANG_HASH d08315f1b0d8a6fef33de2b3e6aa7356534c324910634962c72523d970773efc)
|
||||
set(IGC_OPENCL_CLANG_HASH_TYPE SHA256)
|
||||
set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz)
|
||||
|
||||
set(IGC_VCINTRINSICS_VERSION v0.4.0)
|
||||
set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz)
|
||||
set(IGC_VCINTRINSICS_HASH c8b92682ad5031cf9d5b82a40e7d5c0e763cd9278660adbcaa69aab988e4b589)
|
||||
set(IGC_VCINTRINSICS_HASH_TYPE SHA256)
|
||||
set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz)
|
||||
|
||||
set(IGC_SPIRV_HEADERS_VERSION sdk-1.3.204.1)
|
||||
set(IGC_SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
|
||||
set(IGC_SPIRV_HEADERS_HASH 262864053968c217d45b24b89044a7736a32361894743dd6cfe788df258c746c)
|
||||
set(IGC_SPIRV_HEADERS_HASH_TYPE SHA256)
|
||||
set(IGC_SPIRV_HEADERS_FILE SPIR-V-Headers-${IGC_SPIRV_HEADERS_VERSION}.tar.gz)
|
||||
|
||||
set(IGC_SPIRV_TOOLS_VERSION sdk-1.3.204.1)
|
||||
set(IGC_SPIRV_TOOLS_URI https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
|
||||
set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc103b087335)
|
||||
set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256)
|
||||
set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
|
||||
|
||||
set(IGC_SPIRV_TRANSLATOR_VERSION 99420daab98998a7e36858befac9c5ed109d4920)
|
||||
set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
|
||||
set(IGC_SPIRV_TRANSLATOR_HASH 77dfb4ddb6bfb993535562c02ddea23f0a0d1c5a0258c1afe7e27c894ff783a8)
|
||||
set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256)
|
||||
set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
|
||||
|
||||
########################################
|
||||
### Intel Graphics Compiler DEPS END ###
|
||||
########################################
|
||||
|
||||
set(GMMLIB_VERSION intel-gmmlib-22.1.2)
|
||||
set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz)
|
||||
set(GMMLIB_HASH 3b9a6d5e7e3f5748b3d0a2fb0e980ae943907fece0980bd9c0508e71c838e334)
|
||||
set(GMMLIB_HASH_TYPE SHA256)
|
||||
set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz)
|
||||
|
||||
set(OCLOC_VERSION 22.20.23198)
|
||||
set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz)
|
||||
set(OCLOC_HASH ab22b8bf2560a57fdd3def0e35a62ca75991406f959c0263abb00cd6cd9ae998)
|
||||
set(OCLOC_HASH_TYPE SHA256)
|
||||
set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz)
|
||||
|
||||
set(AOM_VERSION 3.4.0)
|
||||
set(AOM_URI https://storage.googleapis.com/aom-releases/libaom-${AOM_VERSION}.tar.gz)
|
||||
set(AOM_HASH bd754b58c3fa69f3ffd29da77de591bd9c26970e3b18537951336d6c0252e354)
|
||||
set(AOM_HASH_TYPE SHA256)
|
||||
set(AOM_FILE libaom-${AOM_VERSION}.tar.gz)
|
||||
|
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
if(WIN32)
|
||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc --disable-multithread)
|
||||
else()
|
||||
set(VPX_EXTRA_FLAGS --target=x86-win32-gcc --disable-multithread)
|
||||
endif()
|
||||
# VPX is determined to use pthreads which it will tell ffmpeg to dynamically
|
||||
# link, which is not something we're super into distribution wise. However
|
||||
# if it cannot find pthread.h it'll happily provide a pthread emulation
|
||||
# layer using win32 threads. So all this patch does is make it not find
|
||||
# pthead.h
|
||||
set(VPX_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/vpx/src/external_vpx < ${PATCH_DIR}/vpx_windows.diff)
|
||||
set(VPX_EXTRA_FLAGS --target=x86_64-win64-gcc )
|
||||
else()
|
||||
if(APPLE)
|
||||
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
||||
@@ -18,6 +20,16 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT BLENDER_PLATFORM_ARM)
|
||||
list(APPEND VPX_EXTRA_FLAGS
|
||||
--enable-sse4_1
|
||||
--enable-sse3
|
||||
--enable-ssse3
|
||||
--enable-avx
|
||||
--enable-avx2
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(external_vpx
|
||||
URL file://${PACKAGE_DIR}/${VPX_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
@@ -30,11 +42,6 @@ ExternalProject_Add(external_vpx
|
||||
--enable-static
|
||||
--disable-install-bins
|
||||
--disable-install-srcs
|
||||
--disable-sse4_1
|
||||
--disable-sse3
|
||||
--disable-ssse3
|
||||
--disable-avx
|
||||
--disable-avx2
|
||||
--disable-unit-tests
|
||||
--disable-examples
|
||||
--enable-vp8
|
||||
@@ -42,6 +49,7 @@ ExternalProject_Add(external_vpx
|
||||
${VPX_EXTRA_FLAGS}
|
||||
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make -j${MAKE_THREADS}
|
||||
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/vpx/src/external_vpx/ && make install
|
||||
PATCH_COMMAND ${VPX_PATCH}
|
||||
INSTALL_DIR ${LIBDIR}/vpx
|
||||
)
|
||||
|
||||
|
20
build_files/build_environment/cmake/wayland.cmake
Normal file
20
build_files/build_environment/cmake/wayland.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
ExternalProject_Add(external_wayland
|
||||
URL file://${PACKAGE_DIR}/${WAYLAND_FILE}
|
||||
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
||||
URL_HASH ${WAYLAND_HASH_TYPE}=${WAYLAND_HASH}
|
||||
PREFIX ${BUILD_DIR}/wayland
|
||||
PATCH_COMMAND ${PATCH_CMD} -d ${BUILD_DIR}/wayland/src/external_wayland < ${PATCH_DIR}/wayland.diff
|
||||
# Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own LIBEXPAT.
|
||||
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:$PKG_CONFIG_PATH
|
||||
meson --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -Dlibraries=false . ../external_wayland
|
||||
BUILD_COMMAND ninja
|
||||
INSTALL_COMMAND ninja install
|
||||
)
|
||||
|
||||
add_dependencies(
|
||||
external_wayland
|
||||
external_expat
|
||||
external_xml2
|
||||
)
|
@@ -40,15 +40,15 @@ ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,ver-
|
||||
force-all,force-python,force-boost,force-tbb,\
|
||||
force-ocio,force-imath,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
|
||||
force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\
|
||||
force-xr-openxr,force-level-zero,\
|
||||
force-xr-openxr,force-level-zero, force-openpgl,\
|
||||
build-all,build-python,build-boost,build-tbb,\
|
||||
build-ocio,build-imath,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
|
||||
build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
|
||||
build-xr-openxr,build-level-zero,\
|
||||
build-xr-openxr,build-level-zero, build-openpgl,\
|
||||
skip-python,skip-boost,skip-tbb,\
|
||||
skip-ocio,skip-imath,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
|
||||
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\
|
||||
skip-xr-openxr,skip-level-zero \
|
||||
skip-xr-openxr,skip-level-zero, skip-openpgl \
|
||||
-- "$@" \
|
||||
)
|
||||
|
||||
@@ -232,6 +232,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--build-level-zero=<ver>
|
||||
Force the build of OneAPI Level Zero library.
|
||||
|
||||
--build-openpgl
|
||||
Force the build of OpenPGL library.
|
||||
|
||||
Note about the --build-foo options:
|
||||
* They force the script to prefer building dependencies rather than using available packages.
|
||||
This may make things simpler and allow working around some distribution bugs, but on the other hand it will
|
||||
@@ -302,6 +305,9 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
--force-level-zero=<ver>
|
||||
Force the rebuild of OneAPI Level Zero library.
|
||||
|
||||
--force-openpgl
|
||||
Force the rebuild of OpenPGL library.
|
||||
|
||||
Note about the --force-foo options:
|
||||
* They obviously only have an effect if those libraries are built by this script
|
||||
(i.e. if there is no available and satisfactory package)!
|
||||
@@ -363,7 +369,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
|
||||
Unconditionally skip OpenXR-SDK installation/building.
|
||||
|
||||
--skip-level-zero=<ver>
|
||||
Unconditionally skip OneAPI Level Zero installation/building.\""
|
||||
Unconditionally skip OneAPI Level Zero installation/building.
|
||||
|
||||
--skip-openpgl
|
||||
Unconditionally skip OpenPGL installation/building.\""
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Main Vars
|
||||
@@ -465,7 +474,7 @@ TBB_VERSION="2020"
|
||||
TBB_VERSION_SHORT="2020"
|
||||
TBB_VERSION_UPDATE="_U3" # Used for source packages...
|
||||
TBB_VERSION_MIN="2018"
|
||||
TBB_VERSION_MEX="2022"
|
||||
TBB_VERSION_MEX="2021" # 2021 introduces 'oneTBB', which has lots of compatibility breakage with previous versions
|
||||
TBB_FORCE_BUILD=false
|
||||
TBB_FORCE_REBUILD=false
|
||||
TBB_SKIP=false
|
||||
@@ -478,7 +487,7 @@ OCIO_FORCE_BUILD=false
|
||||
OCIO_FORCE_REBUILD=false
|
||||
OCIO_SKIP=false
|
||||
|
||||
IMATH_VERSION="3.1.4"
|
||||
IMATH_VERSION="3.1.5"
|
||||
IMATH_VERSION_SHORT="3.1"
|
||||
IMATH_VERSION_MIN="3.0"
|
||||
IMATH_VERSION_MEX="4.0"
|
||||
@@ -487,7 +496,7 @@ IMATH_FORCE_REBUILD=false
|
||||
IMATH_SKIP=false
|
||||
_with_built_imath=false
|
||||
|
||||
OPENEXR_VERSION="3.1.4"
|
||||
OPENEXR_VERSION="3.1.5"
|
||||
OPENEXR_VERSION_SHORT="3.1"
|
||||
OPENEXR_VERSION_MIN="3.0"
|
||||
OPENEXR_VERSION_MEX="4.0"
|
||||
@@ -567,7 +576,7 @@ OPENCOLLADA_FORCE_BUILD=false
|
||||
OPENCOLLADA_FORCE_REBUILD=false
|
||||
OPENCOLLADA_SKIP=false
|
||||
|
||||
EMBREE_VERSION="3.13.3"
|
||||
EMBREE_VERSION="3.13.4"
|
||||
EMBREE_VERSION_SHORT="3.13"
|
||||
EMBREE_VERSION_MIN="3.13"
|
||||
EMBREE_VERSION_MEX="4.0"
|
||||
@@ -593,6 +602,14 @@ LEVEL_ZERO_FORCE_BUILD=false
|
||||
LEVEL_ZERO_FORCE_REBUILD=false
|
||||
LEVEL_ZERO_SKIP=false
|
||||
|
||||
OPENPGL_VERSION="0.3.1"
|
||||
OPENPGL_VERSION_SHORT="0.3"
|
||||
OPENPGL_VERSION_MIN="0.3.1"
|
||||
OPENPGL_VERSION_MEX="0.3.2"
|
||||
OPENPGL_FORCE_BUILD=false
|
||||
OPENPGL_FORCE_REBUILD=false
|
||||
OPENPGL_SKIP=false
|
||||
|
||||
XR_OPENXR_VERSION="1.0.22"
|
||||
XR_OPENXR_VERSION_SHORT="1.0"
|
||||
XR_OPENXR_VERSION_MIN="1.0.8"
|
||||
@@ -627,6 +644,9 @@ WEBP_DEV=""
|
||||
VPX_USE=false
|
||||
VPX_VERSION_MIN=0.9.7
|
||||
VPX_DEV=""
|
||||
AOM_USE=false
|
||||
AOM_VERSION_MIN=3.3.0
|
||||
AOM_DEV=""
|
||||
OPUS_USE=false
|
||||
OPUS_VERSION_MIN=1.1.1
|
||||
OPUS_DEV=""
|
||||
@@ -635,9 +655,6 @@ MP3LAME_DEV=""
|
||||
OPENJPEG_USE=false
|
||||
OPENJPEG_DEV=""
|
||||
|
||||
# Whether to use system GLEW or not (OpenSubDiv needs recent glew to work).
|
||||
NO_SYSTEM_GLEW=false
|
||||
|
||||
# Switch to english language, else some things (like check_package_DEB()) won't work!
|
||||
LANG_BACK=$LANG
|
||||
LANG=""
|
||||
@@ -827,6 +844,7 @@ while true; do
|
||||
USD_FORCE_BUILD=true
|
||||
XR_OPENXR_FORCE_BUILD=true
|
||||
LEVEL_ZERO_FORCE_BUILD=true
|
||||
OPENPGL_FORCE_BUILD=true
|
||||
shift; continue
|
||||
;;
|
||||
--build-python)
|
||||
@@ -887,6 +905,9 @@ while true; do
|
||||
--build-level-zero)
|
||||
LEVEL_ZERO_FORCE_BUILD=true; shift; continue
|
||||
;;
|
||||
--build-openpgl)
|
||||
OPENPGL_FORCE_BUILD=true; shift; continue
|
||||
;;
|
||||
--force-all)
|
||||
PYTHON_FORCE_REBUILD=true
|
||||
BOOST_FORCE_REBUILD=true
|
||||
@@ -907,6 +928,7 @@ while true; do
|
||||
USD_FORCE_REBUILD=true
|
||||
XR_OPENXR_FORCE_REBUILD=true
|
||||
LEVEL_ZERO_FORCE_REBUILD=true
|
||||
OPENPGL_FORCE_REBUILD=true
|
||||
shift; continue
|
||||
;;
|
||||
--force-python)
|
||||
@@ -967,6 +989,9 @@ while true; do
|
||||
--force-level-zero)
|
||||
LEVEL_ZERO_FORCE_REBUILD=true; shift; continue
|
||||
;;
|
||||
--force-openpgl)
|
||||
OPENPGL_FORCE_REBUILD=true; shift; continue
|
||||
;;
|
||||
--skip-python)
|
||||
PYTHON_SKIP=true; shift; continue
|
||||
;;
|
||||
@@ -1024,6 +1049,9 @@ while true; do
|
||||
--skip-level-zero)
|
||||
LEVEL_ZERO_SKIP=true; shift; continue
|
||||
;;
|
||||
--skip-openpgl)
|
||||
OPENPGL_SKIP=true; shift; continue
|
||||
;;
|
||||
--)
|
||||
# no more arguments to parse
|
||||
break
|
||||
@@ -1173,6 +1201,9 @@ XR_OPENXR_REPO_BRANCH="master"
|
||||
|
||||
LEVEL_ZERO_SOURCE=("https://github.com/oneapi-src/level-zero/archive/refs/tags/v${LEVEL_ZERO_VERSION}.tar.gz")
|
||||
|
||||
OPENPGL_USE_REPO=false
|
||||
OPENPGL_SOURCE=( "https://github.com/OpenPathGuidingLibrary/openpgl/archive/refs/tags/v${OPENPGL_VERSION}-beta.tar.gz" )
|
||||
|
||||
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
|
||||
|
||||
# C++11 is required now
|
||||
@@ -1193,7 +1224,7 @@ Those libraries should be available as packages in all recent distributions (opt
|
||||
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
|
||||
* libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
|
||||
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
|
||||
* libsdl2, libglew, libpugixml, libpotrace, [libgmp], [libglewmx], fontconfig, [libharu/libhpdf].\""
|
||||
* libsdl2, libepoxy, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf].\""
|
||||
|
||||
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
|
||||
|
||||
@@ -1212,7 +1243,7 @@ You may also want to build them yourself (optional ones are [between brackets]):
|
||||
** [NumPy $PYTHON_NUMPY_VERSION] (use pip).
|
||||
* Boost $BOOST_VERSION (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
|
||||
* TBB $TBB_VERSION (from $TBB_SOURCE).
|
||||
* [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libwebp, ...)] (from $FFMPEG_SOURCE).
|
||||
* [FFMpeg $FFMPEG_VERSION (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, libaom, libwebp, ...)] (from $FFMPEG_SOURCE).
|
||||
* [OpenColorIO $OCIO_VERSION] (from $OCIO_SOURCE).
|
||||
* Imath $IMATH_VERSION (from $IMATH_SOURCE).
|
||||
* OpenEXR $OPENEXR_VERSION (from $OPENEXR_SOURCE).
|
||||
@@ -1227,7 +1258,8 @@ You may also want to build them yourself (optional ones are [between brackets]):
|
||||
* [Alembic $ALEMBIC_VERSION] (from $ALEMBIC_SOURCE).
|
||||
* [Universal Scene Description $USD_VERSION] (from $USD_SOURCE).
|
||||
* [OpenXR-SDK $XR_OPENXR_VERSION] (from $XR_OPENXR_SOURCE).
|
||||
* [OneAPI Level Zero $LEVEL_ZERO_VERSION] (from $LEVEL_ZERO_SOURCE).\""
|
||||
* [OneAPI Level Zero $LEVEL_ZERO_VERSION] (from $LEVEL_ZERO_SOURCE).
|
||||
* [OpenPGL $OPENPGL_VERSION] (from $OPENPGL_SOURCE).\""
|
||||
|
||||
if [ "$DO_SHOW_DEPS" = true ]; then
|
||||
PRINT ""
|
||||
@@ -1661,6 +1693,7 @@ _update_deps_tbb() {
|
||||
USD_FORCE_BUILD=true
|
||||
EMBREE_FORCE_BUILD=true
|
||||
OIDN_FORCE_BUILD=true
|
||||
OPENPGL_FORCE_BUILD=true
|
||||
fi
|
||||
if [ "$2" = true ]; then
|
||||
OSD_FORCE_REBUILD=true
|
||||
@@ -1668,6 +1701,7 @@ _update_deps_tbb() {
|
||||
USD_FORCE_REBUILD=true
|
||||
EMBREE_FORCE_REBUILD=true
|
||||
OIDN_FORCE_REBUILD=true
|
||||
OPENPGL_FORCE_REBUILD=true
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1687,7 +1721,7 @@ compile_TBB() {
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
tbb_magic=0
|
||||
tbb_magic=1
|
||||
_init_tbb
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
@@ -2696,14 +2730,13 @@ compile_OSD() {
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if [ -d $INST/tbb ]; then
|
||||
cmake_d="$cmake_d $cmake_d -D TBB_LOCATION=$INST/tbb"
|
||||
fi
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
if [ -d $INST/tbb ]; then
|
||||
cmake_d="$cmake_d -D TBB_LOCATION=$INST/tbb"
|
||||
fi
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
# ptex is only needed when nicholas bishop is ready
|
||||
cmake_d="$cmake_d -D NO_PTEX=1"
|
||||
cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1"
|
||||
cmake_d="$cmake_d -D NO_CLEW=1 -D NO_CUDA=1 -D NO_OPENCL=1 -D NO_GLEW=1"
|
||||
# maya plugin, docs, tutorials, regression tests and examples are not needed
|
||||
cmake_d="$cmake_d -D NO_MAYA=1 -D NO_DOC=1 -D NO_TUTORIALS=1 -D NO_REGRESSION=1 -DNO_EXAMPLES=1"
|
||||
|
||||
@@ -3004,7 +3037,7 @@ compile_ALEMBIC() {
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
alembic_magic=2
|
||||
alembic_magic=3
|
||||
_init_alembic
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
@@ -3052,7 +3085,7 @@ compile_ALEMBIC() {
|
||||
fi
|
||||
if [ "$_with_built_openexr" = true ]; then
|
||||
cmake_d="$cmake_d -D USE_ARNOLD=OFF"
|
||||
cmake_d="$cmake_d -D USE_BINARIES=OFF"
|
||||
cmake_d="$cmake_d -D USE_BINARIES=ON" # Tests use some Alembic binaries...
|
||||
cmake_d="$cmake_d -D USE_EXAMPLES=OFF"
|
||||
cmake_d="$cmake_d -D USE_HDF5=OFF"
|
||||
cmake_d="$cmake_d -D USE_MAYA=OFF"
|
||||
@@ -3307,7 +3340,12 @@ _init_embree() {
|
||||
}
|
||||
|
||||
_update_deps_embree() {
|
||||
:
|
||||
if [ "$1" = true ]; then
|
||||
OPENPGL_FORCE_BUILD=true
|
||||
fi
|
||||
if [ "$2" = true ]; then
|
||||
OPENPGL_FORCE_REBUILD=true
|
||||
fi
|
||||
}
|
||||
|
||||
clean_Embree() {
|
||||
@@ -3326,7 +3364,7 @@ compile_Embree() {
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled results!
|
||||
embree_magic=10
|
||||
embree_magic=12
|
||||
_init_embree
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
@@ -3386,7 +3424,7 @@ compile_Embree() {
|
||||
|
||||
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=TBB"
|
||||
if [ -d $INST/tbb ]; then
|
||||
make_d="$make_d EMBREE_TBB_ROOT=$INST/tbb"
|
||||
cmake_d="$cmake_d -D EMBREE_TBB_ROOT=$INST/tbb"
|
||||
fi
|
||||
|
||||
cmake $cmake_d ../
|
||||
@@ -3525,7 +3563,7 @@ compile_OIDN() {
|
||||
install_ISPC
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled results!
|
||||
oidn_magic=9
|
||||
oidn_magic=10
|
||||
_init_oidn
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
@@ -3581,7 +3619,7 @@ compile_OIDN() {
|
||||
cmake_d="$cmake_d -D ISPC_DIR_HINT=$_ispc_path_bin"
|
||||
|
||||
if [ -d $INST/tbb ]; then
|
||||
make_d="$make_d TBB_ROOT=$INST/tbb"
|
||||
cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
|
||||
fi
|
||||
|
||||
cmake $cmake_d ../
|
||||
@@ -3638,7 +3676,7 @@ compile_FFmpeg() {
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
ffmpeg_magic=5
|
||||
ffmpeg_magic=6
|
||||
_init_ffmpeg
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
@@ -3691,6 +3729,10 @@ compile_FFmpeg() {
|
||||
extra="$extra --enable-libvpx"
|
||||
fi
|
||||
|
||||
if [ "$AOM_USE" = true ]; then
|
||||
extra="$extra --enable-libaom"
|
||||
fi
|
||||
|
||||
if [ "$WEBP_USE" = true ]; then
|
||||
extra="$extra --enable-libwebp"
|
||||
fi
|
||||
@@ -3959,6 +4001,112 @@ compile_Level_Zero() {
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Build OpenPGL
|
||||
|
||||
_init_openpgl() {
|
||||
_src=$SRC/openpgl-$OPENPGL_VERSION
|
||||
_git=false
|
||||
_inst=$INST/openpgl-$OPENPGL_VERSION_SHORT
|
||||
_inst_shortcut=$INST/openpgl
|
||||
}
|
||||
|
||||
_update_deps_openpgl() {
|
||||
:
|
||||
}
|
||||
|
||||
clean_OpenPGL() {
|
||||
_init_openpgl
|
||||
if [ -d $_inst ]; then
|
||||
# Force rebuilding the dependencies if needed.
|
||||
_update_deps_openpgl false true
|
||||
fi
|
||||
_clean
|
||||
}
|
||||
|
||||
compile_OpenPGL() {
|
||||
if [ "$NO_BUILD" = true ]; then
|
||||
WARNING "--no-build enabled, OpenPGL will not be compiled!"
|
||||
return
|
||||
fi
|
||||
|
||||
# To be changed each time we make edits that would modify the compiled results!
|
||||
openpgl_magic=1
|
||||
_init_openpgl
|
||||
|
||||
# Force having own builds for the dependencies.
|
||||
_update_deps_openpgl true false
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check openpgl-$OPENPGL_VERSION $openpgl_magic
|
||||
if [ $? -eq 1 -o "$OPENPGL_FORCE_REBUILD" = true ]; then
|
||||
clean_OpenPGL
|
||||
fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Building OpenPGL-$OPENPGL_VERSION"
|
||||
|
||||
# Force rebuilding the dependencies.
|
||||
_update_deps_openpgl true true
|
||||
|
||||
prepare_inst
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
download OPENPGL_SOURCE[@] "$_src.tar.gz"
|
||||
INFO "Unpacking OpenPGL-$OPENPGL_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)openpgl-$OPENPGL_VERSION-beta[^/]*(.*),\1openpgl-$OPENPGL_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
|
||||
INFO "$_src"
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
rm -rf build
|
||||
fi
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake_d="-D CMAKE_BUILD_TYPE=Release"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D OPENPGL_BUILD_STATIC=OFF"
|
||||
cmake_d="$cmake_d -D OPENPGL_BUILD_PYTHON=OFF"
|
||||
cmake_d="$cmake_d -D EMBREE_ISPC_SUPPORT=OFF"
|
||||
if [ -d $INST/tbb ]; then
|
||||
cmake_d="$cmake_d -D OPENPGL_TBB_ROOT=$INST/tbb"
|
||||
cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
|
||||
fi
|
||||
|
||||
cmake $cmake_d ../
|
||||
|
||||
make -j$THREADS && make install
|
||||
make clean
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
ERROR "OpenPGL-$OPENPGL_VERSION failed to compile, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
magic_compile_set openpgl-$OPENPGL_VERSION $openpgl_magic
|
||||
|
||||
cd $CWD
|
||||
INFO "Done compiling OpenPGL-$OPENPGL_VERSION!"
|
||||
else
|
||||
INFO "Own OpenPGL-$OPENPGL_VERSION is up to date, nothing to do!"
|
||||
INFO "If you want to force rebuild of this lib, use the --force-openpgl option."
|
||||
fi
|
||||
|
||||
if [ -d $_inst ]; then
|
||||
_create_inst_shortcut
|
||||
fi
|
||||
|
||||
run_ldconfig "openpgl"
|
||||
}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Install on DEB-like
|
||||
|
||||
@@ -4059,10 +4207,10 @@ install_DEB() {
|
||||
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
|
||||
libwayland-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \
|
||||
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
|
||||
libopenal-dev libglew-dev yasm \
|
||||
libopenal-dev libepoxy-dev yasm \
|
||||
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
|
||||
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev"
|
||||
# libglewmx-dev (broken in deb testing currently...)
|
||||
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev \
|
||||
libglfw3-dev"
|
||||
|
||||
VORBIS_USE=true
|
||||
OGG_USE=true
|
||||
@@ -4145,33 +4293,37 @@ install_DEB() {
|
||||
WEBP_USE=true
|
||||
fi
|
||||
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
XVID_DEV="libxvidcore-dev"
|
||||
check_package_DEB $XVID_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
XVID_USE=true
|
||||
fi
|
||||
|
||||
MP3LAME_DEV="libmp3lame-dev"
|
||||
check_package_DEB $MP3LAME_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
MP3LAME_USE=true
|
||||
fi
|
||||
|
||||
VPX_DEV="libvpx-dev"
|
||||
check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
|
||||
OPUS_DEV="libopus-dev"
|
||||
check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
XVID_DEV="libxvidcore-dev"
|
||||
check_package_DEB $XVID_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
XVID_USE=true
|
||||
fi
|
||||
|
||||
# Check cmake/glew versions and disable features for older distros.
|
||||
MP3LAME_DEV="libmp3lame-dev"
|
||||
check_package_DEB $MP3LAME_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
MP3LAME_USE=true
|
||||
fi
|
||||
|
||||
VPX_DEV="libvpx-dev"
|
||||
check_package_version_ge_DEB $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
|
||||
AOM_DEV="libaom-dev"
|
||||
check_package_version_ge_DEB $AOM_DEV $AOM_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
AOM_USE=true
|
||||
fi
|
||||
|
||||
OPUS_DEV="libopus-dev"
|
||||
check_package_version_ge_DEB $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
|
||||
# Check cmake version and disable features for older distros.
|
||||
# This is so Blender can at least compile.
|
||||
PRINT ""
|
||||
_cmake=`get_package_version_DEB cmake`
|
||||
@@ -4188,28 +4340,6 @@ install_DEB() {
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
_glew=`get_package_version_DEB libglew-dev`
|
||||
if [ -z $_glew ]; then
|
||||
# Stupid virtual package in Ubuntu 12.04 doesn't show version number...
|
||||
_glew=`apt-cache showpkg libglew-dev|tail -n1|awk '{print $2}'|sed 's/-.*//'`
|
||||
fi
|
||||
version_ge $_glew "1.9.0"
|
||||
if [ $? -eq 1 ]; then
|
||||
version_ge $_glew "1.7.0"
|
||||
if [ $? -eq 1 ]; then
|
||||
WARNING "OpenSubdiv disabled because GLEW-$_glew is not enough"
|
||||
WARNING "Blender will not use system GLEW library"
|
||||
OSD_SKIP=true
|
||||
NO_SYSTEM_GLEW=true
|
||||
else
|
||||
WARNING "OpenSubdiv will compile with GLEW-$_glew but with limited capability"
|
||||
WARNING "Blender will not use system GLEW library"
|
||||
NO_SYSTEM_GLEW=true
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
PRINT ""
|
||||
_do_compile_python=false
|
||||
if [ "$PYTHON_SKIP" = true ]; then
|
||||
@@ -4573,6 +4703,9 @@ install_DEB() {
|
||||
if [ "$VPX_USE" = true ]; then
|
||||
_packages="$_packages $VPX_DEV"
|
||||
fi
|
||||
if [ "$AOM_USE" = true ]; then
|
||||
_packages="$_packages $AOM_DEV"
|
||||
fi
|
||||
if [ "$OPUS_USE" = true ]; then
|
||||
_packages="$_packages $OPUS_DEV"
|
||||
fi
|
||||
@@ -4607,6 +4740,18 @@ install_DEB() {
|
||||
PRINT ""
|
||||
compile_Level_Zero
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if [ "$OPENPGL_SKIP" = true ]; then
|
||||
WARNING "Skipping OpenPGL installation, as requested..."
|
||||
elif [ "$OPENPGL_FORCE_BUILD" = true ]; then
|
||||
INFO "Forced OpenPGL building, as requested..."
|
||||
compile_OpenPGL
|
||||
else
|
||||
# No package currently!
|
||||
PRINT ""
|
||||
compile_OpenPGL
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -4785,7 +4930,7 @@ install_RPM() {
|
||||
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
|
||||
wayland-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \
|
||||
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
|
||||
glew-devel yasm patch \
|
||||
libepoxy-devel yasm patch \
|
||||
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
|
||||
gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel pystring-devel"
|
||||
|
||||
@@ -4873,21 +5018,27 @@ install_RPM() {
|
||||
WEBP_USE=true
|
||||
fi
|
||||
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
VPX_DEV="libvpx-devel"
|
||||
check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
VPX_DEV="libvpx-devel"
|
||||
check_package_version_ge_RPM $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
|
||||
AOM_DEV="libaom-devel"
|
||||
check_package_version_ge_RPM $AOM_DEV $AOM_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
AOM_USE=true
|
||||
fi
|
||||
|
||||
OPUS_DEV="libopus-devel"
|
||||
check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
PRINT ""
|
||||
install_packages_RPM libspnav-devel
|
||||
|
||||
OPUS_DEV="libopus-devel"
|
||||
check_package_version_ge_RPM $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
@@ -5272,6 +5423,9 @@ install_RPM() {
|
||||
if [ "$VPX_USE" = true ]; then
|
||||
_packages="$_packages $VPX_DEV"
|
||||
fi
|
||||
if [ "$AOM_USE" = true ]; then
|
||||
_packages="$_packages $AOM_DEV"
|
||||
fi
|
||||
if [ "$OPUS_USE" = true ]; then
|
||||
_packages="$_packages $OPUS_DEV"
|
||||
fi
|
||||
@@ -5305,6 +5459,18 @@ install_RPM() {
|
||||
PRINT ""
|
||||
compile_Level_Zero
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if [ "$OPENPGL_SKIP" = true ]; then
|
||||
WARNING "Skipping OpenPGL installation, as requested..."
|
||||
elif [ "$OPENPGL_FORCE_BUILD" = true ]; then
|
||||
INFO "Forced OpenPGL building, as requested..."
|
||||
compile_OpenPGL
|
||||
else
|
||||
# No package currently!
|
||||
PRINT ""
|
||||
compile_OpenPGL
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -5416,7 +5582,7 @@ install_ARCH() {
|
||||
fi
|
||||
|
||||
_packages="$BASE_DEVEL git cmake fontconfig flex \
|
||||
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
|
||||
libxi libxcursor libxrandr libxinerama libepoxy libpng libtiff wget openal \
|
||||
$OPENJPEG_DEV yasm sdl2 fftw \
|
||||
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \
|
||||
zstd pystring"
|
||||
@@ -5461,30 +5627,34 @@ install_ARCH() {
|
||||
WEBP_USE=true
|
||||
fi
|
||||
|
||||
if [ "$WITH_ALL" = true ]; then
|
||||
XVID_DEV="xvidcore"
|
||||
check_package_ARCH $XVID_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
XVID_USE=true
|
||||
fi
|
||||
XVID_DEV="xvidcore"
|
||||
check_package_ARCH $XVID_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
XVID_USE=true
|
||||
fi
|
||||
|
||||
MP3LAME_DEV="lame"
|
||||
check_package_ARCH $MP3LAME_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
MP3LAME_USE=true
|
||||
fi
|
||||
MP3LAME_DEV="lame"
|
||||
check_package_ARCH $MP3LAME_DEV
|
||||
if [ $? -eq 0 ]; then
|
||||
MP3LAME_USE=true
|
||||
fi
|
||||
|
||||
VPX_DEV="libvpx"
|
||||
check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
VPX_DEV="libvpx"
|
||||
check_package_version_ge_ARCH $VPX_DEV $VPX_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
VPX_USE=true
|
||||
fi
|
||||
|
||||
OPUS_DEV="opus"
|
||||
check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
AOM_DEV="libaom"
|
||||
check_package_version_ge_ARCH $AOM_DEV $AOM_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
AOM_USE=true
|
||||
fi
|
||||
|
||||
OPUS_DEV="opus"
|
||||
check_package_version_ge_ARCH $OPUS_DEV $OPUS_VERSION_MIN
|
||||
if [ $? -eq 0 ]; then
|
||||
OPUS_USE=true
|
||||
fi
|
||||
|
||||
|
||||
@@ -5862,6 +6032,9 @@ install_ARCH() {
|
||||
if [ "$VPX_USE" = true ]; then
|
||||
_packages="$_packages $VPX_DEV"
|
||||
fi
|
||||
if [ "$AOM_USE" = true ]; then
|
||||
_packages="$_packages $AOM_DEV"
|
||||
fi
|
||||
if [ "$OPUS_USE" = true ]; then
|
||||
_packages="$_packages $OPUS_DEV"
|
||||
fi
|
||||
@@ -5894,6 +6067,18 @@ install_ARCH() {
|
||||
PRINT ""
|
||||
compile_Level_Zero
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if [ "$OPENPGL_SKIP" = true ]; then
|
||||
WARNING "Skipping OpenPGL installation, as requested..."
|
||||
elif [ "$OPENPGL_FORCE_BUILD" = true ]; then
|
||||
INFO "Forced OpenPGL building, as requested..."
|
||||
compile_OpenPGL
|
||||
else
|
||||
# No package currently!
|
||||
PRINT ""
|
||||
compile_OpenPGL
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -6076,6 +6261,14 @@ install_OTHER() {
|
||||
INFO "Forced Level Zero building, as requested..."
|
||||
compile_Level_Zero
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
if [ "$OPENPGL_SKIP" = true ]; then
|
||||
WARNING "Skipping OpenPGL installation, as requested..."
|
||||
elif [ "$OPENPGL_FORCE_BUILD" = true ]; then
|
||||
INFO "Forced OpenPGL building, as requested..."
|
||||
compile_OpenPGL
|
||||
fi
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
@@ -6093,7 +6286,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 *CLANG* -U *CYCLES*"
|
||||
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
|
||||
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR*"
|
||||
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR* -U *OPENPGL*"
|
||||
|
||||
_1="-D WITH_CODEC_SNDFILE=ON"
|
||||
PRINT " $_1"
|
||||
@@ -6290,12 +6483,6 @@ print_info() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$NO_SYSTEM_GLEW" = true ]; then
|
||||
_1="-D WITH_SYSTEM_GLEW=OFF"
|
||||
PRINT " $_1"
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
|
||||
if [ "$FFMPEG_SKIP" = false ]; then
|
||||
_1="-D WITH_CODEC_FFMPEG=ON"
|
||||
PRINT " $_1"
|
||||
@@ -6330,6 +6517,16 @@ print_info() {
|
||||
#~ fi
|
||||
#~ fi
|
||||
|
||||
if [ "$OPENPGL_SKIP" = false ]; then
|
||||
if [ -d $INST/openpgl ]; then
|
||||
_1="-D openpgl_DIR=$INST/openpgl/lib/cmake/openpgl-$OPENPGL_VERSION"
|
||||
_2="-D WITH_CYCLES_PATH_GUIDING=ON"
|
||||
PRINT " $_1"
|
||||
PRINT " $_2"
|
||||
_buildargs="$_buildargs $_1 $_2"
|
||||
fi
|
||||
fi
|
||||
|
||||
PRINT ""
|
||||
PRINT "Or even simpler, just run (in your blender-source dir):"
|
||||
PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\""
|
||||
|
65
build_files/build_environment/linux/linux-centos7-setup.sh
Normal file
65
build_files/build_environment/linux/linux-centos7-setup.sh
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ `id -u` -ne 0 ]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# yum-config-manager does not come in the default minimal install,
|
||||
# so make sure it is installed and available.
|
||||
yum -y update
|
||||
yum -y install yum-utils
|
||||
|
||||
# Install all the packages needed for a new toolchain.
|
||||
#
|
||||
# NOTE: Keep this separate from the packages install, since otherwise
|
||||
# older toolchain will be installed.
|
||||
yum -y update
|
||||
yum -y install epel-release
|
||||
yum -y install centos-release-scl
|
||||
yum -y install devtoolset-9
|
||||
|
||||
# Install packages needed for Blender's dependencies.
|
||||
yum -y install -y \
|
||||
git subversion bzip2 tar cmake3 patch make autoconf automake libtool \
|
||||
meson ninja-build \
|
||||
libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel \
|
||||
libX11-devel libXt-devel \
|
||||
mesa-libEGL-devel mesa-libGL-devel mesa-libGLU-devel \
|
||||
zlib-devel \
|
||||
rubygem-asciidoctor \
|
||||
wget tcl yasm python36 python-setuptools bison flex \
|
||||
ncurses-devel \
|
||||
wayland-devel libwayland-client libwayland-server \
|
||||
|
||||
|
||||
# Dependencies for Mesa
|
||||
yum -y install expat-devel
|
||||
python3 -m pip install mako
|
||||
|
||||
# Dependencies for pip (needed for buildbot-worker).
|
||||
yum -y install python36-pip python36-devel
|
||||
|
||||
# Dependencies for asound.
|
||||
yum -y install -y \
|
||||
alsa-lib-devel pulseaudio-libs-devel
|
||||
|
||||
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \
|
||||
--slave /usr/local/bin/ctest ctest /usr/bin/ctest \
|
||||
--slave /usr/local/bin/cpack cpack /usr/bin/cpack \
|
||||
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
|
||||
--family cmake
|
||||
|
||||
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
|
||||
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
|
||||
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
|
||||
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
|
||||
--family cmake
|
||||
|
||||
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
|
||||
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
|
||||
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
|
||||
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
|
||||
--family cmake
|
@@ -1,2 +0,0 @@
|
||||
cmake_minimum_required (VERSION 2.4)
|
||||
add_subdirectory(build/cmake)
|
36
build_files/build_environment/patches/dpcpp.diff
Normal file
36
build_files/build_environment/patches/dpcpp.diff
Normal file
@@ -0,0 +1,36 @@
|
||||
diff -Naur llvm-sycl-nightly-20220501.orig\opencl/CMakeLists.txt llvm-sycl-nightly-20220501\opencl/CMakeLists.txt
|
||||
--- llvm-sycl-nightly-20220501.orig/opencl/CMakeLists.txt 2022-04-29 13:47:11 -0600
|
||||
+++ llvm-sycl-nightly-20220501/opencl/CMakeLists.txt 2022-05-21 15:25:06 -0600
|
||||
@@ -11,6 +11,11 @@
|
||||
)
|
||||
endif()
|
||||
|
||||
+# Blender code below is determined to use FetchContent_Declare
|
||||
+# temporarily allow it (but feed it our downloaded tarball
|
||||
+# in the OpenCL_HEADERS variable
|
||||
+set(FETCHCONTENT_FULLY_DISCONNECTED OFF)
|
||||
+
|
||||
# Repo URLs
|
||||
|
||||
set(OCL_HEADERS_REPO
|
||||
@@ -77,5 +82,6 @@
|
||||
|
||||
FetchContent_MakeAvailable(ocl-icd)
|
||||
add_library(OpenCL-ICD ALIAS OpenCL)
|
||||
+set(FETCHCONTENT_FULLY_DISCONNECTED ON)
|
||||
|
||||
add_subdirectory(opencl-aot)
|
||||
diff -Naur llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake
|
||||
--- llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-02-08 09:17:24 -0700
|
||||
+++ llvm-sycl-nightly-20220208/libdevice/cmake/modules/SYCLLibdevice.cmake 2022-05-24 11:35:51 -0600
|
||||
@@ -36,7 +36,9 @@
|
||||
add_custom_target(libsycldevice-obj)
|
||||
add_custom_target(libsycldevice-spv)
|
||||
|
||||
-add_custom_target(libsycldevice DEPENDS
|
||||
+# Blender: add ALL here otherwise this target will not build
|
||||
+# and cause an error due to missing files during the install phase.
|
||||
+add_custom_target(libsycldevice ALL DEPENDS
|
||||
libsycldevice-obj
|
||||
libsycldevice-spv)
|
||||
|
@@ -1,30 +1,37 @@
|
||||
diff -Naur orig/common/sys/platform.h external_embree/common/sys/platform.h
|
||||
--- orig/common/sys/platform.h 2020-05-13 23:08:53 -0600
|
||||
+++ external_embree/common/sys/platform.h 2020-06-13 17:40:26 -0600
|
||||
@@ -84,8 +84,8 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in
|
||||
--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600
|
||||
+++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600
|
||||
@@ -14,6 +14,7 @@
|
||||
#cmakedefine01 EMBREE_MIN_WIDTH
|
||||
#define RTC_MIN_WIDTH EMBREE_MIN_WIDTH
|
||||
|
||||
+#cmakedefine EMBREE_STATIC_LIB
|
||||
#cmakedefine EMBREE_API_NAMESPACE
|
||||
|
||||
#if defined(EMBREE_API_NAMESPACE)
|
||||
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
|
||||
index 7c2f43d..106b1d5 100644
|
||||
--- a/kernels/CMakeLists.txt
|
||||
+++ b/kernels/CMakeLists.txt
|
||||
@@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
|
||||
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
|
||||
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
|
||||
|
||||
#ifdef __WIN32__
|
||||
-#define dll_export __declspec(dllexport)
|
||||
-#define dll_import __declspec(dllimport)
|
||||
+#define dll_export
|
||||
+#define dll_import
|
||||
#else
|
||||
#define dll_export __attribute__ ((visibility ("default")))
|
||||
#define dll_import
|
||||
diff --git orig/common/tasking/CMakeLists.txt external_embree/common/tasking/CMakeLists.txt
|
||||
--- orig/common/tasking/CMakeLists.txt
|
||||
+++ external_embree/common/tasking/CMakeLists.txt
|
||||
@@ -27,7 +27,11 @@
|
||||
else()
|
||||
# If not found try getting older TBB via module (FindTBB.cmake)
|
||||
unset(TBB_DIR CACHE)
|
||||
- find_package(TBB 4.1 REQUIRED tbb)
|
||||
+ if (TBB_STATIC_LIB)
|
||||
+ find_package(TBB 4.1 REQUIRED tbb_static)
|
||||
+ else()
|
||||
+ find_package(TBB 4.1 REQUIRED tbb)
|
||||
+ endif()
|
||||
if (TBB_FOUND)
|
||||
TARGET_LINK_LIBRARIES(tasking PUBLIC TBB)
|
||||
TARGET_INCLUDE_DIRECTORIES(tasking PUBLIC "${TBB_INCLUDE_DIRS}")
|
||||
+# Bundle Neon2x into the main static library.
|
||||
+IF(EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB)
|
||||
+ LIST(APPEND EMBREE_LIBRARY_FILES ${EMBREE_LIBRARY_FILES_AVX2})
|
||||
+ LIST(REMOVE_DUPLICATES EMBREE_LIBRARY_FILES)
|
||||
+ENDIF()
|
||||
+
|
||||
# replaces all .cpp files with a dummy file that includes that .cpp file
|
||||
# this is to work around an ICC name mangling issue related to lambda functions under windows
|
||||
MACRO (CreateISADummyFiles list isa)
|
||||
@@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
-IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2)
|
||||
+IF (EMBREE_ISA_AVX2 AND EMBREE_LIBRARY_FILES_AVX2 AND NOT (EMBREE_ISA_NEON2X AND EMBREE_STATIC_LIB))
|
||||
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
|
||||
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
|
||||
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
|
||||
|
19
build_files/build_environment/patches/epoxy.diff
Normal file
19
build_files/build_environment/patches/epoxy.diff
Normal file
@@ -0,0 +1,19 @@
|
||||
--- a/src/dispatch_wgl.c 2022-08-04 17:45:13.144924705 +0200
|
||||
+++ b/src/dispatch_wgl.c 2022-08-04 17:45:47.657482971 +0200
|
||||
@@ -78,6 +78,8 @@
|
||||
if (!first_context_current) {
|
||||
first_context_current = true;
|
||||
} else {
|
||||
+ /* BLENDER: disable slow dispatch table switching. */
|
||||
+#if 0
|
||||
if (!already_switched_to_dispatch_table) {
|
||||
already_switched_to_dispatch_table = true;
|
||||
gl_switch_to_dispatch_table();
|
||||
@@ -86,6 +88,7 @@
|
||||
|
||||
gl_init_dispatch_table();
|
||||
wgl_init_dispatch_table();
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
44
build_files/build_environment/patches/igc_opencl_clang.diff
Normal file
44
build_files/build_environment/patches/igc_opencl_clang.diff
Normal file
@@ -0,0 +1,44 @@
|
||||
diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt
|
||||
--- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600
|
||||
+++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600
|
||||
@@ -126,22 +126,24 @@
|
||||
)
|
||||
endif()
|
||||
|
||||
-
|
||||
- set(SPIRV_BASE_REVISION llvm_release_110)
|
||||
- set(TARGET_BRANCH "ocl-open-110")
|
||||
- get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
|
||||
- set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
|
||||
- apply_patches(${LLVM_MONOREPO_DIR}
|
||||
- "${LLVM_PATCHES_DIRS}"
|
||||
- ${LLVM_BASE_REVISION}
|
||||
- ${TARGET_BRANCH}
|
||||
- ret)
|
||||
- apply_patches(${SPIRV_SOURCE_DIR}
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
|
||||
- ${SPIRV_BASE_REVISION}
|
||||
- ${TARGET_BRANCH}
|
||||
- ret)
|
||||
+ #
|
||||
+ # Blender: Why apply these manually in igc.cmake
|
||||
+ #
|
||||
+ #set(SPIRV_BASE_REVISION llvm_release_110)
|
||||
+ #set(TARGET_BRANCH "ocl-open-110")
|
||||
+ #get_filename_component(LLVM_MONOREPO_DIR ${LLVM_SOURCE_DIR} DIRECTORY)
|
||||
+ #set(LLVM_PATCHES_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/patches/llvm
|
||||
+ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/clang)
|
||||
+ #apply_patches(${LLVM_MONOREPO_DIR}
|
||||
+ # "${LLVM_PATCHES_DIRS}"
|
||||
+ # ${LLVM_BASE_REVISION}
|
||||
+ # ${TARGET_BRANCH}
|
||||
+ # ret)
|
||||
+ #apply_patches(${SPIRV_SOURCE_DIR}
|
||||
+ # ${CMAKE_CURRENT_SOURCE_DIR}/patches/spirv
|
||||
+ # ${SPIRV_BASE_REVISION}
|
||||
+ # ${TARGET_BRANCH}
|
||||
+ # ret)
|
||||
endif(NOT USE_PREBUILT_LLVM)
|
||||
|
||||
#
|
@@ -14,3 +14,15 @@ index 7b894a45..92618215 100644
|
||||
)
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(pystring_CMAKE_ARGS
|
||||
--- a/src/OpenColorIO/FileRules.cpp
|
||||
+++ b/src/OpenColorIO/FileRules.cpp
|
||||
@@ -7,6 +7,9 @@
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
|
||||
+/* NOTE: this has been applied up-stream, this edit can be removed after upgrading OpenColorIO. */
|
||||
+#include <cstring>
|
||||
+
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
|
||||
#include "CustomKeys.h"
|
||||
|
24
build_files/build_environment/patches/python_windows.diff
Normal file
24
build_files/build_environment/patches/python_windows.diff
Normal file
@@ -0,0 +1,24 @@
|
||||
diff -Naur orig/PCbuild/get_externals.bat Python-3.10.2/PCbuild/get_externals.bat
|
||||
--- orig/PCbuild/get_externals.bat 2022-01-13 11:52:14 -0700
|
||||
+++ Python-3.10.2/PCbuild/get_externals.bat 2022-08-17 11:24:42 -0600
|
||||
@@ -51,7 +51,7 @@
|
||||
echo.Fetching external libraries...
|
||||
|
||||
set libraries=
|
||||
-set libraries=%libraries% bzip2-1.0.6
|
||||
+set libraries=%libraries% bzip2-1.0.8
|
||||
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0
|
||||
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1m
|
||||
set libraries=%libraries% sqlite-3.35.5.0
|
||||
diff -Naur orig/PCbuild/python.props external_python/PCbuild/python.props
|
||||
--- orig/PCbuild/python.props 2022-01-13 11:52:14 -0700
|
||||
+++ external_python/PCbuild/python.props 2022-08-17 11:38:38 -0600
|
||||
@@ -58,7 +58,7 @@
|
||||
<ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
|
||||
<ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir>
|
||||
<sqlite3Dir>$(ExternalsDir)sqlite-3.35.5.0\</sqlite3Dir>
|
||||
- <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
|
||||
+ <bz2Dir>$(ExternalsDir)bzip2-1.0.8\</bz2Dir>
|
||||
<lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
|
||||
<libffiDir>$(ExternalsDir)libffi-3.3.0\</libffiDir>
|
||||
<libffiOutDir>$(ExternalsDir)libffi-3.3.0\$(ArchName)\</libffiOutDir>
|
11
build_files/build_environment/patches/vpx_windows.diff
Normal file
11
build_files/build_environment/patches/vpx_windows.diff
Normal file
@@ -0,0 +1,11 @@
|
||||
diff -Naur orig/configure external_vpx/configure
|
||||
--- orig/configure 2022-07-06 09:22:04 -0600
|
||||
+++ external_vpx/configure 2022-07-06 09:24:12 -0600
|
||||
@@ -270,7 +270,6 @@
|
||||
HAVE_LIST="
|
||||
${ARCH_EXT_LIST}
|
||||
vpx_ports
|
||||
- pthread_h
|
||||
unistd_h
|
||||
"
|
||||
EXPERIMENT_LIST="
|
11
build_files/build_environment/patches/wayland.diff
Normal file
11
build_files/build_environment/patches/wayland.diff
Normal file
@@ -0,0 +1,11 @@
|
||||
--- meson.build.orig 2022-06-30 22:59:11.000000000 +0100
|
||||
+++ meson.build 2022-09-27 13:21:26.428517668 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
'wayland', 'c',
|
||||
version: '1.21.0',
|
||||
license: 'MIT',
|
||||
- meson_version: '>= 0.56.0',
|
||||
+ meson_version: '>= 0.55.1',
|
||||
default_options: [
|
||||
'warning_level=2',
|
||||
'buildtype=debugoptimized',
|
@@ -48,10 +48,13 @@ if "%4" == "nobuild" set dobuild=0
|
||||
|
||||
REM If Python is be available certain deps may try to
|
||||
REM to use this over the version we build, to prevent that
|
||||
REM make sure python is NOT in the path
|
||||
for %%X in (python.exe) do (set PYTHON=%%~$PATH:X)
|
||||
if EXIST "%PYTHON%" (
|
||||
echo PYTHON found at %PYTHON% dependencies cannot be build with python available in the path
|
||||
REM make sure pythonw is NOT in the path. We look for pythonw.exe
|
||||
REM since windows apparently ships a python.exe that just opens up
|
||||
REM the windows store but does not ship any actual python files that
|
||||
REM could cause issues.
|
||||
for %%X in (pythonw.exe) do (set PYTHONW=%%~$PATH:X)
|
||||
if EXIST "%PYTHONW%" (
|
||||
echo PYTHON found at %PYTHONW% dependencies cannot be build with python available in the path
|
||||
goto exit
|
||||
)
|
||||
|
||||
|
47
build_files/cmake/Modules/FindEpoxy.cmake
Normal file
47
build_files/cmake/Modules/FindEpoxy.cmake
Normal file
@@ -0,0 +1,47 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2022 Blender Foundation.
|
||||
|
||||
# This module defines
|
||||
# Epoxy_INCLUDE_DIRS, where to find epoxy/gl.h
|
||||
# Epoxy_LIBRARY, where to find the epoxy library.
|
||||
# Epoxy_ROOT_DIR, The base directory to search for epoxy.
|
||||
# This can also be an environment variable.
|
||||
# Epoxy_FOUND, If false, do not try to use epoxy.
|
||||
|
||||
IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "")
|
||||
SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(Epoxy_INCLUDE_DIR
|
||||
NAMES
|
||||
epoxy/gl.h
|
||||
HINTS
|
||||
${EPOXY_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(Epoxy_LIBRARY
|
||||
NAMES
|
||||
epoxy
|
||||
HINTS
|
||||
${EPOXY_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set Epoxy_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Epoxy DEFAULT_MSG
|
||||
Epoxy_LIBRARY Epoxy_INCLUDE_DIR)
|
||||
|
||||
IF(Epoxy_FOUND)
|
||||
SET(Epoxy_INCLUDE_DIRS ${Epoxy_INCLUDE_DIR})
|
||||
SET(Epoxy_LIBRARIES ${Epoxy_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
Epoxy_INCLUDE_DIR
|
||||
Epoxy_LIBRARY
|
||||
)
|
@@ -1,58 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2014 Blender Foundation.
|
||||
|
||||
# - Find GLEW library
|
||||
# Find the native Glew includes and library
|
||||
# This module defines
|
||||
# GLEW_INCLUDE_DIRS, where to find glew.h, Set when
|
||||
# GLEW_INCLUDE_DIR is found.
|
||||
# GLEW_ROOT_DIR, The base directory to search for Glew.
|
||||
# This can also be an environment variable.
|
||||
# GLEW_FOUND, If false, do not try to use Glew.
|
||||
#
|
||||
# also defined,
|
||||
# GLEW_LIBRARY, where to find the Glew library.
|
||||
|
||||
# If GLEW_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT GLEW_ROOT_DIR AND NOT $ENV{GLEW_ROOT_DIR} STREQUAL "")
|
||||
SET(GLEW_ROOT_DIR $ENV{GLEW_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_glew_SEARCH_DIRS
|
||||
${GLEW_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(GLEW_INCLUDE_DIR
|
||||
NAMES
|
||||
GL/glew.h
|
||||
HINTS
|
||||
${_glew_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(GLEW_LIBRARY
|
||||
NAMES
|
||||
GLEW
|
||||
HINTS
|
||||
${_glew_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# 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
|
||||
GLEW_LIBRARY GLEW_INCLUDE_DIR)
|
||||
|
||||
IF(GLEW_FOUND)
|
||||
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
GLEW_INCLUDE_DIR
|
||||
GLEW_LIBRARY
|
||||
)
|
||||
|
||||
UNSET(_glew_SEARCH_DIRS)
|
56
build_files/cmake/Modules/FindLevelZero.cmake
Normal file
56
build_files/cmake/Modules/FindLevelZero.cmake
Normal file
@@ -0,0 +1,56 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2021-2022 Intel Corporation
|
||||
|
||||
# - Find Level Zero library
|
||||
# Find Level Zero headers and libraries needed by oneAPI implementation
|
||||
# This module defines
|
||||
# LEVEL_ZERO_LIBRARY, libraries to link against in order to use L0.
|
||||
# LEVEL_ZERO_INCLUDE_DIR, directories where L0 headers can be found.
|
||||
# LEVEL_ZERO_ROOT_DIR, The base directory to search for L0 files.
|
||||
# This can also be an environment variable.
|
||||
# LEVEL_ZERO_FOUND, If false, then don't try to use L0.
|
||||
|
||||
IF(NOT LEVEL_ZERO_ROOT_DIR AND NOT $ENV{LEVEL_ZERO_ROOT_DIR} STREQUAL "")
|
||||
SET(LEVEL_ZERO_ROOT_DIR $ENV{LEVEL_ZERO_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_level_zero_search_dirs
|
||||
${LEVEL_ZERO_ROOT_DIR}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
FIND_LIBRARY(_LEVEL_ZERO_LIBRARY
|
||||
NAMES
|
||||
ze_loader
|
||||
HINTS
|
||||
${_level_zero_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
FIND_PATH(_LEVEL_ZERO_INCLUDE_DIR
|
||||
NAMES
|
||||
level_zero/ze_api.h
|
||||
HINTS
|
||||
${_level_zero_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LevelZero DEFAULT_MSG _LEVEL_ZERO_LIBRARY _LEVEL_ZERO_INCLUDE_DIR)
|
||||
|
||||
IF(LevelZero_FOUND)
|
||||
SET(LEVEL_ZERO_LIBRARY ${_LEVEL_ZERO_LIBRARY})
|
||||
SET(LEVEL_ZERO_INCLUDE_DIR ${_LEVEL_ZERO_INCLUDE_DIR} ${_LEVEL_ZERO_INCLUDE_PARENT_DIR})
|
||||
SET(LEVEL_ZERO_FOUND TRUE)
|
||||
ELSE()
|
||||
SET(LEVEL_ZERO_FOUND FALSE)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LEVEL_ZERO_LIBRARY
|
||||
LEVEL_ZERO_INCLUDE_DIR
|
||||
)
|
47
build_files/cmake/Modules/FindLibEpoxy.cmake
Normal file
47
build_files/cmake/Modules/FindLibEpoxy.cmake
Normal file
@@ -0,0 +1,47 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2022 Blender Foundation.
|
||||
|
||||
# This module defines
|
||||
# LibEpoxy_INCLUDE_DIRS, where to find epoxy/gl.h
|
||||
# LibEpoxy_LIBRARY, where to find the epoxy library.
|
||||
# LibEpoxy_ROOT_DIR, The base directory to search for libepoxy.
|
||||
# This can also be an environment variable.
|
||||
# LibEpoxy_FOUND, If false, do not try to use libepoxy.
|
||||
|
||||
IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "")
|
||||
SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(LibEpoxy_INCLUDE_DIR
|
||||
NAMES
|
||||
epoxy/gl.h
|
||||
HINTS
|
||||
${EPOXY_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LibEpoxy_LIBRARY
|
||||
NAMES
|
||||
epoxy
|
||||
HINTS
|
||||
${EPOXY_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LibEpoxy_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibEpoxy DEFAULT_MSG
|
||||
LibEpoxy_LIBRARY LibEpoxy_INCLUDE_DIR)
|
||||
|
||||
IF(LibEpoxy_FOUND)
|
||||
SET(LibEpoxy_INCLUDE_DIRS ${LibEpoxy_INCLUDE_DIR})
|
||||
SET(LibEpoxy_LIBRARIES ${LibEpoxy_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LibEpoxy_INCLUDE_DIR
|
||||
LibEpoxy_LIBRARY
|
||||
)
|
@@ -1,80 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2014 Blender Foundation.
|
||||
|
||||
# - Try to find OpenGLES
|
||||
# Once done this will define
|
||||
#
|
||||
# OPENGLES_FOUND - system has OpenGLES and EGL
|
||||
# OPENGL_EGL_FOUND - system has EGL
|
||||
# OPENGLES_INCLUDE_DIR - the GLES include directory
|
||||
# OPENGLES_LIBRARY - the GLES library
|
||||
# OPENGLES_EGL_INCLUDE_DIR - the EGL include directory
|
||||
# OPENGLES_EGL_LIBRARY - the EGL library
|
||||
# OPENGLES_LIBRARIES - all libraries needed for OpenGLES
|
||||
# OPENGLES_INCLUDES - all includes needed for OpenGLES
|
||||
|
||||
# If OPENGLES_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENGLES_ROOT_DIR AND NOT $ENV{OPENGLES_ROOT_DIR} STREQUAL "")
|
||||
SET(OPENGLES_ROOT_DIR $ENV{OPENGLES_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_opengles_SEARCH_DIRS
|
||||
${OPENGLES_ROOT_DIR}
|
||||
)
|
||||
|
||||
FIND_PATH(OPENGLES_INCLUDE_DIR
|
||||
NAMES
|
||||
GLES2/gl2.h
|
||||
HINTS
|
||||
${_opengles_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENGLES_LIBRARY
|
||||
NAMES
|
||||
GLESv2
|
||||
PATHS
|
||||
${_opengles_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
FIND_PATH(OPENGLES_EGL_INCLUDE_DIR
|
||||
NAMES
|
||||
EGL/egl.h
|
||||
HINTS
|
||||
${_opengles_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(OPENGLES_EGL_LIBRARY
|
||||
NAMES
|
||||
EGL
|
||||
HINTS
|
||||
${_opengles_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
IF(OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR)
|
||||
SET(OPENGL_EGL_FOUND "YES")
|
||||
ELSE()
|
||||
SET(OPENGL_EGL_FOUND "NO")
|
||||
ENDIF()
|
||||
|
||||
IF(OPENGLES_LIBRARY AND OPENGLES_INCLUDE_DIR AND
|
||||
OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR)
|
||||
SET(OPENGLES_LIBRARIES ${OPENGLES_LIBRARY} ${OPENGLES_LIBRARIES}
|
||||
${OPENGLES_EGL_LIBRARY})
|
||||
SET(OPENGLES_INCLUDES ${OPENGLES_INCLUDE_DIR} ${OPENGLES_EGL_INCLUDE_DIR})
|
||||
SET(OPENGLES_FOUND "YES")
|
||||
ELSE()
|
||||
SET(OPENGLES_FOUND "NO")
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENGLES_EGL_INCLUDE_DIR
|
||||
OPENGLES_EGL_LIBRARY
|
||||
OPENGLES_LIBRARY
|
||||
OPENGLES_INCLUDE_DIR
|
||||
)
|
||||
|
||||
UNSET(_opengles_SEARCH_DIRS)
|
@@ -34,11 +34,17 @@ SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
|
||||
MARK_AS_ADVANCED(PYTHON_VERSION)
|
||||
|
||||
|
||||
# See: http://docs.python.org/extending/embedding.html#linking-requirements
|
||||
# for why this is needed
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
|
||||
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
||||
|
||||
if(APPLE)
|
||||
if(WITH_PYTHON_MODULE)
|
||||
set(PYTHON_LINKFLAGS "-undefined dynamic_lookup")
|
||||
else()
|
||||
set(PYTHON_LINKFLAGS)
|
||||
endif()
|
||||
else()
|
||||
# See: http://docs.python.org/extending/embedding.html#linking-requirements
|
||||
SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic" CACHE STRING "Linker flags for python")
|
||||
MARK_AS_ADVANCED(PYTHON_LINKFLAGS)
|
||||
endif()
|
||||
|
||||
# if the user passes these defines as args, we don't want to overwrite
|
||||
SET(_IS_INC_DEF OFF)
|
||||
|
88
build_files/cmake/Modules/FindSYCL.cmake
Normal file
88
build_files/cmake/Modules/FindSYCL.cmake
Normal file
@@ -0,0 +1,88 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright 2021-2022 Intel Corporation
|
||||
|
||||
# - Find SYCL library
|
||||
# Find the native SYCL header and libraries needed by oneAPI implementation
|
||||
# This module defines
|
||||
# SYCL_COMPILER, compiler which will be used for compilation of SYCL code
|
||||
# SYCL_LIBRARY, libraries to link against in order to use SYCL.
|
||||
# SYCL_INCLUDE_DIR, directories where SYCL headers can be found
|
||||
# SYCL_ROOT_DIR, The base directory to search for SYCL files.
|
||||
# This can also be an environment variable.
|
||||
# SYCL_FOUND, If false, then don't try to use SYCL.
|
||||
|
||||
IF(NOT SYCL_ROOT_DIR AND NOT $ENV{SYCL_ROOT_DIR} STREQUAL "")
|
||||
SET(SYCL_ROOT_DIR $ENV{SYCL_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_sycl_search_dirs
|
||||
${SYCL_ROOT_DIR}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/intel/oneapi/compiler/latest/linux/
|
||||
C:/Program\ Files\ \(x86\)/Intel/oneAPI/compiler/latest/windows
|
||||
)
|
||||
|
||||
# Find DPC++ compiler.
|
||||
# Since the compiler name is possibly conflicting with the system-wide
|
||||
# CLang start with looking for either dpcpp or clang binary in the given
|
||||
# list of search paths only. If that fails, try to look for a system-wide
|
||||
# dpcpp binary.
|
||||
FIND_PROGRAM(SYCL_COMPILER
|
||||
NAMES
|
||||
dpcpp
|
||||
clang++
|
||||
HINTS
|
||||
${_sycl_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
NO_CMAKE_FIND_ROOT_PATH
|
||||
NAMES_PER_DIR
|
||||
)
|
||||
|
||||
# NOTE: No clang++ here so that we do not pick up a system-wide CLang
|
||||
# compiler.
|
||||
if(NOT SYCL_COMPILER)
|
||||
FIND_PROGRAM(SYCL_COMPILER
|
||||
NAMES
|
||||
dpcpp
|
||||
HINTS
|
||||
${_sycl_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
)
|
||||
endif()
|
||||
|
||||
FIND_LIBRARY(SYCL_LIBRARY
|
||||
NAMES
|
||||
sycl
|
||||
HINTS
|
||||
${_sycl_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
FIND_PATH(SYCL_INCLUDE_DIR
|
||||
NAMES
|
||||
CL/sycl.hpp
|
||||
HINTS
|
||||
${_sycl_search_dirs}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include/sycl
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL DEFAULT_MSG SYCL_LIBRARY SYCL_INCLUDE_DIR)
|
||||
|
||||
IF(SYCL_FOUND)
|
||||
get_filename_component(_SYCL_INCLUDE_PARENT_DIR ${SYCL_INCLUDE_DIR} DIRECTORY)
|
||||
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${_SYCL_INCLUDE_PARENT_DIR})
|
||||
ELSE()
|
||||
SET(SYCL_SYCL_FOUND FALSE)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
_SYCL_INCLUDE_PARENT_DIR
|
||||
)
|
@@ -268,7 +268,8 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0057 NEW) # if IN_LIST
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
function(gtest_add_tests)
|
||||
|
||||
if(ARGC LESS 1)
|
||||
|
@@ -40,12 +40,10 @@ macro(BLENDER_SRC_GTEST_EX)
|
||||
set(MANIFEST "${CMAKE_BINARY_DIR}/tests.exe.manifest")
|
||||
endif()
|
||||
|
||||
add_definitions(-DBLENDER_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
|
||||
add_definitions(${GFLAGS_DEFINES})
|
||||
add_definitions(${GLOG_DEFINES})
|
||||
|
||||
add_executable(${TARGET_NAME} ${ARG_SRC} ${MANIFEST})
|
||||
setup_platform_linker_flags(${TARGET_NAME})
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE ${GFLAGS_DEFINES})
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE ${GLOG_DEFINES})
|
||||
target_include_directories(${TARGET_NAME} PUBLIC "${TEST_INC}")
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC "${TEST_INC_SYS}")
|
||||
target_link_libraries(${TARGET_NAME} ${ARG_EXTRA_LIBS} ${PLATFORM_LINKLIBS})
|
||||
|
@@ -150,10 +150,10 @@ endif()
|
||||
# BUILD_PLATFORM is taken from CMake
|
||||
# but BUILD_DATE and BUILD_TIME are platform dependent
|
||||
if(NOT BUILD_DATE)
|
||||
STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
|
||||
string(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
|
||||
endif()
|
||||
if(NOT BUILD_TIME)
|
||||
STRING(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
|
||||
string(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
|
||||
endif()
|
||||
|
||||
# Write a file with the BUILD_HASH define
|
||||
|
@@ -10,40 +10,77 @@ import tempfile
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
USE_VERBOSE = (os.environ.get("VERBOSE", None) is not None)
|
||||
# Could make configurable.
|
||||
USE_VERBOSE_PROGRESS = True
|
||||
|
||||
USE_QUIET = (os.environ.get("QUIET", None) is not None)
|
||||
CHECKER_BIN = "cppcheck"
|
||||
|
||||
CHECKER_IGNORE_PREFIX = [
|
||||
"extern",
|
||||
]
|
||||
|
||||
CHECKER_BIN = "cppcheck"
|
||||
CHECKER_EXCLUDE_SOURCE_FILES = set(os.path.join(*f.split("/")) for f in (
|
||||
# These files hang (taking longer than 5min with v2.8.2 at time of writing).
|
||||
# All other files process in under around 10seconds.
|
||||
"source/blender/editors/space_text/text_format_pov.c",
|
||||
"source/blender/editors/space_text/text_format_pov_ini.c",
|
||||
))
|
||||
|
||||
CHECKER_ARGS = [
|
||||
# not sure why this is needed, but it is.
|
||||
"-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
|
||||
"--suppress=*:%s/extern/glew/include/GL/glew.h:241" % project_source_info.SOURCE_DIR,
|
||||
"--max-configs=1", # speeds up execution
|
||||
# "--check-config", # when includes are missing
|
||||
"--enable=all", # if you want sixty hundred pedantic suggestions
|
||||
# Speed up execution.
|
||||
# As Blender has many defines, the total number of configurations is large making execution unreasonably slow.
|
||||
# This could be increased but do so with care.
|
||||
"--max-configs=1",
|
||||
|
||||
# Enable this when includes are missing.
|
||||
# "--check-config",
|
||||
|
||||
# Shows many pedantic issues, some are quite useful.
|
||||
"--enable=all",
|
||||
|
||||
# Also shows useful messages, even if some are false-positives.
|
||||
"--inconclusive",
|
||||
|
||||
# Quiet output, otherwise all defines/includes are printed (overly verbose).
|
||||
# Only enable this for troubleshooting (if defines are not set as expected for example).
|
||||
"--quiet",
|
||||
*(() if USE_VERBOSE else ("--quiet",))
|
||||
|
||||
# NOTE: `--cppcheck-build-dir=<dir>` is added later as a temporary directory.
|
||||
]
|
||||
|
||||
if USE_QUIET:
|
||||
CHECKER_ARGS.append("--quiet")
|
||||
|
||||
def source_info_filter(
|
||||
source_info: List[Tuple[str, List[str], List[str]]],
|
||||
) -> List[Tuple[str, List[str], List[str]]]:
|
||||
source_dir = project_source_info.SOURCE_DIR
|
||||
if not source_dir.endswith(os.sep):
|
||||
source_dir += os.sep
|
||||
source_info_result = []
|
||||
for i, item in enumerate(source_info):
|
||||
c = item[0]
|
||||
if c.startswith(source_dir):
|
||||
c_relative = c[len(source_dir):]
|
||||
if c_relative in CHECKER_EXCLUDE_SOURCE_FILES:
|
||||
CHECKER_EXCLUDE_SOURCE_FILES.remove(c_relative)
|
||||
continue
|
||||
source_info_result.append(item)
|
||||
if CHECKER_EXCLUDE_SOURCE_FILES:
|
||||
sys.stderr.write("Error: exclude file(s) are missing: %r\n" % list(sorted(CHECKER_EXCLUDE_SOURCE_FILES)))
|
||||
sys.exit(1)
|
||||
return source_info_result
|
||||
|
||||
|
||||
def cppcheck() -> None:
|
||||
source_info = project_source_info.build_info(ignore_prefix_list=CHECKER_IGNORE_PREFIX)
|
||||
source_defines = project_source_info.build_defines_as_args()
|
||||
|
||||
# Apply exclusion.
|
||||
source_info = source_info_filter(source_info)
|
||||
|
||||
check_commands = []
|
||||
for c, inc_dirs, defs in source_info:
|
||||
cmd = (
|
||||
@@ -60,7 +97,7 @@ def cppcheck() -> None:
|
||||
process_functions = []
|
||||
|
||||
def my_process(i: int, c: str, cmd: List[str]) -> subprocess.Popen[Any]:
|
||||
if not USE_QUIET:
|
||||
if USE_VERBOSE_PROGRESS:
|
||||
percent = 100.0 * (i / len(check_commands))
|
||||
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
|
||||
|
||||
|
@@ -13,10 +13,11 @@ set(WITH_BULLET ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR_CPU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_PATH_GUIDING ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
|
@@ -7,8 +7,6 @@
|
||||
# cmake -C../blender/build_files/cmake/config/blender_lite.cmake ../blender
|
||||
#
|
||||
|
||||
set(WITH_INSTALL_PORTABLE ON CACHE BOOL "" FORCE)
|
||||
|
||||
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_BLENDER_THUMBNAILER OFF CACHE BOOL "" FORCE)
|
||||
@@ -18,7 +16,7 @@ set(WITH_BULLET OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR_CPU OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COREAUDIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||
@@ -35,6 +33,7 @@ set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IO_STL OFF CACHE BOOL "" FORCE)
|
||||
|
@@ -14,10 +14,11 @@ set(WITH_BULLET ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_COMPOSITOR_CPU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_EMBREE ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_OSL ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_PATH_GUIDING ON CACHE BOOL "" FORCE)
|
||||
set(WITH_DRACO ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
|
||||
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
|
||||
@@ -70,7 +71,7 @@ if(NOT WIN32)
|
||||
set(WITH_JACK ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(WIN32)
|
||||
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_WASAPI ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
|
||||
@@ -86,4 +87,6 @@ if(NOT APPLE)
|
||||
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_HIP_BINARIES ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE)
|
||||
set(WITH_CYCLES_ONEAPI_BINARIES ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
@@ -8,41 +8,81 @@
|
||||
|
||||
set(WITH_PYTHON_MODULE ON CACHE BOOL "" FORCE)
|
||||
|
||||
# install into the systems python dir
|
||||
set(WITH_INSTALL_PORTABLE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# no point int copying python into python
|
||||
# -----------------------------------------------------------------------------
|
||||
# Installation Configuration.
|
||||
#
|
||||
# NOTE: `WITH_INSTALL_PORTABLE` always defaults to ON when building as a Python module and
|
||||
# isn't set here as it makes changing the setting impractical.
|
||||
# Python-developers could prefer either ON/OFF depending on their usage:
|
||||
#
|
||||
# - When using the system's Python, disabling will install into their `site-packages`,
|
||||
# allowing them to run Python from any directory and `import bpy`.
|
||||
# - When using Blender's bundled Python in `./../lib/` it will install there
|
||||
# which isn't especially useful as it requires running Python from this directory too.
|
||||
#
|
||||
# So default `WITH_INSTALL_PORTABLE` to ON, and developers who don't use Python from `./../lib/`
|
||||
# can disable it if they wish to install into their systems Python.
|
||||
|
||||
# There is no point in copying python into Python.
|
||||
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# disable audio, its possible some devs may want this but for now disable
|
||||
# so the python module doesn't hold the audio device and loads quickly.
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_COREAUDIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_PULSEAUDIO OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_WASAPI OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# other features which are not especially useful as a python module
|
||||
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_NANOVDB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# Depends on Python install, do this to quiet warning.
|
||||
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# Jemalloc does not work with dlopen() of Python modules:
|
||||
# https://github.com/jemalloc/jemalloc/issues/1237
|
||||
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
|
||||
|
||||
if(WIN32)
|
||||
set(WITH_WINDOWS_BUNDLE_CRT OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Library Compatibility.
|
||||
|
||||
# JEMALLOC does not work with `dlopen()` of Python modules:
|
||||
# https://github.com/jemalloc/jemalloc/issues/1237
|
||||
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Application Support.
|
||||
|
||||
# Not useful to include with the Python module.
|
||||
# Although a way to extract this from Python could be handle,
|
||||
# this would be better exposed directly via the Python API.
|
||||
set(WITH_BLENDER_THUMBNAILER OFF CACHE BOOL "" FORCE)
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Audio Support.
|
||||
|
||||
# Disable audio, its possible some developers may want this but for now disable
|
||||
# so the Python module doesn't hold the audio device and loads quickly.
|
||||
set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_JACK OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_SDL OFF CACHE BOOL "" FORCE)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WITH_PULSEAUDIO OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(WIN32)
|
||||
set(WITH_WASAPI OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
if(APPLE)
|
||||
set(WITH_COREAUDIO OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Input Device Support.
|
||||
|
||||
# Other features which are not especially useful as a python module.
|
||||
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
|
||||
if(WIN32 OR APPLE)
|
||||
set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Language Support.
|
||||
|
||||
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
|
||||
|
33
build_files/cmake/have_features.cmake
Normal file
33
build_files/cmake/have_features.cmake
Normal file
@@ -0,0 +1,33 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright 2022 Blender Foundation. All rights reserved.
|
||||
|
||||
# This file is used to test the system for headers & symbols.
|
||||
# Variables should use the `HAVE_` prefix.
|
||||
# Defines should use the same name as the CMAKE variable.
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
# Used for: `intern/guardedalloc/intern/mallocn_intern.h`.
|
||||
# Function `malloc_stats` is only available on GLIBC,
|
||||
# so check that before defining `HAVE_MALLOC_STATS`.
|
||||
check_symbol_exists(malloc_stats "malloc.h" HAVE_MALLOC_STATS_H)
|
||||
|
||||
# Used for: `source/creator/creator_signals.c`.
|
||||
# The function `feenableexcept` is not present non-GLIBC systems,
|
||||
# hence we need to check if it's available in the `fenv.h` file.
|
||||
set(HAVE_FEENABLEEXCEPT OFF)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
check_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT)
|
||||
endif()
|
||||
|
||||
# Used for: `source/blender/blenlib/intern/system.c`.
|
||||
# `execinfo` is not available on non-GLIBC systems (at least not on MUSL-LIBC),
|
||||
# so check the presence of the header before including it and using the it for back-trace.
|
||||
set(HAVE_EXECINFO_H OFF)
|
||||
if(NOT MSVC)
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files("execinfo.h" HAVE_EXECINFO_H)
|
||||
if(HAVE_EXECINFO_H)
|
||||
add_definitions(-DHAVE_EXECINFO_H)
|
||||
endif()
|
||||
endif()
|
@@ -134,12 +134,11 @@ endfunction()
|
||||
|
||||
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
|
||||
# use it instead of include_directories()
|
||||
function(blender_include_dirs
|
||||
includes
|
||||
)
|
||||
function(absolute_include_dirs
|
||||
includes_absolute)
|
||||
|
||||
set(_ALL_INCS "")
|
||||
foreach(_INC ${ARGV})
|
||||
foreach(_INC ${ARGN})
|
||||
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||
# for checking for invalid includes, disable for regular use
|
||||
@@ -147,22 +146,24 @@ function(blender_include_dirs
|
||||
# message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
|
||||
# endif()
|
||||
endforeach()
|
||||
include_directories(${_ALL_INCS})
|
||||
|
||||
set(${includes_absolute} ${_ALL_INCS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(blender_include_dirs_sys
|
||||
includes
|
||||
function(blender_target_include_dirs
|
||||
name
|
||||
)
|
||||
|
||||
set(_ALL_INCS "")
|
||||
foreach(_INC ${ARGV})
|
||||
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||
# if(NOT EXISTS "${_ABS_INC}/")
|
||||
# message(FATAL_ERROR "Include not found: ${_ABS_INC}/")
|
||||
# endif()
|
||||
endforeach()
|
||||
include_directories(SYSTEM ${_ALL_INCS})
|
||||
absolute_include_dirs(_ALL_INCS ${ARGN})
|
||||
target_include_directories(${name} PRIVATE ${_ALL_INCS})
|
||||
endfunction()
|
||||
|
||||
function(blender_target_include_dirs_sys
|
||||
name
|
||||
)
|
||||
|
||||
absolute_include_dirs(_ALL_INCS ${ARGN})
|
||||
target_include_directories(${name} SYSTEM PRIVATE ${_ALL_INCS})
|
||||
endfunction()
|
||||
|
||||
# Set include paths for header files included with "*.h" syntax.
|
||||
@@ -268,13 +269,11 @@ function(blender_add_lib__impl
|
||||
|
||||
# message(STATUS "Configuring library ${name}")
|
||||
|
||||
# include_directories(${includes})
|
||||
# include_directories(SYSTEM ${includes_sys})
|
||||
blender_include_dirs("${includes}")
|
||||
blender_include_dirs_sys("${includes_sys}")
|
||||
|
||||
add_library(${name} ${sources})
|
||||
|
||||
blender_target_include_dirs(${name} ${includes})
|
||||
blender_target_include_dirs_sys(${name} ${includes_sys})
|
||||
|
||||
# On Windows certain libraries have two sets of binaries: one for debug builds and one for
|
||||
# release builds. The root of this requirement goes into ABI, I believe, but that's outside
|
||||
# of a scope of this comment.
|
||||
@@ -382,7 +381,7 @@ function(blender_add_test_suite)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
# Figure out the release dir, as some tests need files from there.
|
||||
GET_BLENDER_TEST_INSTALL_DIR(TEST_INSTALL_DIR)
|
||||
get_blender_test_install_dir(TEST_INSTALL_DIR)
|
||||
if(APPLE)
|
||||
set(_test_release_dir ${TEST_INSTALL_DIR}/Blender.app/Contents/Resources/${BLENDER_VERSION})
|
||||
else()
|
||||
@@ -425,21 +424,21 @@ function(blender_add_test_lib
|
||||
|
||||
# This duplicates logic that's also in GTestTesting.cmake, macro BLENDER_SRC_GTEST_EX.
|
||||
# TODO(Sybren): deduplicate after the general approach in D7649 has been approved.
|
||||
LIST(APPEND includes
|
||||
list(APPEND includes
|
||||
${CMAKE_SOURCE_DIR}/tests/gtests
|
||||
)
|
||||
LIST(APPEND includes_sys
|
||||
list(APPEND includes_sys
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFLAGS_INCLUDE_DIRS}
|
||||
${CMAKE_SOURCE_DIR}/extern/gtest/include
|
||||
${CMAKE_SOURCE_DIR}/extern/gmock/include
|
||||
)
|
||||
add_definitions(-DBLENDER_GFLAGS_NAMESPACE=${GFLAGS_NAMESPACE})
|
||||
add_definitions(${GFLAGS_DEFINES})
|
||||
add_definitions(${GLOG_DEFINES})
|
||||
|
||||
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
|
||||
|
||||
target_compile_definitions(${name} PRIVATE ${GFLAGS_DEFINES})
|
||||
target_compile_definitions(${name} PRIVATE ${GLOG_DEFINES})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY BLENDER_TEST_LIBS ${name})
|
||||
|
||||
blender_add_test_suite(
|
||||
@@ -469,16 +468,16 @@ function(blender_add_test_executable
|
||||
## Otherwise external projects will produce warnings that we cannot fix.
|
||||
remove_strict_flags()
|
||||
|
||||
include_directories(${includes})
|
||||
include_directories(${includes_sys})
|
||||
|
||||
BLENDER_SRC_GTEST_EX(
|
||||
blender_src_gtest_ex(
|
||||
NAME ${name}
|
||||
SRC "${sources}"
|
||||
EXTRA_LIBS "${library_deps}"
|
||||
SKIP_ADD_TEST
|
||||
)
|
||||
|
||||
blender_target_include_dirs(${name}_test ${includes})
|
||||
blender_target_include_dirs_sys(${name}_test ${includes_sys})
|
||||
|
||||
blender_add_test_suite(
|
||||
TARGET ${name}_test
|
||||
SUITE_NAME ${name}
|
||||
@@ -513,6 +512,11 @@ function(setup_platform_linker_flags
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${PLATFORM_LINKFLAGS}")
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " ${PLATFORM_LINKFLAGS_RELEASE}")
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
|
||||
get_target_property(target_type ${target} TYPE)
|
||||
if (target_type STREQUAL "EXECUTABLE")
|
||||
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${PLATFORM_LINKFLAGS_EXECUTABLE}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Platform specific libraries for targets.
|
||||
@@ -760,7 +764,7 @@ function(ADD_CHECK_C_COMPILER_FLAG
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
CHECK_C_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
|
||||
check_c_compiler_flag("${_FLAG}" "${_CACHE_VAR}")
|
||||
if(${_CACHE_VAR})
|
||||
# message(STATUS "Using CFLAG: ${_FLAG}")
|
||||
set(${_CFLAGS} "${${_CFLAGS}} ${_FLAG}" PARENT_SCOPE)
|
||||
@@ -777,7 +781,7 @@ function(ADD_CHECK_CXX_COMPILER_FLAG
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("${_FLAG}" "${_CACHE_VAR}")
|
||||
check_cxx_compiler_flag("${_FLAG}" "${_CACHE_VAR}")
|
||||
if(${_CACHE_VAR})
|
||||
# message(STATUS "Using CXXFLAG: ${_FLAG}")
|
||||
set(${_CXXFLAGS} "${${_CXXFLAGS}} ${_FLAG}" PARENT_SCOPE)
|
||||
@@ -795,9 +799,11 @@ function(get_blender_version)
|
||||
# - BLENDER_VERSION_PATCH
|
||||
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
|
||||
|
||||
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h
|
||||
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender_version.h.done)
|
||||
# So CMAKE depends on `BKE_blender.h`, beware of infinite-loops!
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h
|
||||
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender_version.h.done
|
||||
)
|
||||
|
||||
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
|
||||
|
||||
@@ -1184,8 +1190,6 @@ macro(openmp_delayload
|
||||
if(WITH_OPENMP)
|
||||
if(MSVC_CLANG)
|
||||
set(OPENMP_DLL_NAME "libomp")
|
||||
elseif(MSVC_VERSION EQUAL 1800)
|
||||
set(OPENMP_DLL_NAME "vcomp120")
|
||||
else()
|
||||
set(OPENMP_DLL_NAME "vcomp140")
|
||||
endif()
|
||||
@@ -1208,16 +1212,8 @@ endmacro()
|
||||
|
||||
macro(without_system_libs_begin)
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
|
||||
if(APPLE)
|
||||
# Avoid searching for headers in frameworks (like Mono), and libraries in LIBDIR.
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(without_system_libs_end)
|
||||
unset(CMAKE_IGNORE_PATH)
|
||||
if(APPLE)
|
||||
# FIRST is the default.
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -17,9 +17,9 @@ set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
|
||||
set(CPACK_PACKAGE_CONTACT ${PROJECT_CONTACT})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
|
||||
|
||||
|
||||
# Get the build revision, note that this can get out-of-sync, so for packaging run cmake first.
|
||||
@@ -48,7 +48,7 @@ if(MSVC)
|
||||
else()
|
||||
set(PACKAGE_ARCH windows32)
|
||||
endif()
|
||||
else(MSVC)
|
||||
else()
|
||||
set(PACKAGE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
|
||||
|
@@ -21,6 +21,18 @@ function(print_found_status
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Utility to install precompiled shared libraries.
|
||||
macro(add_bundled_libraries library)
|
||||
if(EXISTS ${LIBDIR})
|
||||
set(_library_dir ${LIBDIR}/${library}/lib)
|
||||
file(GLOB _all_library_versions ${_library_dir}/*\.dylib*)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
|
||||
unset(_all_library_versions)
|
||||
unset(_library_dir)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# Find system provided libraries.
|
||||
|
||||
@@ -63,6 +75,15 @@ if(NOT EXISTS "${LIBDIR}/")
|
||||
message(FATAL_ERROR "Mac OSX requires pre-compiled libs at: '${LIBDIR}'")
|
||||
endif()
|
||||
|
||||
# Avoid searching for headers since this would otherwise override our lib
|
||||
# directory as well as PYTHON_ROOT_DIR.
|
||||
set(CMAKE_FIND_FRAMEWORK NEVER)
|
||||
|
||||
# Optionally use system Python if PYTHON_ROOT_DIR is specified.
|
||||
if(WITH_PYTHON AND (WITH_PYTHON_MODULE AND PYTHON_ROOT_DIR))
|
||||
find_package(PythonLibsUnix REQUIRED)
|
||||
endif()
|
||||
|
||||
# Prefer lib directory paths
|
||||
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||
set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
|
||||
@@ -111,34 +132,8 @@ if(WITH_CODEC_SNDFILE)
|
||||
unset(_sndfile_VORBISENC_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
# Use precompiled libraries by default.
|
||||
set(PYTHON_VERSION 3.10)
|
||||
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
|
||||
# Normally cached but not since we include them with blender.
|
||||
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
|
||||
set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}")
|
||||
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/libpython${PYTHON_VERSION}.a)
|
||||
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
|
||||
else()
|
||||
# Module must be compiled against Python framework.
|
||||
set(_py_framework "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}")
|
||||
set(PYTHON_INCLUDE_DIR "${_py_framework}/include/python${PYTHON_VERSION}")
|
||||
set(PYTHON_EXECUTABLE "${_py_framework}/bin/python${PYTHON_VERSION}")
|
||||
set(PYTHON_LIBPATH "${_py_framework}/lib/python${PYTHON_VERSION}")
|
||||
unset(_py_framework)
|
||||
endif()
|
||||
|
||||
# uncached vars
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
|
||||
|
||||
# needed for Audaspace, numpy is installed into python site-packages
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
|
||||
|
||||
if(NOT EXISTS "${PYTHON_EXECUTABLE}")
|
||||
message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
|
||||
endif()
|
||||
if(WITH_PYTHON AND NOT (WITH_PYTHON_MODULE AND PYTHON_ROOT_DIR))
|
||||
find_package(PythonLibsUnix REQUIRED)
|
||||
endif()
|
||||
|
||||
if(WITH_FFTW3)
|
||||
@@ -162,6 +157,9 @@ if(WITH_CODEC_FFMPEG)
|
||||
mp3lame ogg opus swresample swscale
|
||||
theora theoradec theoraenc vorbis vorbisenc
|
||||
vorbisfile vpx x264 xvidcore)
|
||||
if(EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)
|
||||
list(APPEND FFMPEG_FIND_COMPONENTS aom)
|
||||
endif()
|
||||
find_package(FFmpeg)
|
||||
endif()
|
||||
|
||||
@@ -198,11 +196,6 @@ if(WITH_JACK)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -F/Library/Frameworks -weak_framework jackmp")
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON_MODULE OR WITH_PYTHON_FRAMEWORK)
|
||||
# force cmake to link right framework
|
||||
string(APPEND PLATFORM_LINKFLAGS " /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/Python")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
find_package(OpenCOLLADA)
|
||||
find_library(PCRE_LIBRARIES NAMES pcre HINTS ${LIBDIR}/opencollada/lib)
|
||||
@@ -223,6 +216,9 @@ if(WITH_SDL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(EPOXY_ROOT_DIR ${LIBDIR}/epoxy)
|
||||
find_package(Epoxy REQUIRED)
|
||||
|
||||
set(PNG_ROOT ${LIBDIR}/png)
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
@@ -328,7 +324,7 @@ if(WITH_LLVM)
|
||||
if(WITH_CLANG)
|
||||
find_package(Clang)
|
||||
if(NOT CLANG_FOUND)
|
||||
message(FATAL_ERROR "Clang not found.")
|
||||
message(FATAL_ERROR "Clang not found.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -356,10 +352,6 @@ endif()
|
||||
|
||||
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||
find_package(Embree 3.8.0 REQUIRED)
|
||||
# Increase stack size for Embree, only works for executables.
|
||||
if(NOT WITH_PYTHON_MODULE)
|
||||
string(APPEND PLATFORM_LINKFLAGS " -Wl,-stack_size,0x100000")
|
||||
endif()
|
||||
|
||||
# Embree static library linking can mix up SSE and AVX symbols, causing
|
||||
# crashes on macOS systems with older CPUs that don't have AVX. Using
|
||||
@@ -409,6 +401,7 @@ if(WITH_OPENMP)
|
||||
set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
|
||||
set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
|
||||
set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
|
||||
add_bundled_libraries(openmp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -436,6 +429,18 @@ if(WITH_HARU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_PATH_GUIDING)
|
||||
find_package(openpgl QUIET)
|
||||
if(openpgl_FOUND)
|
||||
get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
|
||||
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
|
||||
message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
|
||||
else()
|
||||
set(WITH_CYCLES_PATH_GUIDING OFF)
|
||||
message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ZSTD_ROOT_DIR ${LIBDIR}/zstd)
|
||||
find_package(Zstd REQUIRED)
|
||||
|
||||
@@ -443,6 +448,9 @@ if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
|
||||
# Restore to default.
|
||||
set(CMAKE_FIND_FRAMEWORK FIRST)
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Set compiler and linker flags.
|
||||
|
||||
@@ -467,13 +475,17 @@ string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
|
||||
|
||||
# Avoid conflicts with Luxrender, and other plug-ins that may use the same
|
||||
# libraries as Blender with a different version or build options.
|
||||
set(PLATFORM_SYMBOLS_MAP ${CMAKE_SOURCE_DIR}/source/creator/symbols_apple.map)
|
||||
string(APPEND PLATFORM_LINKFLAGS
|
||||
" -Wl,-unexported_symbols_list,'${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
|
||||
" -Wl,-unexported_symbols_list,'${PLATFORM_SYMBOLS_MAP}'"
|
||||
)
|
||||
|
||||
string(APPEND CMAKE_CXX_FLAGS " -stdlib=libc++")
|
||||
string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
|
||||
|
||||
# Make stack size more similar to Embree, required for Embree.
|
||||
string(APPEND PLATFORM_LINKFLAGS_EXECUTABLE " -Wl,-stack_size,0x100000")
|
||||
|
||||
# Suppress ranlib "has no symbols" warnings (workaround for T48250)
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
@@ -497,17 +509,27 @@ if(WITH_COMPILER_CCACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For binaries that are built but not installed (also not distributed) (datatoc,
|
||||
# makesdna, tests, etc.), we add an rpath to the OpenMP library dir through
|
||||
# CMAKE_BUILD_RPATH. This avoids having to make many copies of the dylib next to each binary.
|
||||
#
|
||||
# For the installed Python module and installed Blender executable, CMAKE_INSTALL_RPATH
|
||||
# is modified to find the dylib in an adjacent folder. Install step puts the libraries there.
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
list(APPEND CMAKE_BUILD_RPATH "${OpenMP_LIBRARY_DIR}")
|
||||
if(WITH_COMPILER_ASAN)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${COMPILER_ASAN_LIBRARY})
|
||||
endif()
|
||||
|
||||
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
||||
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/${BLENDER_VERSION}/lib")
|
||||
if(PLATFORM_BUNDLED_LIBRARIES)
|
||||
# For the installed Python module and installed Blender executable, we set the
|
||||
# rpath to the location where install step will copy the shared libraries.
|
||||
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
||||
if(WITH_PYTHON_MODULE)
|
||||
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/lib")
|
||||
else()
|
||||
list(APPEND CMAKE_INSTALL_RPATH "@loader_path/../Resources/lib")
|
||||
endif()
|
||||
|
||||
# For binaries that are built but not installed (like makesdan or tests), we add
|
||||
# the original directory of all shared libraries to the rpath. This is needed because
|
||||
# these can be in different folders, and because the build and install folder may be
|
||||
# different.
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
list(APPEND CMAKE_BUILD_RPATH ${PLATFORM_BUNDLED_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
# Same as `CFBundleIdentifier` in Info.plist.
|
||||
set(CMAKE_XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "org.blenderfoundation.blender")
|
||||
|
@@ -16,13 +16,15 @@ if(NOT DEFINED LIBDIR)
|
||||
# Choose the best suitable libraries.
|
||||
if(EXISTS ${LIBDIR_NATIVE_ABI})
|
||||
set(LIBDIR ${LIBDIR_NATIVE_ABI})
|
||||
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
|
||||
elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
|
||||
set(LIBDIR ${LIBDIR_CENTOS7_ABI})
|
||||
set(WITH_CXX11_ABI OFF)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC AND
|
||||
CMAKE_C_COMPILER_VERSION VERSION_LESS 9.3)
|
||||
message(FATAL_ERROR "GCC version must be at least 9.3 for precompiled libraries, found ${CMAKE_C_COMPILER_VERSION}")
|
||||
if(WITH_MEM_JEMALLOC)
|
||||
# jemalloc provides malloc hooks.
|
||||
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False)
|
||||
else()
|
||||
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -38,9 +40,15 @@ if(EXISTS ${LIBDIR})
|
||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||
|
||||
file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
|
||||
|
||||
# Ignore Mesa software OpenGL libraries, they are not intended to be
|
||||
# linked against but to optionally override at runtime.
|
||||
list(REMOVE_ITEM LIB_SUBDIRS ${LIBDIR}/mesa)
|
||||
|
||||
# Ignore DPC++ as it contains its own copy of LLVM/CLang which we do
|
||||
# not need to be ever discovered for the Blender linking.
|
||||
list(REMOVE_ITEM LIB_SUBDIRS ${LIBDIR}/dpcpp)
|
||||
|
||||
# NOTE: Make sure "proper" compiled zlib comes first before the one
|
||||
# which is a part of OpenCollada. They have different ABI, and we
|
||||
# do need to use the official one.
|
||||
@@ -75,6 +83,15 @@ macro(find_package_wrapper)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Utility to install precompiled shared libraries.
|
||||
macro(add_bundled_libraries library)
|
||||
if(EXISTS ${LIBDIR})
|
||||
file(GLOB _all_library_versions ${LIBDIR}/${library}/lib/*\.so*)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
|
||||
unset(_all_library_versions)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Precompiled Libraries
|
||||
#
|
||||
@@ -89,6 +106,19 @@ find_package_wrapper(JPEG REQUIRED)
|
||||
find_package_wrapper(PNG REQUIRED)
|
||||
find_package_wrapper(ZLIB REQUIRED)
|
||||
find_package_wrapper(Zstd REQUIRED)
|
||||
find_package_wrapper(Epoxy REQUIRED)
|
||||
|
||||
function(check_freetype_for_brotli)
|
||||
include(CheckSymbolExists)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${FREETYPE_INCLUDE_DIRS})
|
||||
check_symbol_exists(FT_CONFIG_OPTION_USE_BROTLI "freetype/config/ftconfig.h" HAVE_BROTLI)
|
||||
unset(CMAKE_REQUIRED_INCLUDES)
|
||||
if(NOT HAVE_BROTLI)
|
||||
unset(HAVE_BROTLI CACHE)
|
||||
message(FATAL_ERROR "Freetype needs to be compiled with brotli support!")
|
||||
endif()
|
||||
unset(HAVE_BROTLI CACHE)
|
||||
endfunction()
|
||||
|
||||
if(NOT WITH_SYSTEM_FREETYPE)
|
||||
# FreeType compiled with Brotli compression for woff2.
|
||||
@@ -104,17 +134,42 @@ if(NOT WITH_SYSTEM_FREETYPE)
|
||||
# ${BROTLI_LIBRARIES}
|
||||
# )
|
||||
endif()
|
||||
check_freetype_for_brotli()
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
# No way to set py35, remove for now.
|
||||
# find_package(PythonLibs)
|
||||
# This could be used, see: D14954 for details.
|
||||
# `find_package(PythonLibs)`
|
||||
|
||||
# Use our own instead, since without py is such a rare case,
|
||||
# require this package
|
||||
# XXX Linking errors with debian static python :/
|
||||
# find_package_wrapper(PythonLibsUnix REQUIRED)
|
||||
# Use our own instead, since without Python is such a rare case,
|
||||
# require this package.
|
||||
# XXX: Linking errors with Debian static Python (sigh).
|
||||
# find_package_wrapper(PythonLibsUnix REQUIRED)
|
||||
find_package(PythonLibsUnix REQUIRED)
|
||||
|
||||
if(WITH_PYTHON_MODULE AND NOT WITH_INSTALL_PORTABLE)
|
||||
# Installing into `site-packages`, warn when installing into `./../lib/`
|
||||
# which script authors almost certainly don't want.
|
||||
if(EXISTS ${LIBDIR})
|
||||
cmake_path(IS_PREFIX LIBDIR "${PYTHON_SITE_PACKAGES}" NORMALIZE _is_prefix)
|
||||
if(_is_prefix)
|
||||
message(WARNING "
|
||||
Building Blender with the following configuration:
|
||||
- WITH_PYTHON_MODULE=ON
|
||||
- WITH_INSTALL_PORTABLE=OFF
|
||||
- LIBDIR=\"${LIBDIR}\"
|
||||
- PYTHON_SITE_PACKAGES=\"${PYTHON_SITE_PACKAGES}\"
|
||||
In this case you may want to either:
|
||||
- Use the system Python's site-packages, see:
|
||||
python -c \"import site; print(site.getsitepackages()[0])\"
|
||||
- Set WITH_INSTALL_PORTABLE=ON to create a stand-alone \"bpy\" module
|
||||
which you will need to ensure is in Python's module search path.
|
||||
Proceeding with PYTHON_SITE_PACKAGES install target, you have been warned!"
|
||||
)
|
||||
endif()
|
||||
unset(_is_prefix)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
@@ -196,6 +251,9 @@ if(WITH_CODEC_FFMPEG)
|
||||
vpx
|
||||
x264
|
||||
xvidcore)
|
||||
if(EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)
|
||||
list(APPEND FFMPEG_FIND_COMPONENTS aom)
|
||||
endif()
|
||||
elseif(FFMPEG)
|
||||
# Old cache variable used for root dir, convert to new standard.
|
||||
set(FFMPEG_ROOT_DIR ${FFMPEG})
|
||||
@@ -271,6 +329,26 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_DEVICE_ONEAPI)
|
||||
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
|
||||
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
|
||||
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
|
||||
endif()
|
||||
|
||||
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
|
||||
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
|
||||
set(SYCL_ROOT_DIR ${CYCLES_SYCL})
|
||||
endif()
|
||||
file(GLOB _sycl_runtime_libraries
|
||||
${SYCL_ROOT_DIR}/lib/libsycl.so
|
||||
${SYCL_ROOT_DIR}/lib/libsycl.so.[0-9]
|
||||
${SYCL_ROOT_DIR}/lib/libsycl.so.[0-9].[0-9].[0-9]-[0-9]
|
||||
${SYCL_ROOT_DIR}/lib/libpi_level_zero.so
|
||||
)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
|
||||
unset(_sycl_runtime_libraries)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENVDB)
|
||||
find_package_wrapper(OpenVDB)
|
||||
find_package_wrapper(Blosc)
|
||||
@@ -514,6 +592,18 @@ if(WITH_HARU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_PATH_GUIDING)
|
||||
find_package_wrapper(openpgl)
|
||||
if(openpgl_FOUND)
|
||||
get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
|
||||
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
|
||||
message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
|
||||
else()
|
||||
set(WITH_CYCLES_PATH_GUIDING OFF)
|
||||
message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS ${LIBDIR})
|
||||
without_system_libs_end()
|
||||
endif()
|
||||
@@ -566,6 +656,7 @@ if(WITH_SYSTEM_FREETYPE)
|
||||
if(NOT FREETYPE_FOUND)
|
||||
message(FATAL_ERROR "Failed finding system FreeType version!")
|
||||
endif()
|
||||
check_freetype_for_brotli()
|
||||
endif()
|
||||
|
||||
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
||||
@@ -608,22 +699,130 @@ endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(wayland-client REQUIRED wayland-client>=1.12)
|
||||
pkg_check_modules(wayland-egl REQUIRED wayland-egl)
|
||||
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
|
||||
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
|
||||
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
|
||||
pkg_check_modules(dbus REQUIRED dbus-1)
|
||||
pkg_check_modules(wayland-client wayland-client>=1.12)
|
||||
pkg_check_modules(wayland-egl wayland-egl)
|
||||
pkg_check_modules(wayland-scanner wayland-scanner)
|
||||
pkg_check_modules(xkbcommon xkbcommon)
|
||||
pkg_check_modules(wayland-cursor wayland-cursor)
|
||||
pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
|
||||
|
||||
set(WITH_GL_EGL ON)
|
||||
if(${wayland-protocols_FOUND})
|
||||
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
|
||||
else()
|
||||
# CentOS 7 packages have too old a version, a newer version exist in the
|
||||
# precompiled libraries.
|
||||
find_path(WAYLAND_PROTOCOLS_DIR
|
||||
NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
|
||||
PATH_SUFFIXES share/wayland-protocols
|
||||
PATHS ${LIBDIR}/wayland-protocols
|
||||
)
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${wayland-client_LINK_LIBRARIES}
|
||||
${wayland-egl_LINK_LIBRARIES}
|
||||
${xkbcommon_LINK_LIBRARIES}
|
||||
${wayland-cursor_LINK_LIBRARIES}
|
||||
${dbus_LINK_LIBRARIES}
|
||||
)
|
||||
if(EXISTS ${WAYLAND_PROTOCOLS_DIR})
|
||||
set(wayland-protocols_FOUND ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT ${wayland-client_FOUND})
|
||||
message(STATUS "wayland-client not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
if (NOT ${wayland-egl_FOUND})
|
||||
message(STATUS "wayland-egl not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
if (NOT ${wayland-scanner_FOUND})
|
||||
message(STATUS "wayland-scanner not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
if (NOT ${wayland-cursor_FOUND})
|
||||
message(STATUS "wayland-cursor not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
if (NOT ${wayland-protocols_FOUND})
|
||||
message(STATUS "wayland-protocols not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
if (NOT ${xkbcommon_FOUND})
|
||||
message(STATUS "xkbcommon not found, disabling WITH_GHOST_WAYLAND")
|
||||
set(WITH_GHOST_WAYLAND OFF)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND)
|
||||
if(WITH_GHOST_WAYLAND_DBUS)
|
||||
pkg_check_modules(dbus REQUIRED dbus-1)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND_LIBDECOR)
|
||||
pkg_check_modules(libdecor REQUIRED libdecor-0>=0.1)
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${xkbcommon_LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${wayland-client_LINK_LIBRARIES}
|
||||
${wayland-egl_LINK_LIBRARIES}
|
||||
${wayland-cursor_LINK_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND_DBUS)
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${dbus_LINK_LIBRARIES}
|
||||
)
|
||||
add_definitions(-DWITH_GHOST_WAYLAND_DBUS)
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_WAYLAND_LIBDECOR)
|
||||
if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
|
||||
list(APPEND PLATFORM_LINKLIBS
|
||||
${libdecor_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${LIBDIR}/wayland/bin/wayland-scanner")
|
||||
set(WAYLAND_SCANNER "${LIBDIR}/wayland/bin/wayland-scanner")
|
||||
else()
|
||||
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
|
||||
endif()
|
||||
|
||||
# When using dynamic loading, headers generated
|
||||
# from older versions of `wayland-scanner` aren't compatible.
|
||||
if(WITH_GHOST_WAYLAND_DYNLOAD)
|
||||
execute_process(
|
||||
COMMAND ${WAYLAND_SCANNER} --version
|
||||
# The version is written to the `stderr`.
|
||||
ERROR_VARIABLE _wayland_scanner_out
|
||||
ERROR_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT "${_wayland_scanner_out}" STREQUAL "")
|
||||
string(
|
||||
REGEX REPLACE
|
||||
"^wayland-scanner[ \t]+([0-9]+)\.([0-9]+).*"
|
||||
"\\1.\\2"
|
||||
_wayland_scanner_ver
|
||||
"${_wayland_scanner_out}"
|
||||
)
|
||||
if("${_wayland_scanner_ver}" VERSION_LESS "1.20")
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Found ${WAYLAND_SCANNER} version \"${_wayland_scanner_ver}\", "
|
||||
"the minimum version is 1.20!"
|
||||
)
|
||||
endif()
|
||||
unset(_wayland_scanner_ver)
|
||||
else()
|
||||
message(WARNING "Unable to access the version from ${WAYLAND_SCANNER}, continuing.")
|
||||
endif()
|
||||
unset(_wayland_scanner_out)
|
||||
endif()
|
||||
# End wayland-scanner version check.
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GHOST_X11)
|
||||
@@ -743,7 +942,8 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
"The mold linker could not find the directory containing the linker command "
|
||||
"(typically "
|
||||
"\"${MOLD_PREFIX}/libexec/mold/ld\") or "
|
||||
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker.")
|
||||
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker."
|
||||
)
|
||||
set(WITH_LINKER_MOLD OFF)
|
||||
endif()
|
||||
unset(MOLD_PREFIX)
|
||||
@@ -842,8 +1042,9 @@ unset(_IS_LINKER_DEFAULT)
|
||||
|
||||
# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
|
||||
# use the same libraries as Blender with a different version or build options.
|
||||
set(PLATFORM_SYMBOLS_MAP ${CMAKE_SOURCE_DIR}/source/creator/symbols_unix.map)
|
||||
set(PLATFORM_LINKFLAGS
|
||||
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
|
||||
"${PLATFORM_LINKFLAGS} -Wl,--version-script='${PLATFORM_SYMBOLS_MAP}'"
|
||||
)
|
||||
|
||||
# Don't use position independent executable for portable install since file
|
||||
@@ -881,7 +1082,8 @@ function(CONFIGURE_ATOMIC_LIB_IF_NEEDED)
|
||||
int main(int argc, char **argv) {
|
||||
std::atomic<uint64_t> uint64; uint64++;
|
||||
return 0;
|
||||
}")
|
||||
}"
|
||||
)
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
check_cxx_source_compiles("${_source}" ATOMIC_OPS_WITHOUT_LIBATOMIC)
|
||||
@@ -893,6 +1095,7 @@ function(CONFIGURE_ATOMIC_LIB_IF_NEEDED)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES atomic)
|
||||
check_cxx_source_compiles("${_source}" ATOMIC_OPS_WITH_LIBATOMIC)
|
||||
unset(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
if(ATOMIC_OPS_WITH_LIBATOMIC)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -latomic" PARENT_SCOPE)
|
||||
@@ -905,4 +1108,17 @@ function(CONFIGURE_ATOMIC_LIB_IF_NEEDED)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
CONFIGURE_ATOMIC_LIB_IF_NEEDED()
|
||||
configure_atomic_lib_if_needed()
|
||||
|
||||
if(PLATFORM_BUNDLED_LIBRARIES)
|
||||
# For the installed Python module and installed Blender executable, we set the
|
||||
# rpath to the relative path where the install step will copy the shared libraries.
|
||||
set(CMAKE_SKIP_INSTALL_RPATH FALSE)
|
||||
list(APPEND CMAKE_INSTALL_RPATH $ORIGIN/lib)
|
||||
|
||||
# For executables that are built but not installed (mainly tests) we set an absolute
|
||||
# rpath to the lib folder. This is needed because these can be in different folders,
|
||||
# and because the build and install folder may be different.
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
list(APPEND CMAKE_BUILD_RPATH $ORIGIN/lib ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/lib)
|
||||
endif()
|
||||
|
@@ -26,7 +26,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(OPENMP_FOUND ON)
|
||||
set(OpenMP_C_FLAGS "/clang:-fopenmp")
|
||||
set(OpenMP_CXX_FLAGS "/clang:-fopenmp")
|
||||
GET_FILENAME_COMPONENT(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE)
|
||||
get_filename_component(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE)
|
||||
set(CLANG_OPENMP_DLL "${LLVMROOT}/bin/libomp.dll")
|
||||
set(CLANG_OPENMP_LIB "${LLVMROOT}/lib/libomp.lib")
|
||||
if(NOT EXISTS "${CLANG_OPENMP_DLL}")
|
||||
@@ -74,27 +74,6 @@ add_definitions(-DWIN32)
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
|
||||
# Minimum MSVC Version
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
if(MSVC_VERSION EQUAL 1800)
|
||||
set(_min_ver "18.0.31101")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
|
||||
message(FATAL_ERROR
|
||||
"Visual Studio 2013 (Update 4, ${_min_ver}) required, "
|
||||
"found (${CMAKE_CXX_COMPILER_VERSION})")
|
||||
endif()
|
||||
endif()
|
||||
if(MSVC_VERSION EQUAL 1900)
|
||||
set(_min_ver "19.0.24210")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
|
||||
message(FATAL_ERROR
|
||||
"Visual Studio 2015 (Update 3, ${_min_ver}) required, "
|
||||
"found (${CMAKE_CXX_COMPILER_VERSION})")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
unset(_min_ver)
|
||||
|
||||
# needed for some MSVC installations
|
||||
# 4099 : PDB 'filename' was not found with 'object/library'
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099")
|
||||
@@ -146,7 +125,7 @@ endif()
|
||||
if(WITH_COMPILER_ASAN AND MSVC AND NOT MSVC_CLANG)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28.29828)
|
||||
#set a flag so we don't have to do this comparison all the time
|
||||
SET(MSVC_ASAN ON)
|
||||
set(MSVC_ASAN ON)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /INCREMENTAL:NO")
|
||||
@@ -158,7 +137,7 @@ endif()
|
||||
|
||||
|
||||
# C++ standards conformace (/permissive-) is available on msvc 15.5 (1912) and up
|
||||
if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
|
||||
if(NOT MSVC_CLANG)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /permissive-")
|
||||
# Two-phase name lookup does not place nicely with OpenMP yet, so disable for now
|
||||
string(APPEND CMAKE_CXX_FLAGS " /Zc:twoPhase-")
|
||||
@@ -185,20 +164,20 @@ endif()
|
||||
|
||||
|
||||
if(WITH_WINDOWS_SCCACHE)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER sccache)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER sccache)
|
||||
set(CMAKE_C_COMPILER_LAUNCHER sccache)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER sccache)
|
||||
set(SYMBOL_FORMAT /Z7)
|
||||
set(SYMBOL_FORMAT_RELEASE /Z7)
|
||||
else()
|
||||
unset(CMAKE_C_COMPILER_LAUNCHER)
|
||||
unset(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
if(MSVC_ASAN)
|
||||
set(SYMBOL_FORMAT /Z7)
|
||||
set(SYMBOL_FORMAT_RELEASE /Z7)
|
||||
else()
|
||||
unset(CMAKE_C_COMPILER_LAUNCHER)
|
||||
unset(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
if(MSVC_ASAN)
|
||||
set(SYMBOL_FORMAT /Z7)
|
||||
set(SYMBOL_FORMAT_RELEASE /Z7)
|
||||
else()
|
||||
set(SYMBOL_FORMAT /ZI)
|
||||
set(SYMBOL_FORMAT_RELEASE /Zi)
|
||||
endif()
|
||||
else()
|
||||
set(SYMBOL_FORMAT /ZI)
|
||||
set(SYMBOL_FORMAT_RELEASE /Zi)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_WINDOWS_PDB)
|
||||
@@ -218,7 +197,7 @@ unset(SYMBOL_FORMAT)
|
||||
unset(SYMBOL_FORMAT_RELEASE)
|
||||
|
||||
# JMC is available on msvc 15.8 (1915) and up
|
||||
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
|
||||
if(NOT MSVC_CLANG)
|
||||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /JMC")
|
||||
endif()
|
||||
|
||||
@@ -251,9 +230,6 @@ if(NOT DEFINED LIBDIR)
|
||||
elseif(MSVC_VERSION GREATER 1919)
|
||||
message(STATUS "Visual Studio 2019 detected.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
||||
elseif(MSVC_VERSION GREATER 1909)
|
||||
message(STATUS "Visual Studio 2017 detected.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
|
||||
@@ -264,10 +240,8 @@ endif()
|
||||
|
||||
include(platform_old_libs_update)
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE
|
||||
MSVC_VERSION GREATER_EQUAL 1924 AND # Supported for 16.4+
|
||||
WITH_CLANG_TIDY # And Clang Tidy needs to be on
|
||||
)
|
||||
# Only supported in the VS IDE & Clang Tidy needs to be on.
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND WITH_CLANG_TIDY)
|
||||
set(CMAKE_VS_GLOBALS
|
||||
"RunCodeAnalysis=false"
|
||||
"EnableMicrosoftCodeAnalysis=false"
|
||||
@@ -278,8 +252,7 @@ endif()
|
||||
|
||||
# Mark libdir as system headers with a lower warn level, to resolve some warnings
|
||||
# that we have very little control over
|
||||
if(MSVC_VERSION GREATER_EQUAL 1914 AND # Available with 15.7+
|
||||
NOT MSVC_CLANG AND # But not for clang
|
||||
if(NOT MSVC_CLANG AND # Available with MSVC 15.7+ but not for CLANG.
|
||||
NOT WITH_WINDOWS_SCCACHE AND # And not when sccache is enabled
|
||||
NOT VS_CLANG_TIDY) # Clang-tidy does not like these options
|
||||
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
|
||||
@@ -323,6 +296,13 @@ if(NOT JPEG_FOUND)
|
||||
set(JPEG_LIBRARIES ${LIBDIR}/jpeg/lib/libjpeg.lib)
|
||||
endif()
|
||||
|
||||
set(EPOXY_ROOT_DIR ${LIBDIR}/epoxy)
|
||||
windows_find_package(Epoxy REQUIRED)
|
||||
if(NOT EPOXY_FOUND)
|
||||
set(Epoxy_INCLUDE_DIRS ${LIBDIR}/epoxy/include)
|
||||
set(Epoxy_LIBRARIES ${LIBDIR}/epoxy/lib/epoxy.lib)
|
||||
endif()
|
||||
|
||||
set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
|
||||
set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC3.lib)
|
||||
|
||||
@@ -416,7 +396,7 @@ if(WITH_CODEC_FFMPEG)
|
||||
${LIBDIR}/ffmpeg/lib/avdevice.lib
|
||||
${LIBDIR}/ffmpeg/lib/avutil.lib
|
||||
${LIBDIR}/ffmpeg/lib/swscale.lib
|
||||
)
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -497,12 +477,16 @@ if(WITH_JACK)
|
||||
endif()
|
||||
|
||||
if(WITH_PYTHON)
|
||||
set(PYTHON_VERSION 3.10) # CACHE STRING)
|
||||
# Cache version for make_bpy_wheel.py to detect.
|
||||
unset(PYTHON_VERSION CACHE)
|
||||
set(PYTHON_VERSION "3.10" CACHE STRING "Python version")
|
||||
|
||||
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||
set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)
|
||||
set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
|
||||
|
||||
set(PYTHON_EXECUTABLE ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python$<$<CONFIG:Debug>:_d>.exe)
|
||||
|
||||
set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include)
|
||||
set(NUMPY_FOUND ON)
|
||||
@@ -565,12 +549,14 @@ if(WITH_BOOST)
|
||||
if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
|
||||
optimized ${BOOST_LIBPATH}/libboost_wave-${BOOST_POSTFIX}
|
||||
debug ${BOOST_LIBPATH}/libboost_wave-${BOOST_DEBUG_POSTFIX})
|
||||
debug ${BOOST_LIBPATH}/libboost_wave-${BOOST_DEBUG_POSTFIX}
|
||||
)
|
||||
endif()
|
||||
if(WITH_INTERNATIONAL)
|
||||
set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
|
||||
optimized ${BOOST_LIBPATH}/libboost_locale-${BOOST_POSTFIX}
|
||||
debug ${BOOST_LIBPATH}/libboost_locale-${BOOST_DEBUG_POSTFIX})
|
||||
debug ${BOOST_LIBPATH}/libboost_locale-${BOOST_DEBUG_POSTFIX}
|
||||
)
|
||||
endif()
|
||||
else() # we found boost using find_package
|
||||
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
|
||||
@@ -677,7 +663,8 @@ if(WITH_OPENIMAGEDENOISE)
|
||||
optimized ${OPENIMAGEDENOISE_LIBPATH}/dnnl.lib
|
||||
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib
|
||||
debug ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib
|
||||
debug ${OPENIMAGEDENOISE_LIBPATH}/dnnl_d.lib)
|
||||
debug ${OPENIMAGEDENOISE_LIBPATH}/dnnl_d.lib
|
||||
)
|
||||
set(OPENIMAGEDENOISE_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
@@ -753,7 +740,7 @@ if(WITH_TBB)
|
||||
endif()
|
||||
|
||||
# used in many places so include globally, like OpenGL
|
||||
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
|
||||
include_directories(SYSTEM "${PTHREADS_INCLUDE_DIRS}")
|
||||
|
||||
set(WINTAB_INC ${LIBDIR}/wintab/include)
|
||||
|
||||
@@ -832,7 +819,8 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||
debug ${LIBDIR}/embree/lib/math_d.lib
|
||||
debug ${LIBDIR}/embree/lib/simd_d.lib
|
||||
debug ${LIBDIR}/embree/lib/sys_d.lib
|
||||
debug ${LIBDIR}/embree/lib/tasking_d.lib)
|
||||
debug ${LIBDIR}/embree/lib/tasking_d.lib
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -859,8 +847,8 @@ endif()
|
||||
|
||||
if(WINDOWS_PYTHON_DEBUG)
|
||||
# Include the system scripts in the blender_python_system_scripts project.
|
||||
FILE(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
|
||||
ADD_CUSTOM_TARGET(blender_python_system_scripts SOURCES ${inFiles})
|
||||
file(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
|
||||
add_custom_target(blender_python_system_scripts SOURCES ${inFiles})
|
||||
foreach(_source IN ITEMS ${inFiles})
|
||||
get_filename_component(_source_path "${_source}" PATH)
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}")
|
||||
@@ -880,8 +868,8 @@ if(WINDOWS_PYTHON_DEBUG)
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
|
||||
FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
|
||||
ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
|
||||
file(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" )
|
||||
add_custom_target(blender_python_user_scripts SOURCES ${inFiles})
|
||||
foreach(_source IN ITEMS ${inFiles})
|
||||
get_filename_component(_source_path "${_source}" PATH)
|
||||
string(REPLACE "${USER_SCRIPTS_ROOT}" "" _source_path "${_source_path}")
|
||||
@@ -948,5 +936,33 @@ if(WITH_HARU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_PATH_GUIDING)
|
||||
find_package(openpgl QUIET)
|
||||
if(openpgl_FOUND)
|
||||
get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE)
|
||||
get_target_property(OPENPGL_LIBRARIES_DEBUG openpgl::openpgl LOCATION_DEBUG)
|
||||
set(OPENPGL_LIBRARIES optimized ${OPENPGL_LIBRARIES_RELEASE} debug ${OPENPGL_LIBRARIES_DEBUG})
|
||||
get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
|
||||
else()
|
||||
set(WITH_CYCLES_PATH_GUIDING OFF)
|
||||
message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
|
||||
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
|
||||
|
||||
if(WITH_CYCLES_DEVICE_ONEAPI)
|
||||
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
|
||||
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
|
||||
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
|
||||
set(SYCL_ROOT_DIR ${CYCLES_SYCL})
|
||||
endif()
|
||||
file(GLOB _sycl_runtime_libraries
|
||||
${SYCL_ROOT_DIR}/bin/sycl.dll
|
||||
${SYCL_ROOT_DIR}/bin/sycl[0-9].dll
|
||||
${SYCL_ROOT_DIR}/bin/pi_level_zero.dll
|
||||
)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
|
||||
unset(_sycl_runtime_libraries)
|
||||
endif()
|
||||
|
@@ -3,20 +3,22 @@
|
||||
# First generate the manifest for tests since it will not need the dependency on the CRT.
|
||||
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY)
|
||||
|
||||
# Always detect system libraries, since they are also used by oneAPI.
|
||||
# But don't always install them, only for WITH_WINDOWS_BUNDLE_CRT=ON.
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
||||
|
||||
# This sometimes can change when updates are installed and the compiler version
|
||||
# changes, so test if it exists and if not, give InstallRequiredSystemLibraries
|
||||
# another chance to figure out the path.
|
||||
if(MSVC_REDIST_DIR AND NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||
unset(MSVC_REDIST_DIR CACHE)
|
||||
endif()
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
if(WITH_WINDOWS_BUNDLE_CRT)
|
||||
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
|
||||
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
|
||||
|
||||
# This sometimes can change when updates are installed and the compiler version
|
||||
# changes, so test if it exists and if not, give InstallRequiredSystemLibraries
|
||||
# another chance to figure out the path.
|
||||
if(MSVC_REDIST_DIR AND NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||
unset(MSVC_REDIST_DIR CACHE)
|
||||
endif()
|
||||
|
||||
include(InstallRequiredSystemLibraries)
|
||||
|
||||
# ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles
|
||||
# redirects for this dll, for details see T88813.
|
||||
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
|
||||
|
@@ -30,6 +30,8 @@ from typing import (
|
||||
cast,
|
||||
)
|
||||
|
||||
import shlex
|
||||
|
||||
|
||||
SOURCE_DIR = join(dirname(__file__), "..", "..")
|
||||
SOURCE_DIR = normpath(SOURCE_DIR)
|
||||
@@ -160,7 +162,7 @@ def build_info(
|
||||
|
||||
for c in compilers:
|
||||
args = args.replace(c, fake_compiler)
|
||||
args = args.split()
|
||||
args = shlex.split(args)
|
||||
# end
|
||||
|
||||
# remove compiler
|
||||
|
@@ -54,6 +54,8 @@ buildbot:
|
||||
version: '10.1.243'
|
||||
cuda11:
|
||||
version: '11.4.1'
|
||||
hip:
|
||||
version: '5.2.21440'
|
||||
optix:
|
||||
version: '7.3.0'
|
||||
cmake:
|
||||
|
222
build_files/utils/make_bpy_wheel.py
Executable file
222
build_files/utils/make_bpy_wheel.py
Executable file
@@ -0,0 +1,222 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
Make Python wheel package (`*.whl`) file from Blender built with 'WITH_PYTHON_MODULE' enabled.
|
||||
|
||||
Example
|
||||
=======
|
||||
|
||||
If the "bpy" module was build on Linux using the command:
|
||||
|
||||
make bpy lite
|
||||
|
||||
The command to package it as a wheel is:
|
||||
|
||||
./build_files/utils/make_bpy_wheel.py ../build_linux_bpy_lite/bin --output-dir=./
|
||||
|
||||
This will create a `*.whl` file in the current directory.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import make_utils
|
||||
import os
|
||||
import re
|
||||
import platform
|
||||
import string
|
||||
import setuptools # type: ignore
|
||||
import sys
|
||||
|
||||
from typing import (
|
||||
Generator,
|
||||
List,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Generic Functions
|
||||
|
||||
def find_dominating_file(
|
||||
path: str,
|
||||
search: Sequence[str],
|
||||
) -> str:
|
||||
while True:
|
||||
for d in search:
|
||||
if os.path.exists(os.path.join(path, d)):
|
||||
return os.path.join(path, d)
|
||||
path_next = os.path.normpath(os.path.join(path, ".."))
|
||||
if path == path_next:
|
||||
break
|
||||
path = path_next
|
||||
return ""
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# CMake Cache Access
|
||||
|
||||
def cmake_cache_var_iter(filepath_cmake_cache: str) -> Generator[Tuple[str, str, str], None, None]:
|
||||
import re
|
||||
re_cache = re.compile(r"([A-Za-z0-9_\-]+)?:?([A-Za-z0-9_\-]+)?=(.*)$")
|
||||
with open(filepath_cmake_cache, "r", encoding="utf-8") as cache_file:
|
||||
for l in cache_file:
|
||||
match = re_cache.match(l.strip())
|
||||
if match is not None:
|
||||
var, type_, val = match.groups()
|
||||
yield (var, type_ or "", val)
|
||||
|
||||
|
||||
def cmake_cache_var(filepath_cmake_cache: str, var: str) -> Optional[str]:
|
||||
for var_iter, type_iter, value_iter in cmake_cache_var_iter(filepath_cmake_cache):
|
||||
if var == var_iter:
|
||||
return value_iter
|
||||
return None
|
||||
|
||||
|
||||
def cmake_cache_var_or_exit(filepath_cmake_cache: str, var: str) -> str:
|
||||
value = cmake_cache_var(filepath_cmake_cache, var)
|
||||
if value is None:
|
||||
sys.stderr.write("Unable to find %r in %r, abort!\n" % (var, filepath_cmake_cache))
|
||||
sys.exit(1)
|
||||
return value
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Argument Parser
|
||||
|
||||
def argparse_create() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
|
||||
parser.add_argument(
|
||||
"install_dir",
|
||||
metavar='INSTALL_DIR',
|
||||
type=str,
|
||||
help="The installation directory containing the \"bpy\" package.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--build-dir",
|
||||
metavar='BUILD_DIR',
|
||||
default=None,
|
||||
help="The build directory containing 'CMakeCache.txt' (search parent directories of INSTALL_DIR when omitted).",
|
||||
required=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output-dir",
|
||||
metavar='OUTPUT_DIR',
|
||||
default=None,
|
||||
help="The destination directory for the '*.whl' file (use INSTALL_DIR when omitted).",
|
||||
required=False,
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Main Function
|
||||
|
||||
def main() -> None:
|
||||
|
||||
# Parse arguments.
|
||||
args = argparse_create().parse_args()
|
||||
|
||||
install_dir = os.path.abspath(args.install_dir)
|
||||
output_dir = os.path.abspath(args.output_dir) if args.output_dir else install_dir
|
||||
|
||||
if args.build_dir:
|
||||
build_dir = os.path.abspath(args.build_dir)
|
||||
filepath_cmake_cache = os.path.join(build_dir, "CMakeCache.txt")
|
||||
del build_dir
|
||||
if not os.path.exists(filepath_cmake_cache):
|
||||
sys.stderr.write("File not found %r, abort!\n" % filepath_cmake_cache)
|
||||
sys.exit(1)
|
||||
else:
|
||||
filepath_cmake_cache = find_dominating_file(install_dir, ("CMakeCache.txt",))
|
||||
if not filepath_cmake_cache:
|
||||
# Should never fail.
|
||||
sys.stderr.write("Unable to find CMakeCache.txt in or above %r, abort!\n" % install_dir)
|
||||
sys.exit(1)
|
||||
|
||||
# Get the major and minor Python version.
|
||||
python_version = cmake_cache_var_or_exit(filepath_cmake_cache, "PYTHON_VERSION")
|
||||
python_version_number = (
|
||||
tuple(int("".join(c for c in digit if c in string.digits)) for digit in python_version.split(".")) +
|
||||
# Support version without a minor version "3" (add zero).
|
||||
tuple((0, 0, 0))
|
||||
)
|
||||
python_version_str = "%d.%d" % python_version_number[:2]
|
||||
|
||||
# Get Blender version.
|
||||
blender_version_str = str(make_utils.parse_blender_version())
|
||||
|
||||
# Set platform tag following conventions.
|
||||
if sys.platform == "darwin":
|
||||
target = cmake_cache_var_or_exit(filepath_cmake_cache, "CMAKE_OSX_DEPLOYMENT_TARGET").split(".")
|
||||
machine = cmake_cache_var_or_exit(filepath_cmake_cache, "CMAKE_OSX_ARCHITECTURES")
|
||||
platform_tag = "macosx_%d_%d_%s" % (int(target[0]), int(target[1]), machine)
|
||||
elif sys.platform == "win32":
|
||||
platform_tag = "win_%s" % (platform.machine().lower())
|
||||
elif sys.platform == "linux":
|
||||
glibc = os.confstr("CS_GNU_LIBC_VERSION")
|
||||
if glibc is None:
|
||||
sys.stderr.write("Unable to find \"CS_GNU_LIBC_VERSION\", abort!\n")
|
||||
sys.exit(1)
|
||||
glibc = "%s_%s" % tuple(glibc.split()[1].split(".")[:2])
|
||||
platform_tag = "manylinux_%s_%s" % (glibc, platform.machine().lower())
|
||||
else:
|
||||
sys.stderr.write("Unsupported platform: %s, abort!\n" % (sys.platform))
|
||||
sys.exit(1)
|
||||
|
||||
os.chdir(install_dir)
|
||||
|
||||
# Include all files recursively.
|
||||
def package_files(root_dir: str) -> List[str]:
|
||||
paths = []
|
||||
for path, dirs, files in os.walk(root_dir):
|
||||
paths += [os.path.join("..", path, f) for f in files]
|
||||
return paths
|
||||
|
||||
# Ensure this wheel is marked platform specific.
|
||||
class BinaryDistribution(setuptools.dist.Distribution): # type: ignore
|
||||
def has_ext_modules(self) -> bool:
|
||||
return True
|
||||
|
||||
# Build wheel.
|
||||
sys.argv = [sys.argv[0], "bdist_wheel"]
|
||||
|
||||
setuptools.setup(
|
||||
name="bpy",
|
||||
version=blender_version_str,
|
||||
install_requires=["cython", "numpy", "requests", "zstandard"],
|
||||
python_requires="==%d.%d.*" % (python_version_number[0], python_version_number[1]),
|
||||
packages=["bpy"],
|
||||
package_data={"": package_files("bpy")},
|
||||
distclass=BinaryDistribution,
|
||||
options={"bdist_wheel": {"plat_name": platform_tag}},
|
||||
|
||||
description="Blender as a Python module",
|
||||
license="GPL-3.0",
|
||||
author="Blender Foundation",
|
||||
author_email="bf-committers@blender.org",
|
||||
url="https://www.blender.org"
|
||||
)
|
||||
|
||||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
# Move wheel to output directory.
|
||||
dist_dir = os.path.join(install_dir, "dist")
|
||||
for f in os.listdir(dist_dir):
|
||||
if f.endswith(".whl"):
|
||||
# No apparent way to override this ABI version with setuptools, so rename.
|
||||
sys_py = "cp%d%d" % (sys.version_info.major, sys.version_info.minor)
|
||||
sys_py_abi = sys_py + sys.abiflags
|
||||
blender_py = "cp%d%d" % (python_version_number[0], python_version_number[1])
|
||||
|
||||
renamed_f = f.replace(sys_py_abi, blender_py).replace(sys_py, blender_py)
|
||||
|
||||
os.rename(os.path.join(dist_dir, f), os.path.join(output_dir, renamed_f))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@@ -2,7 +2,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import argparse
|
||||
import dataclasses
|
||||
import make_utils
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
@@ -19,6 +19,8 @@ from typing import Iterable, TextIO, Optional, Any, Union
|
||||
SKIP_NAMES = {
|
||||
".gitignore",
|
||||
".gitmodules",
|
||||
".gitattributes",
|
||||
".git-blame-ignore-revs",
|
||||
".arcconfig",
|
||||
".svn",
|
||||
}
|
||||
@@ -50,7 +52,7 @@ def main() -> None:
|
||||
|
||||
print(f"Output dir: {curdir}")
|
||||
|
||||
version = parse_blender_version(blender_srcdir)
|
||||
version = make_utils.parse_blender_version()
|
||||
tarball = tarball_path(curdir, version, cli_args)
|
||||
manifest = manifest_path(tarball)
|
||||
packages_dir = packages_path(curdir, cli_args)
|
||||
@@ -62,53 +64,7 @@ def main() -> None:
|
||||
print("Done!")
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class BlenderVersion:
|
||||
version: int # 293 for 2.93.1
|
||||
patch: int # 1 for 2.93.1
|
||||
cycle: str # 'alpha', 'beta', 'release', maybe others.
|
||||
|
||||
@property
|
||||
def is_release(self) -> bool:
|
||||
return self.cycle == "release"
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""Convert to version string.
|
||||
|
||||
>>> str(BlenderVersion(293, 1, "alpha"))
|
||||
'2.93.1-alpha'
|
||||
>>> str(BlenderVersion(327, 0, "release"))
|
||||
'3.27.0'
|
||||
"""
|
||||
version_major = self.version // 100
|
||||
version_minor = self.version % 100
|
||||
as_string = f"{version_major}.{version_minor}.{self.patch}"
|
||||
if self.is_release:
|
||||
return as_string
|
||||
return f"{as_string}-{self.cycle}"
|
||||
|
||||
|
||||
def parse_blender_version(blender_srcdir: Path) -> BlenderVersion:
|
||||
version_path = blender_srcdir / "source/blender/blenkernel/BKE_blender_version.h"
|
||||
|
||||
version_info = {}
|
||||
line_re = re.compile(r"^#define (BLENDER_VERSION[A-Z_]*)\s+([0-9a-z]+)$")
|
||||
|
||||
with version_path.open(encoding="utf-8") as version_file:
|
||||
for line in version_file:
|
||||
match = line_re.match(line.strip())
|
||||
if not match:
|
||||
continue
|
||||
version_info[match.group(1)] = match.group(2)
|
||||
|
||||
return BlenderVersion(
|
||||
int(version_info["BLENDER_VERSION"]),
|
||||
int(version_info["BLENDER_VERSION_PATCH"]),
|
||||
version_info["BLENDER_VERSION_CYCLE"],
|
||||
)
|
||||
|
||||
|
||||
def tarball_path(output_dir: Path, version: BlenderVersion, cli_args: Any) -> Path:
|
||||
def tarball_path(output_dir: Path, version: make_utils.BlenderVersion, cli_args: Any) -> Path:
|
||||
extra = ""
|
||||
if cli_args.include_packages:
|
||||
extra = "-with-libraries"
|
||||
@@ -148,7 +104,7 @@ def packages_path(current_directory: Path, cli_args: Any) -> Optional[Path]:
|
||||
|
||||
|
||||
def create_manifest(
|
||||
version: BlenderVersion,
|
||||
version: make_utils.BlenderVersion,
|
||||
outpath: Path,
|
||||
blender_srcdir: Path,
|
||||
packages_dir: Optional[Path],
|
||||
@@ -170,9 +126,9 @@ def main_files_to_manifest(blender_srcdir: Path, outfile: TextIO) -> None:
|
||||
|
||||
|
||||
def submodules_to_manifest(
|
||||
blender_srcdir: Path, version: BlenderVersion, outfile: TextIO
|
||||
blender_srcdir: Path, version: make_utils.BlenderVersion, outfile: TextIO
|
||||
) -> None:
|
||||
skip_addon_contrib = version.is_release
|
||||
skip_addon_contrib = version.is_release()
|
||||
assert not blender_srcdir.is_absolute()
|
||||
|
||||
for line in git_command("-C", blender_srcdir, "submodule"):
|
||||
@@ -200,7 +156,11 @@ def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None:
|
||||
|
||||
|
||||
def create_tarball(
|
||||
version: BlenderVersion, tarball: Path, manifest: Path, blender_srcdir: Path, packages_dir: Optional[Path]
|
||||
version: make_utils.BlenderVersion,
|
||||
tarball: Path,
|
||||
manifest: Path,
|
||||
blender_srcdir: Path,
|
||||
packages_dir: Optional[Path],
|
||||
) -> None:
|
||||
print(f'Creating archive: "{tarball}" ...', end="", flush=True)
|
||||
command = ["tar"]
|
||||
|
@@ -110,6 +110,9 @@ def svn_update(args, release_version):
|
||||
if not make_utils.command_missing(args.svn_command):
|
||||
call(svn_non_interactive + ["cleanup", lib_dirpath])
|
||||
continue
|
||||
elif dirname.startswith("."):
|
||||
# Temporary paths such as ".mypy_cache" will report a warning, skip hidden directories.
|
||||
continue
|
||||
|
||||
svn_dirpath = os.path.join(dirpath, ".svn")
|
||||
svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
|
||||
|
@@ -9,9 +9,15 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from typing import (
|
||||
Sequence,
|
||||
Optional,
|
||||
)
|
||||
|
||||
|
||||
def call(cmd, exit_on_error=True, silent=False):
|
||||
def call(cmd: Sequence[str], exit_on_error: bool = True, silent: bool = False) -> int:
|
||||
if not silent:
|
||||
print(" ".join(cmd))
|
||||
|
||||
@@ -29,7 +35,7 @@ def call(cmd, exit_on_error=True, silent=False):
|
||||
return retcode
|
||||
|
||||
|
||||
def check_output(cmd, exit_on_error=True):
|
||||
def check_output(cmd: Sequence[str], exit_on_error: bool = True) -> str:
|
||||
# Flush to ensure correct order output on Windows.
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
@@ -46,14 +52,14 @@ def check_output(cmd, exit_on_error=True):
|
||||
return output.strip()
|
||||
|
||||
|
||||
def git_branch_exists(git_command, branch):
|
||||
def git_branch_exists(git_command: str, branch: str) -> bool:
|
||||
return (
|
||||
call([git_command, "rev-parse", "--verify", branch], exit_on_error=False, silent=True) == 0 or
|
||||
call([git_command, "rev-parse", "--verify", "remotes/origin/" + branch], exit_on_error=False, silent=True) == 0
|
||||
)
|
||||
|
||||
|
||||
def git_branch(git_command):
|
||||
def git_branch(git_command: str) -> str:
|
||||
# Get current branch name.
|
||||
try:
|
||||
branch = subprocess.check_output([git_command, "rev-parse", "--abbrev-ref", "HEAD"])
|
||||
@@ -64,7 +70,7 @@ def git_branch(git_command):
|
||||
return branch.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_tag(git_command):
|
||||
def git_tag(git_command: str) -> Optional[str]:
|
||||
# Get current tag name.
|
||||
try:
|
||||
tag = subprocess.check_output([git_command, "describe", "--exact-match"], stderr=subprocess.STDOUT)
|
||||
@@ -74,18 +80,19 @@ def git_tag(git_command):
|
||||
return tag.strip().decode('utf8')
|
||||
|
||||
|
||||
def git_branch_release_version(branch, tag):
|
||||
release_version = re.search("^blender-v(.*)-release$", branch)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
def git_branch_release_version(branch: str, tag: str) -> Optional[str]:
|
||||
re_match = re.search("^blender-v(.*)-release$", branch)
|
||||
release_version = None
|
||||
if re_match:
|
||||
release_version = re_match.group(1)
|
||||
elif tag:
|
||||
release_version = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
|
||||
if release_version:
|
||||
release_version = release_version.group(1)
|
||||
re_match = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
|
||||
if re_match:
|
||||
release_version = re_match.group(1)
|
||||
return release_version
|
||||
|
||||
|
||||
def svn_libraries_base_url(release_version, branch=None):
|
||||
def svn_libraries_base_url(release_version: Optional[str], branch: Optional[str] = None) -> str:
|
||||
if release_version:
|
||||
svn_branch = "tags/blender-" + release_version + "-release"
|
||||
elif branch:
|
||||
@@ -95,9 +102,58 @@ def svn_libraries_base_url(release_version, branch=None):
|
||||
return "https://svn.blender.org/svnroot/bf-blender/" + svn_branch + "/lib/"
|
||||
|
||||
|
||||
def command_missing(command):
|
||||
def command_missing(command: str) -> bool:
|
||||
# Support running with Python 2 for macOS
|
||||
if sys.version_info >= (3, 0):
|
||||
return shutil.which(command) is None
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
class BlenderVersion:
|
||||
def __init__(self, version: int, patch: int, cycle: str):
|
||||
# 293 for 2.93.1
|
||||
self.version = version
|
||||
# 1 for 2.93.1
|
||||
self.patch = patch
|
||||
# 'alpha', 'beta', 'release', maybe others.
|
||||
self.cycle = cycle
|
||||
|
||||
def is_release(self) -> bool:
|
||||
return self.cycle == "release"
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""Convert to version string.
|
||||
|
||||
>>> str(BlenderVersion(293, 1, "alpha"))
|
||||
'2.93.1-alpha'
|
||||
>>> str(BlenderVersion(327, 0, "release"))
|
||||
'3.27.0'
|
||||
"""
|
||||
version_major = self.version // 100
|
||||
version_minor = self.version % 100
|
||||
as_string = f"{version_major}.{version_minor}.{self.patch}"
|
||||
if self.is_release():
|
||||
return as_string
|
||||
return f"{as_string}-{self.cycle}"
|
||||
|
||||
|
||||
def parse_blender_version() -> BlenderVersion:
|
||||
blender_srcdir = Path(__file__).absolute().parent.parent.parent
|
||||
version_path = blender_srcdir / "source/blender/blenkernel/BKE_blender_version.h"
|
||||
|
||||
version_info = {}
|
||||
line_re = re.compile(r"^#define (BLENDER_VERSION[A-Z_]*)\s+([0-9a-z]+)$")
|
||||
|
||||
with version_path.open(encoding="utf-8") as version_file:
|
||||
for line in version_file:
|
||||
match = line_re.match(line.strip())
|
||||
if not match:
|
||||
continue
|
||||
version_info[match.group(1)] = match.group(2)
|
||||
|
||||
return BlenderVersion(
|
||||
int(version_info["BLENDER_VERSION"]),
|
||||
int(version_info["BLENDER_VERSION_PATCH"]),
|
||||
version_info["BLENDER_VERSION_CYCLE"],
|
||||
)
|
||||
|
@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = V3.3
|
||||
PROJECT_NUMBER = V3.4
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
@@ -139,7 +139,7 @@ https://www.blender.org''')
|
||||
|
||||
l = lines.pop(0)
|
||||
if l:
|
||||
assert(l.startswith('\t'))
|
||||
assert l.startswith('\t')
|
||||
l = l[1:] # Remove first white-space (tab).
|
||||
|
||||
fh.write('%s\n' % man_format(l))
|
||||
|
@@ -6,6 +6,10 @@ It can be useful to perform an action when a property is changed and can be
|
||||
used to update other properties or synchronize with external data.
|
||||
|
||||
All properties define update functions except for CollectionProperty.
|
||||
|
||||
.. warning::
|
||||
Remember that these callbacks may be executed in threaded context.
|
||||
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
@@ -6,6 +6,10 @@ Getter/setter functions can be used for boolean, int, float, string and enum pro
|
||||
If these callbacks are defined the property will not be stored in the ID properties
|
||||
automatically. Instead, the `get` and `set` functions will be called when the property
|
||||
is respectively read or written from the API.
|
||||
|
||||
.. warning::
|
||||
Remember that these callbacks may be executed in threaded context.
|
||||
|
||||
"""
|
||||
import bpy
|
||||
|
||||
|
@@ -7,6 +7,15 @@ Custom properties can be added to any subclass of an :class:`ID`,
|
||||
|
||||
These properties can be animated, accessed by the user interface and python
|
||||
like Blender's existing properties.
|
||||
|
||||
.. warning::
|
||||
|
||||
Access to these properties might happen in threaded context, on a per-data-block level.
|
||||
This has to be carefully considered when using accessors or update callbacks.
|
||||
|
||||
Typically, these callbacks should not affect any other data that the one owned by their data-block.
|
||||
When accessing external non-Blender data, thread safety mechanisms should be considered.
|
||||
|
||||
"""
|
||||
|
||||
import bpy
|
||||
|
@@ -3,8 +3,8 @@ Extending the Button Context Menu
|
||||
+++++++++++++++++++++++++++++++++
|
||||
|
||||
This example enables you to insert your own menu entry into the common
|
||||
right click menu that you get while hovering over a value field,
|
||||
color, string, etc.
|
||||
right click menu that you get while hovering over a UI button (e.g. operator,
|
||||
value field, color, string, etc.)
|
||||
|
||||
To make the example work, you have to first select an object
|
||||
then right click on an user interface element (maybe a color in the
|
||||
@@ -14,7 +14,6 @@ Executing the operator will then print all values.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
from bpy.types import Menu
|
||||
|
||||
|
||||
def dump(obj, text):
|
||||
@@ -47,36 +46,20 @@ class WM_OT_button_context_test(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
# This class has to be exactly named like that to insert an entry in the right click menu
|
||||
class WM_MT_button_context(Menu):
|
||||
bl_label = "Unused"
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
|
||||
|
||||
def menu_func(self, context):
|
||||
def draw_menu(self, context):
|
||||
layout = self.layout
|
||||
layout.separator()
|
||||
layout.operator(WM_OT_button_context_test.bl_idname)
|
||||
|
||||
|
||||
classes = (
|
||||
WM_OT_button_context_test,
|
||||
WM_MT_button_context,
|
||||
)
|
||||
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
bpy.types.WM_MT_button_context.append(menu_func)
|
||||
bpy.utils.register_class(WM_OT_button_context_test)
|
||||
bpy.types.UI_MT_button_context_menu.append(draw_menu)
|
||||
|
||||
|
||||
def unregister():
|
||||
for cls in classes:
|
||||
bpy.utils.unregister_class(cls)
|
||||
bpy.types.WM_MT_button_context.remove(menu_func)
|
||||
bpy.types.UI_MT_button_context_menu.remove(draw_menu)
|
||||
bpy.utils.unregister_class(WM_OT_button_context_test)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@@ -1,4 +1,6 @@
|
||||
"""
|
||||
.. _modal_operator:
|
||||
|
||||
Modal Execution
|
||||
+++++++++++++++
|
||||
|
||||
|
@@ -134,7 +134,6 @@ batch = batch_for_shader(shader, 'LINES', {"pos": coords})
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_float("color", (1, 1, 0, 1))
|
||||
batch.draw(shader)
|
||||
|
||||
|
@@ -14,33 +14,36 @@ from random import random
|
||||
from mathutils import Vector
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
|
||||
vertex_shader = '''
|
||||
uniform mat4 u_ViewProjectionMatrix;
|
||||
vert_out = gpu.types.GPUStageInterfaceInfo("my_interface")
|
||||
vert_out.smooth('FLOAT', "v_ArcLength")
|
||||
|
||||
in vec3 position;
|
||||
in float arcLength;
|
||||
shader_info = gpu.types.GPUShaderCreateInfo()
|
||||
shader_info.push_constant('MAT4', "u_ViewProjectionMatrix")
|
||||
shader_info.push_constant('FLOAT', "u_Scale")
|
||||
shader_info.vertex_in(0, 'VEC3', "position")
|
||||
shader_info.vertex_in(1, 'FLOAT', "arcLength")
|
||||
shader_info.vertex_out(vert_out)
|
||||
shader_info.fragment_out(0, 'VEC4', "FragColor")
|
||||
|
||||
out float v_ArcLength;
|
||||
shader_info.vertex_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" v_ArcLength = arcLength;"
|
||||
" gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);"
|
||||
"}"
|
||||
)
|
||||
|
||||
void main()
|
||||
{
|
||||
v_ArcLength = arcLength;
|
||||
gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
|
||||
}
|
||||
'''
|
||||
shader_info.fragment_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;"
|
||||
" FragColor = vec4(1.0);"
|
||||
"}"
|
||||
)
|
||||
|
||||
fragment_shader = '''
|
||||
uniform float u_Scale;
|
||||
|
||||
in float v_ArcLength;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
|
||||
FragColor = vec4(1.0);
|
||||
}
|
||||
'''
|
||||
shader = gpu.shader.create_from_info(shader_info)
|
||||
del vert_out
|
||||
del shader_info
|
||||
|
||||
coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
|
||||
|
||||
@@ -48,7 +51,6 @@ arc_lengths = [0]
|
||||
for a, b in zip(coords[:-1], coords[1:]):
|
||||
arc_lengths.append(arc_lengths[-1] + (a - b).length)
|
||||
|
||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||
batch = batch_for_shader(
|
||||
shader, 'LINE_STRIP',
|
||||
{"position": coords, "arcLength": arc_lengths},
|
||||
@@ -56,7 +58,6 @@ batch = batch_for_shader(
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
matrix = bpy.context.region_data.perspective_matrix
|
||||
shader.uniform_float("u_ViewProjectionMatrix", matrix)
|
||||
shader.uniform_float("u_Scale", 10)
|
||||
|
@@ -6,38 +6,41 @@ import bpy
|
||||
import gpu
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
|
||||
vertex_shader = '''
|
||||
uniform mat4 viewProjectionMatrix;
|
||||
|
||||
in vec3 position;
|
||||
out vec3 pos;
|
||||
vert_out = gpu.types.GPUStageInterfaceInfo("my_interface")
|
||||
vert_out.smooth('VEC3', "pos")
|
||||
|
||||
void main()
|
||||
{
|
||||
pos = position;
|
||||
gl_Position = viewProjectionMatrix * vec4(position, 1.0f);
|
||||
}
|
||||
'''
|
||||
shader_info = gpu.types.GPUShaderCreateInfo()
|
||||
shader_info.push_constant('MAT4', "viewProjectionMatrix")
|
||||
shader_info.push_constant('FLOAT', "brightness")
|
||||
shader_info.vertex_in(0, 'VEC3', "position")
|
||||
shader_info.vertex_out(vert_out)
|
||||
shader_info.fragment_out(0, 'VEC4', "FragColor")
|
||||
|
||||
fragment_shader = '''
|
||||
uniform float brightness;
|
||||
shader_info.vertex_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" pos = position;"
|
||||
" gl_Position = viewProjectionMatrix * vec4(position, 1.0f);"
|
||||
"}"
|
||||
)
|
||||
|
||||
in vec3 pos;
|
||||
out vec4 FragColor;
|
||||
shader_info.fragment_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" FragColor = vec4(pos * brightness, 1.0);"
|
||||
"}"
|
||||
)
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(pos * brightness, 1.0);
|
||||
}
|
||||
'''
|
||||
shader = gpu.shader.create_from_info(shader_info)
|
||||
del vert_out
|
||||
del shader_info
|
||||
|
||||
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
|
||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
matrix = bpy.context.region_data.perspective_matrix
|
||||
shader.uniform_float("viewProjectionMatrix", matrix)
|
||||
shader.uniform_float("brightness", 0.5)
|
||||
|
@@ -22,7 +22,6 @@ batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_float("color", (1, 0, 0, 1))
|
||||
batch.draw(shader)
|
||||
|
||||
|
@@ -18,7 +18,6 @@ batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
|
||||
batch.draw(shader)
|
||||
|
||||
|
@@ -56,7 +56,6 @@ batch = batch_for_shader(
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_sampler("image", texture)
|
||||
batch.draw(shader)
|
||||
|
||||
|
@@ -35,35 +35,37 @@ with offscreen.bind():
|
||||
# Drawing the generated texture in 3D space
|
||||
#############################################
|
||||
|
||||
vertex_shader = '''
|
||||
uniform mat4 modelMatrix;
|
||||
uniform mat4 viewProjectionMatrix;
|
||||
vert_out = gpu.types.GPUStageInterfaceInfo("my_interface")
|
||||
vert_out.smooth('VEC2', "uvInterp")
|
||||
|
||||
in vec2 position;
|
||||
in vec2 uv;
|
||||
shader_info = gpu.types.GPUShaderCreateInfo()
|
||||
shader_info.push_constant('MAT4', "viewProjectionMatrix")
|
||||
shader_info.push_constant('MAT4', "modelMatrix")
|
||||
shader_info.sampler(0, 'FLOAT_2D', "image")
|
||||
shader_info.vertex_in(0, 'VEC2', "position")
|
||||
shader_info.vertex_in(1, 'VEC2', "uv")
|
||||
shader_info.vertex_out(vert_out)
|
||||
shader_info.fragment_out(0, 'VEC4', "FragColor")
|
||||
|
||||
out vec2 uvInterp;
|
||||
shader_info.vertex_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" uvInterp = uv;"
|
||||
" gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);"
|
||||
"}"
|
||||
)
|
||||
|
||||
void main()
|
||||
{
|
||||
uvInterp = uv;
|
||||
gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);
|
||||
}
|
||||
'''
|
||||
shader_info.fragment_source(
|
||||
"void main()"
|
||||
"{"
|
||||
" FragColor = texture(image, uvInterp);"
|
||||
"}"
|
||||
)
|
||||
|
||||
fragment_shader = '''
|
||||
uniform sampler2D image;
|
||||
shader = gpu.shader.create_from_info(shader_info)
|
||||
del vert_out
|
||||
del shader_info
|
||||
|
||||
in vec2 uvInterp;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = texture(image, uvInterp);
|
||||
}
|
||||
'''
|
||||
|
||||
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
|
||||
batch = batch_for_shader(
|
||||
shader, 'TRI_FAN',
|
||||
{
|
||||
@@ -74,7 +76,6 @@ batch = batch_for_shader(
|
||||
|
||||
|
||||
def draw():
|
||||
shader.bind()
|
||||
shader.uniform_float("modelMatrix", Matrix.Translation((1, 2, 3)) @ Matrix.Scale(3, 4))
|
||||
shader.uniform_float("viewProjectionMatrix", bpy.context.region_data.perspective_matrix)
|
||||
shader.uniform_sampler("image", offscreen.texture_color)
|
||||
|
@@ -1,11 +1,11 @@
|
||||
sphinx==5.0.1
|
||||
sphinx==5.1.1
|
||||
|
||||
# Sphinx dependencies that are important
|
||||
Jinja2==3.1.2
|
||||
Pygments==2.12.0
|
||||
Pygments==2.13.0
|
||||
docutils==0.17.1
|
||||
snowballstemmer==2.2.0
|
||||
babel==2.10.1
|
||||
babel==2.10.3
|
||||
requests==2.27.1
|
||||
|
||||
# Only needed to match the theme used for the official documentation.
|
||||
|
@@ -1,7 +1,9 @@
|
||||
:tocdepth: 2
|
||||
|
||||
Blender API Change Log
|
||||
**********************
|
||||
Change Log
|
||||
**********
|
||||
|
||||
Changes in Blender's Python API between releases.
|
||||
|
||||
.. note, this document is auto generated by sphinx_changelog_gen.py
|
||||
|
||||
|
15
doc/python_api/rst/info_advanced.rst
Normal file
15
doc/python_api/rst/info_advanced.rst
Normal file
@@ -0,0 +1,15 @@
|
||||
.. _info_advanced-index:
|
||||
|
||||
********
|
||||
Advanced
|
||||
********
|
||||
|
||||
This chapter covers advanced use (topics which may not be required for typical usage).
|
||||
|
||||
.. NOTE(@campbellbarton): Blender-as-a-Python-module is too obscure a topic to list directly on the main-page,
|
||||
so opt for an "Advanced" page which can be expanded on as needed.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
info_advanced_blender_as_bpy.rst
|
126
doc/python_api/rst/info_advanced_blender_as_bpy.rst
Normal file
126
doc/python_api/rst/info_advanced_blender_as_bpy.rst
Normal file
@@ -0,0 +1,126 @@
|
||||
|
||||
**************************
|
||||
Blender as a Python Module
|
||||
**************************
|
||||
|
||||
Blender supports being built as a Python module,
|
||||
allowing ``import bpy`` to be added to any Python script, providing access to Blender's features.
|
||||
|
||||
.. note::
|
||||
|
||||
At time of writing official builds are not available,
|
||||
using this requires compiling Blender yourself see
|
||||
`build instructions <https://wiki.blender.org/w/index.php?title=Building_Blender/Other/BlenderAsPyModule>`__.
|
||||
|
||||
|
||||
Use Cases
|
||||
=========
|
||||
|
||||
Python developers may wish to integrate Blender scripts which don't center around Blender.
|
||||
|
||||
Possible uses include:
|
||||
|
||||
- Visualizing data by rendering images and animations.
|
||||
- Image processing using Blender's compositor.
|
||||
- Video editing (using Blender's sequencer).
|
||||
- 3D file conversion.
|
||||
- Development, accessing ``bpy`` from Python IDE's and debugging tools for example.
|
||||
- Automation.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
For the most part using Blender as a Python module is equivalent to running a script in background-mode
|
||||
(passing the command-line arguments ``--background`` or ``-b``),
|
||||
however there are some differences to be aware of.
|
||||
|
||||
.. Sorted alphabetically as there isn't an especially a logical order to show them.
|
||||
|
||||
Blender's Executable Access
|
||||
The attribute :class:`bpy.app.binary_path` defaults to an empty string.
|
||||
|
||||
If you wish to point this to the location of a known executable you may set the value.
|
||||
|
||||
This example searches for the binary, setting it when found:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import bpy
|
||||
import shutil
|
||||
|
||||
blender_bin = shutil.which("blender")
|
||||
if blender_bin:
|
||||
print("Found:", blender_bin)
|
||||
bpy.app.binary_path = blender_bin
|
||||
else:
|
||||
print("Unable to find blender!")
|
||||
|
||||
Blender's Internal Modules
|
||||
There are many modules included with Blender such as :mod:`gpu` and :mod:`mathuils`.
|
||||
It's important that these are imported after ``bpy`` or they will not be found.
|
||||
|
||||
Command Line Arguments Unsupported
|
||||
Functionality controlled by command line arguments (shown by calling ``blender --help`` aren't accessible).
|
||||
|
||||
Typically this isn't such a limitation although there are some command line arguments that don't have
|
||||
equivalents in Blender's Python API (``--threads`` and ``--log`` for example).
|
||||
|
||||
.. note::
|
||||
|
||||
Access to these settings may be added in the future as needed.
|
||||
|
||||
Resource Sharing (GPU)
|
||||
It's possible other Python modules make use of the GPU in a way that prevents Blender/Cycles from accessing the GPU.
|
||||
|
||||
Signal Handlers
|
||||
Blender's typical signal handlers are not initialized, so there is no special handling for ``Control-C``
|
||||
to cancel a render and a crash log is not written in the event of a crash.
|
||||
|
||||
Startup and Preferences
|
||||
When the ``bpy`` module loads it contains the default startup scene
|
||||
(instead of an "empty" blend-file as you might expect), so there is a default cube, camera and light.
|
||||
|
||||
If you wish to start from an empty file use: ``bpy.ops.wm.read_factory_settings(use_empty=True)``.
|
||||
|
||||
The users startup and preferences are ignored to prevent your local configuration from impacting scripts behavior.
|
||||
The Python module behaves as if ``--factory-startup`` was passed as a command line argument.
|
||||
|
||||
The users preferences and startup can be loaded using operators:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import bpy
|
||||
|
||||
bpy.ops.wm.read_userpref()
|
||||
bpy.ops.wm.read_homefile()
|
||||
|
||||
|
||||
Limitations
|
||||
===========
|
||||
|
||||
Most constraints of Blender as an application still apply:
|
||||
|
||||
Reloading Unsupported
|
||||
Reloading the ``bpy`` module via ``importlib.reload`` will raise an exception
|
||||
instead of reloading and resetting the module.
|
||||
|
||||
Instead, the operator ``bpy.ops.wm.read_factory_settings()`` can be used to reset the internal state.
|
||||
|
||||
Single Blend File Restriction
|
||||
Only a single ``.blend`` file can be edited at a time.
|
||||
|
||||
.. hint::
|
||||
|
||||
As with the application it's possible to start multiple instances,
|
||||
each with their own ``bpy`` and therefor Blender state.
|
||||
Python provides the ``multiprocessing`` module to make communicating with sub-processes more convenient.
|
||||
|
||||
In some cases the library API may be an alternative to starting separate processes,
|
||||
although this API operates on reading and writing ID data-blocks and isn't
|
||||
a complete substitute for loading ``.blend`` files, see:
|
||||
|
||||
- :meth:`bpy.types.BlendDataLibraries.load`
|
||||
- :meth:`bpy.types.BlendDataLibraries.write`
|
||||
- :meth:`bpy.types.BlendData.temp_data`
|
||||
supports a temporary data-context to avoid manipulating the current ``.blend`` file.
|
@@ -1,6 +1,6 @@
|
||||
|
||||
*******************
|
||||
Reference API Usage
|
||||
API Reference Usage
|
||||
*******************
|
||||
|
||||
Blender has many interlinking data types which have an auto-generated reference API which often has the information
|
||||
|
@@ -86,7 +86,8 @@ No updates after setting values
|
||||
Sometimes you want to modify values from Python and immediately access the updated values, e.g:
|
||||
Once changing the objects :class:`bpy.types.Object.location`
|
||||
you may want to access its transformation right after from :class:`bpy.types.Object.matrix_world`,
|
||||
but this doesn't work as you might expect.
|
||||
but this doesn't work as you might expect. There are similar issues with changes to the UI, that
|
||||
are covered in the next section.
|
||||
|
||||
Consider the calculations that might contribute to the object's final transformation, this includes:
|
||||
|
||||
@@ -110,6 +111,35 @@ Now all dependent data (child objects, modifiers, drivers, etc.)
|
||||
have been recalculated and are available to the script within the active view layer.
|
||||
|
||||
|
||||
No updates after changing UI context
|
||||
------------------------------------
|
||||
|
||||
Similar to the previous issue, some changes to the UI may also not have an immediate effect. For example, setting
|
||||
:class:`bpy.types.Window.workspace` doesn't seem to cause an observable effect in the immediately following code
|
||||
(:class:`bpy.types.Window.workspace` is still the same), but the UI will in fact reflect the change. Some of the
|
||||
properties that behave that way are:
|
||||
|
||||
- :class:`bpy.types.Window.workspace`
|
||||
- :class:`bpy.types.Window.screen`
|
||||
- :class:`bpy.types.Window.scene`
|
||||
- :class:`bpy.types.Area.type`
|
||||
- :class:`bpy.types.Area.uitype`
|
||||
|
||||
Such changes impact the UI, and with that the context (:class:`bpy.context`) quite drastically. This can break
|
||||
Blender's context management. So Blender delays this change until after operators have run and just before the UI is
|
||||
redrawn, making sure that context can be changed safely.
|
||||
|
||||
If you rely on executing code with an updated context this can be worked around by executing the code in a delayed
|
||||
fashion as well. Possible options include:
|
||||
|
||||
- :ref:`Modal Operator <modal_operator>`.
|
||||
- :class:`bpy.app.handlers`.
|
||||
- :class:`bpy.app.timer`.
|
||||
|
||||
It's also possible to depend on drawing callbacks although these should generally be avoided as failure to draw a
|
||||
hidden panel, region, cursor, etc. could cause your script to be unreliable
|
||||
|
||||
|
||||
Can I redraw during script execution?
|
||||
-------------------------------------
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
.. _info_overview:
|
||||
|
||||
*******************
|
||||
Python API Overview
|
||||
*******************
|
||||
************
|
||||
API Overview
|
||||
************
|
||||
|
||||
The purpose of this document is to explain how Python and Blender fit together,
|
||||
covering some of the functionality that may not be obvious from reading the API references
|
||||
|
@@ -241,9 +241,9 @@ def main():
|
||||
comment_washed = []
|
||||
comment = [] if comment is None else comment
|
||||
for i, l in enumerate(comment):
|
||||
assert((l.strip() == "") or
|
||||
(l in {"/*", " *"}) or
|
||||
(l.startswith(("/* ", " * "))))
|
||||
assert ((l.strip() == "") or
|
||||
(l in {"/*", " *"}) or
|
||||
(l.startswith(("/* ", " * "))))
|
||||
|
||||
l = l[3:]
|
||||
if i == 0 and not l.strip():
|
||||
@@ -270,7 +270,7 @@ def main():
|
||||
tp_sub = None
|
||||
else:
|
||||
print(arg)
|
||||
assert(0)
|
||||
assert 0
|
||||
|
||||
tp_str = ""
|
||||
|
||||
@@ -315,7 +315,7 @@ def main():
|
||||
tp_str += " or any sequence of 3 floats"
|
||||
elif tp == BMO_OP_SLOT_PTR:
|
||||
tp_str = "dict"
|
||||
assert(tp_sub is not None)
|
||||
assert tp_sub is not None
|
||||
if tp_sub == BMO_OP_SLOT_SUBTYPE_PTR_BMESH:
|
||||
tp_str = ":class:`bmesh.types.BMesh`"
|
||||
elif tp_sub == BMO_OP_SLOT_SUBTYPE_PTR_SCENE:
|
||||
@@ -330,10 +330,10 @@ def main():
|
||||
tp_str = ":class:`bpy.types.bpy_struct`"
|
||||
else:
|
||||
print("Can't find", vars_dict_reverse[tp_sub])
|
||||
assert(0)
|
||||
assert 0
|
||||
|
||||
elif tp == BMO_OP_SLOT_ELEMENT_BUF:
|
||||
assert(tp_sub is not None)
|
||||
assert tp_sub is not None
|
||||
|
||||
ls = []
|
||||
if tp_sub & BM_VERT:
|
||||
@@ -342,7 +342,7 @@ def main():
|
||||
ls.append(":class:`bmesh.types.BMEdge`")
|
||||
if tp_sub & BM_FACE:
|
||||
ls.append(":class:`bmesh.types.BMFace`")
|
||||
assert(ls) # must be at least one
|
||||
assert ls # Must be at least one.
|
||||
|
||||
if tp_sub & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE:
|
||||
tp_str = "/".join(ls)
|
||||
@@ -367,10 +367,10 @@ def main():
|
||||
tp_str += "unknown internal data, not compatible with python"
|
||||
else:
|
||||
print("Can't find", vars_dict_reverse[tp_sub])
|
||||
assert(0)
|
||||
assert 0
|
||||
else:
|
||||
print("Can't find", vars_dict_reverse[tp])
|
||||
assert(0)
|
||||
assert 0
|
||||
|
||||
args_wash.append((name, tp_str, comment))
|
||||
return args_wash
|
||||
@@ -394,7 +394,7 @@ def main():
|
||||
fw(" :return:\n\n")
|
||||
|
||||
for (name, tp, comment) in args_out_wash:
|
||||
assert(name.endswith(".out"))
|
||||
assert name.endswith(".out")
|
||||
name = name[:-4]
|
||||
fw(" - ``%s``: %s\n\n" % (name, comment))
|
||||
fw(" **type** %s\n" % tp)
|
||||
|
@@ -1,59 +1,111 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
Dump the python API into a text file so we can generate changelogs.
|
||||
---------------
|
||||
|
||||
output from this tool should be added into "doc/python_api/rst/change_log.rst"
|
||||
Dump the python API into a JSON file, or generate changelogs from those JSON API dumps.
|
||||
|
||||
# dump api blender_version.py in CWD
|
||||
blender --background --python doc/python_api/sphinx_changelog_gen.py -- --dump
|
||||
Typically, changelog output from this tool should be added into "doc/python_api/rst/change_log.rst"
|
||||
|
||||
# create changelog
|
||||
API dump files are saved together with the generated API doc on the server, with a general index file.
|
||||
This way the changelog generation simply needs to re-download the previous version's dump for the diffing process.
|
||||
|
||||
---------------
|
||||
|
||||
# Dump api blender_version.json in CWD:
|
||||
blender --background --factory-startup --python doc/python_api/sphinx_changelog_gen.py -- \
|
||||
--indexpath="path/to/api/docs/api_dump_index.json" \
|
||||
dump --filepath-out="path/to/api/docs/<version>/api_dump.json"
|
||||
|
||||
# Create changelog:
|
||||
blender --background --factory-startup --python doc/python_api/sphinx_changelog_gen.py -- \
|
||||
--api_from blender_2_63_0.py \
|
||||
--api_to blender_2_64_0.py \
|
||||
--api_out changes.rst
|
||||
--indexpath="path/to/api/docs/api_dump_index.json" \
|
||||
changelog --filepath-out doc/python_api/rst/change_log.rst
|
||||
|
||||
|
||||
# Api comparison can also run without blender
|
||||
# Api comparison can also run without blender,
|
||||
# will by default generate changeloig between the last two available versions listed in the index,
|
||||
# unless input files are provided explicitely:
|
||||
python doc/python_api/sphinx_changelog_gen.py -- \
|
||||
--api_from blender_api_2_63_0.py \
|
||||
--api_to blender_api_2_64_0.py \
|
||||
--api_out changes.rst
|
||||
--indexpath="path/to/api/docs/api_dump_index.json" \
|
||||
changelog --filepath-in-from blender_api_2_63_0.json \
|
||||
--filepath-in-to blender_api_2_64_0.json \
|
||||
--filepath-out changes.rst
|
||||
|
||||
# Save the latest API dump in this folder, renaming it with its revision.
|
||||
# This way the next person updating it doesn't need to build an old Blender only for that
|
||||
--------------
|
||||
|
||||
API dump index format:
|
||||
|
||||
{[version_main, version_sub]: "<version>/api_dump.json", ...
|
||||
}
|
||||
|
||||
API dump format:
|
||||
|
||||
[
|
||||
[version_main, vserion_sub, version_path],
|
||||
{"module.name":
|
||||
{"parent.class":
|
||||
{"basic_type", "member_name":
|
||||
["Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types]}, ...
|
||||
}, ...
|
||||
}
|
||||
]
|
||||
|
||||
"""
|
||||
|
||||
# format
|
||||
'''
|
||||
{"module.name":
|
||||
{"parent.class":
|
||||
{"basic_type", "member_name":
|
||||
("Name", type, range, length, default, descr, f_args, f_arg_types, f_ret_types)}, ...
|
||||
}, ...
|
||||
}
|
||||
'''
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
api_names = "basic_type" "name", "type", "range", "length", "default", "descr", "f_args", "f_arg_types", "f_ret_types"
|
||||
|
||||
API_BASIC_TYPE = 0
|
||||
API_F_ARGS = 7
|
||||
|
||||
|
||||
def api_dunp_fname():
|
||||
import bpy
|
||||
return "blender_api_%s.py" % "_".join([str(i) for i in bpy.app.version])
|
||||
def api_version():
|
||||
try:
|
||||
import bpy
|
||||
except:
|
||||
return None, None
|
||||
version = tuple(bpy.app.version[:2])
|
||||
version_key = "%d.%d" % (version[0], version[1])
|
||||
return version, version_key
|
||||
|
||||
|
||||
def api_dump():
|
||||
dump = {}
|
||||
dump_module = dump["bpy.types"] = {}
|
||||
def api_version_previous_in_index(index, version):
|
||||
print("Searching for previous version to %s in %r" % (version, index))
|
||||
version_prev = (version[0], version[1])
|
||||
while True:
|
||||
version_prev = (version_prev[0], version_prev[1] - 1)
|
||||
if version_prev[1] < 0:
|
||||
version_prev = (version_prev[0] - 1, 99)
|
||||
if version_prev[0] < 0:
|
||||
return None, None
|
||||
version_prev_key = "%d.%d" % (version_prev[0], version_prev[1])
|
||||
if version_prev_key in index:
|
||||
print("Found previous version %s: %r" % (version_prev, index[version_prev_key]))
|
||||
return version_prev, version_prev_key
|
||||
|
||||
|
||||
class JSONEncoderAPIDump(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
if o is ...:
|
||||
return "..."
|
||||
if isinstance(o, set):
|
||||
return tuple(o)
|
||||
return json.JSONEncoder.default(self, o)
|
||||
|
||||
|
||||
def api_dump(args):
|
||||
import rna_info
|
||||
import inspect
|
||||
|
||||
version, version_key = api_version()
|
||||
if version is None:
|
||||
raise ValueError("API dumps can only be generated from within Blender.")
|
||||
|
||||
dump = {}
|
||||
dump_module = dump["bpy.types"] = {}
|
||||
|
||||
struct = rna_info.BuildRNAInfo()[0]
|
||||
for struct_id, struct_info in sorted(struct.items()):
|
||||
|
||||
@@ -155,17 +207,25 @@ def api_dump():
|
||||
)
|
||||
del funcs
|
||||
|
||||
import pprint
|
||||
filepath_out = args.filepath_out
|
||||
with open(filepath_out, 'w', encoding='utf-8') as file_handle:
|
||||
json.dump((version, dump), file_handle, cls=JSONEncoderAPIDump)
|
||||
|
||||
filename = api_dunp_fname()
|
||||
filehandle = open(filename, 'w', encoding='utf-8')
|
||||
tot = filehandle.write(pprint.pformat(dump, width=1))
|
||||
filehandle.close()
|
||||
print("%s, %d bytes written" % (filename, tot))
|
||||
indexpath = args.indexpath
|
||||
rootpath = os.path.dirname(indexpath)
|
||||
if os.path.exists(indexpath):
|
||||
with open(indexpath, 'r', encoding='utf-8') as file_handle:
|
||||
index = json.load(file_handle)
|
||||
else:
|
||||
index = {}
|
||||
index[version_key] = os.path.relpath(filepath_out, rootpath)
|
||||
with open(indexpath, 'w', encoding='utf-8') as file_handle:
|
||||
json.dump(index, file_handle)
|
||||
|
||||
print("API version %s dumped into %r, and index %r has been updated" % (version_key, filepath_out, indexpath))
|
||||
|
||||
|
||||
def compare_props(a, b, fuzz=0.75):
|
||||
|
||||
# must be same basic_type, function != property
|
||||
if a[0] != b[0]:
|
||||
return False
|
||||
@@ -180,15 +240,48 @@ def compare_props(a, b, fuzz=0.75):
|
||||
return ((tot / totlen) >= fuzz)
|
||||
|
||||
|
||||
def api_changelog(api_from, api_to, api_out):
|
||||
def api_changelog(args):
|
||||
indexpath = args.indexpath
|
||||
filepath_in_from = args.filepath_in_from
|
||||
filepath_in_to = args.filepath_in_to
|
||||
filepath_out = args.filepath_out
|
||||
|
||||
file_handle = open(api_from, 'r', encoding='utf-8')
|
||||
dict_from = eval(file_handle.read())
|
||||
file_handle.close()
|
||||
rootpath = os.path.dirname(indexpath)
|
||||
|
||||
file_handle = open(api_to, 'r', encoding='utf-8')
|
||||
dict_to = eval(file_handle.read())
|
||||
file_handle.close()
|
||||
version, version_key = api_version()
|
||||
if version is None and (filepath_in_from is None or filepath_in_to is None):
|
||||
raise ValueError("API dumps files must be given when ran outside of Blender.")
|
||||
|
||||
with open(indexpath, 'r', encoding='utf-8') as file_handle:
|
||||
index = json.load(file_handle)
|
||||
|
||||
if filepath_in_to is None:
|
||||
filepath_in_to = index.get(version_key, None)
|
||||
if filepath_in_to is None:
|
||||
raise ValueError("Cannot find API dump file for Blender version " + str(version) + " in index file.")
|
||||
|
||||
print("Found to file: %r" % filepath_in_to)
|
||||
|
||||
if filepath_in_from is None:
|
||||
version_from, version_from_key = api_version_previous_in_index(index, version)
|
||||
if version_from is None:
|
||||
raise ValueError("No previous version of Blender could be found in the index.")
|
||||
filepath_in_from = index.get(version_from_key, None)
|
||||
if filepath_in_from is None:
|
||||
raise ValueError(
|
||||
"Cannot find API dump file for previous Blender version " +
|
||||
str(version_from) +
|
||||
" in index file."
|
||||
)
|
||||
|
||||
print("Found from file: %r" % filepath_in_from)
|
||||
|
||||
with open(os.path.join(rootpath, filepath_in_from), 'r', encoding='utf-8') as file_handle:
|
||||
_, dict_from = json.load(file_handle)
|
||||
|
||||
with open(os.path.join(rootpath, filepath_in_to), 'r', encoding='utf-8') as file_handle:
|
||||
dump_version, dict_to = json.load(file_handle)
|
||||
assert tuple(dump_version) == version
|
||||
|
||||
api_changes = []
|
||||
|
||||
@@ -249,63 +342,68 @@ def api_changelog(api_from, api_to, api_out):
|
||||
|
||||
# also document function argument changes
|
||||
|
||||
fout = open(api_out, 'w', encoding='utf-8')
|
||||
fw = fout.write
|
||||
# print(api_changes)
|
||||
with open(filepath_out, 'w', encoding='utf-8') as fout:
|
||||
fw = fout.write
|
||||
|
||||
# :class:`bpy_struct.id_data`
|
||||
# Write header.
|
||||
fw(""
|
||||
":tocdepth: 2\n"
|
||||
"\n"
|
||||
"Change Log\n"
|
||||
"**********\n"
|
||||
"\n"
|
||||
"Changes in Blender's Python API between releases.\n"
|
||||
"\n"
|
||||
".. note, this document is auto generated by sphinx_changelog_gen.py\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"%s to %s\n"
|
||||
"============\n"
|
||||
"\n" % (version_from_key, version_key))
|
||||
|
||||
def write_title(title, title_char):
|
||||
fw("%s\n%s\n\n" % (title, title_char * len(title)))
|
||||
def write_title(title, title_char):
|
||||
fw("%s\n%s\n\n" % (title, title_char * len(title)))
|
||||
|
||||
for mod_id, class_id, props_moved, props_new, props_old, func_args in api_changes:
|
||||
class_name = class_id.split(".")[-1]
|
||||
title = mod_id + "." + class_name
|
||||
write_title(title, "-")
|
||||
for mod_id, class_id, props_moved, props_new, props_old, func_args in api_changes:
|
||||
class_name = class_id.split(".")[-1]
|
||||
title = mod_id + "." + class_name
|
||||
write_title(title, "-")
|
||||
|
||||
if props_new:
|
||||
write_title("Added", "^")
|
||||
for prop_id in props_new:
|
||||
fw("* :class:`%s.%s.%s`\n" % (mod_id, class_name, prop_id))
|
||||
fw("\n")
|
||||
if props_new:
|
||||
write_title("Added", "^")
|
||||
for prop_id in props_new:
|
||||
fw("* :class:`%s.%s.%s`\n" % (mod_id, class_name, prop_id))
|
||||
fw("\n")
|
||||
|
||||
if props_old:
|
||||
write_title("Removed", "^")
|
||||
for prop_id in props_old:
|
||||
fw("* **%s**\n" % prop_id) # can't link to removed docs
|
||||
fw("\n")
|
||||
if props_old:
|
||||
write_title("Removed", "^")
|
||||
for prop_id in props_old:
|
||||
fw("* **%s**\n" % prop_id) # can't link to removed docs
|
||||
fw("\n")
|
||||
|
||||
if props_moved:
|
||||
write_title("Renamed", "^")
|
||||
for prop_id_old, prop_id in props_moved:
|
||||
fw("* **%s** -> :class:`%s.%s.%s`\n" % (prop_id_old, mod_id, class_name, prop_id))
|
||||
fw("\n")
|
||||
if props_moved:
|
||||
write_title("Renamed", "^")
|
||||
for prop_id_old, prop_id in props_moved:
|
||||
fw("* **%s** -> :class:`%s.%s.%s`\n" % (prop_id_old, mod_id, class_name, prop_id))
|
||||
fw("\n")
|
||||
|
||||
if func_args:
|
||||
write_title("Function Arguments", "^")
|
||||
for func_id, args_old, args_new in func_args:
|
||||
args_new = ", ".join(args_new)
|
||||
args_old = ", ".join(args_old)
|
||||
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
|
||||
fw("\n")
|
||||
if func_args:
|
||||
write_title("Function Arguments", "^")
|
||||
for func_id, args_old, args_new in func_args:
|
||||
args_new = ", ".join(args_new)
|
||||
args_old = ", ".join(args_old)
|
||||
fw("* :class:`%s.%s.%s` (%s), *was (%s)*\n" % (mod_id, class_name, func_id, args_new, args_old))
|
||||
fw("\n")
|
||||
|
||||
fout.close()
|
||||
|
||||
print("Written: %r" % api_out)
|
||||
print("Written: %r" % filepath_out)
|
||||
|
||||
|
||||
def main():
|
||||
def main(argv=None):
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
|
||||
try:
|
||||
import argparse
|
||||
except ImportError:
|
||||
print("Old Blender, just dumping")
|
||||
api_dump()
|
||||
return
|
||||
|
||||
argv = sys.argv
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
if "--" not in argv:
|
||||
argv = [] # as if no args are passed
|
||||
@@ -316,42 +414,42 @@ def main():
|
||||
usage_text = "Run blender in background mode with this script: "
|
||||
"blender --background --factory-startup --python %s -- [options]" % os.path.basename(__file__)
|
||||
|
||||
epilog = "Run this before releases"
|
||||
|
||||
parser = argparse.ArgumentParser(description=usage_text, epilog=epilog)
|
||||
|
||||
parser = argparse.ArgumentParser(description=usage_text,
|
||||
epilog=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument(
|
||||
"--dump", dest="dump", action='store_true',
|
||||
help="When set the api will be dumped into blender_version.py")
|
||||
"--indexpath", dest="indexpath", metavar='FILE', required=True,
|
||||
help="Path of the JSON file containing the index of all available API dumps.")
|
||||
|
||||
parser.add_argument(
|
||||
"--api_from", dest="api_from", metavar='FILE',
|
||||
help="File to compare from (previous version)")
|
||||
parser.add_argument(
|
||||
"--api_to", dest="api_to", metavar='FILE',
|
||||
help="File to compare from (current)")
|
||||
parser.add_argument(
|
||||
"--api_out", dest="api_out", metavar='FILE',
|
||||
help="Output sphinx changelog")
|
||||
parser_commands = parser.add_subparsers(required=True)
|
||||
|
||||
args = parser.parse_args(argv) # In this example we won't use the args
|
||||
parser_dump = parser_commands.add_parser('dump', help="Dump the current Blender Python API into a JSON file.")
|
||||
parser_dump.add_argument(
|
||||
"--filepath-out", dest="filepath_out", metavar='FILE', required=True,
|
||||
help="Path of the JSON file containing the dump of the API.")
|
||||
parser_dump.set_defaults(func=api_dump)
|
||||
|
||||
if not argv:
|
||||
print("No args given!")
|
||||
parser.print_help()
|
||||
return
|
||||
parser_changelog = parser_commands.add_parser(
|
||||
'changelog',
|
||||
help="Generate the RST changelog page based on two Blender Python API JSON dumps.",
|
||||
)
|
||||
|
||||
if args.dump:
|
||||
api_dump()
|
||||
else:
|
||||
if args.api_from and args.api_to and args.api_out:
|
||||
api_changelog(args.api_from, args.api_to, args.api_out)
|
||||
else:
|
||||
print("Error: --api_from/api_to/api_out args needed")
|
||||
parser.print_help()
|
||||
return
|
||||
parser_changelog.add_argument(
|
||||
"--filepath-in-from", dest="filepath_in_from", metavar='FILE', default=None,
|
||||
help="JSON dump file to compare from (typically, previous version). "
|
||||
"If not given, will be automatically determined from current Blender version and index file.")
|
||||
parser_changelog.add_argument(
|
||||
"--filepath-in-to", dest="filepath_in_to", metavar='FILE', default=None,
|
||||
help="JSON dump file to compare to (typically, current version). "
|
||||
"If not given, will be automatically determined from current Blender version and index file.")
|
||||
parser_changelog.add_argument(
|
||||
"--filepath-out", dest="filepath_out", metavar='FILE', required=True,
|
||||
help="Output sphinx changelog RST file.")
|
||||
parser_changelog.set_defaults(func=api_changelog)
|
||||
|
||||
print("batch job finished, exiting")
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
args.func(args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@@ -141,6 +141,26 @@ def handle_args():
|
||||
required=False,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--api-changelog-generate",
|
||||
dest="changelog",
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Generate the API changelog RST file "
|
||||
"(default=False, requires `--api-dump-index-path` parameter)",
|
||||
required=False,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--api-dump-index-path",
|
||||
dest="api_dump_index_path",
|
||||
metavar='FILE',
|
||||
default=None,
|
||||
help="Path to the API dump index JSON file "
|
||||
"(required when `--api-changelog-generate` is True)",
|
||||
required=False,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-o", "--output",
|
||||
dest="output_dir",
|
||||
@@ -367,23 +387,35 @@ EXAMPLE_SET_USED = set()
|
||||
# RST files directory.
|
||||
RST_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "rst"))
|
||||
|
||||
# extra info, not api reference docs
|
||||
# stored in ./rst/info_*
|
||||
# Extra info, not api reference docs stored in `./rst/info_*`.
|
||||
# Pairs of (file, description), the title makes from the RST files are displayed before the description.
|
||||
INFO_DOCS = (
|
||||
("info_quickstart.rst",
|
||||
"Quickstart: New to Blender or scripting and want to get your feet wet?"),
|
||||
"New to Blender or scripting and want to get your feet wet?"),
|
||||
("info_overview.rst",
|
||||
"API Overview: A more complete explanation of Python integration"),
|
||||
"A more complete explanation of Python integration."),
|
||||
("info_api_reference.rst",
|
||||
"API Reference Usage: examples of how to use the API reference docs"),
|
||||
"Examples of how to use the API reference docs."),
|
||||
("info_best_practice.rst",
|
||||
"Best Practice: Conventions to follow for writing good scripts"),
|
||||
"Conventions to follow for writing good scripts."),
|
||||
("info_tips_and_tricks.rst",
|
||||
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
|
||||
"Hints to help you while writing scripts for Blender."),
|
||||
("info_gotcha.rst",
|
||||
"Gotcha's: Some of the problems you may encounter when writing scripts"),
|
||||
("change_log.rst", "Change Log: List of changes since last Blender release"),
|
||||
"Some of the problems you may encounter when writing scripts."),
|
||||
("info_advanced.rst",
|
||||
"Topics which may not be required for typical usage."),
|
||||
("change_log.rst",
|
||||
"List of changes since last Blender release"),
|
||||
)
|
||||
# Referenced indirectly.
|
||||
INFO_DOCS_OTHER = (
|
||||
# Included by: `info_advanced.rst`.
|
||||
"info_advanced_blender_as_bpy.rst",
|
||||
)
|
||||
|
||||
# Hide the actual TOC, use a separate list that links to the items.
|
||||
# This is done so a short description can be included with each link.
|
||||
USE_INFO_DOCS_FANCY_INDEX = True
|
||||
|
||||
# only support for properties atm.
|
||||
RNA_BLACKLIST = {
|
||||
@@ -514,6 +546,42 @@ if ARGS.sphinx_build_pdf:
|
||||
sphinx_make_pdf_log = os.path.join(ARGS.output_dir, ".latex_make.log")
|
||||
SPHINX_MAKE_PDF_STDOUT = open(sphinx_make_pdf_log, "w", encoding="utf-8")
|
||||
|
||||
|
||||
# --------------------------------CHANGELOG GENERATION--------------------------------------
|
||||
|
||||
def generate_changelog():
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"sphinx_changelog_gen",
|
||||
os.path.abspath(os.path.join(SCRIPT_DIR, "sphinx_changelog_gen.py")),
|
||||
)
|
||||
sphinx_changelog_gen = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(sphinx_changelog_gen)
|
||||
|
||||
API_DUMP_INDEX_FILEPATH = ARGS.api_dump_index_path
|
||||
API_DUMP_ROOT = os.path.dirname(API_DUMP_INDEX_FILEPATH)
|
||||
API_DUMP_FILEPATH = os.path.abspath(os.path.join(API_DUMP_ROOT, BLENDER_VERSION_DOTS, "api_dump.json"))
|
||||
API_CHANGELOG_FILEPATH = os.path.abspath(os.path.join(SPHINX_IN_TMP, "change_log.rst"))
|
||||
|
||||
sphinx_changelog_gen.main((
|
||||
"--",
|
||||
"--indexpath",
|
||||
API_DUMP_INDEX_FILEPATH,
|
||||
"dump",
|
||||
"--filepath-out",
|
||||
API_DUMP_FILEPATH,
|
||||
))
|
||||
|
||||
sphinx_changelog_gen.main((
|
||||
"--",
|
||||
"--indexpath",
|
||||
API_DUMP_INDEX_FILEPATH,
|
||||
"changelog",
|
||||
"--filepath-out",
|
||||
API_CHANGELOG_FILEPATH,
|
||||
))
|
||||
|
||||
|
||||
# --------------------------------API DUMP--------------------------------------
|
||||
|
||||
# Lame, python won't give some access.
|
||||
@@ -1075,6 +1143,7 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
|
||||
# Changes In Blender will force errors here.
|
||||
context_type_map = {
|
||||
# context_member: (RNA type, is_collection)
|
||||
"active_action": ("Action", False),
|
||||
"active_annotation_layer": ("GPencilLayer", False),
|
||||
"active_bone": ("EditBone", False),
|
||||
"active_file": ("FileSelectEntry", False),
|
||||
@@ -1413,7 +1482,7 @@ def pyrna2sphinx(basepath):
|
||||
|
||||
struct_module_name = struct.module_name
|
||||
if USE_ONLY_BUILTIN_RNA_TYPES:
|
||||
assert(struct_module_name == "bpy.types")
|
||||
assert struct_module_name == "bpy.types"
|
||||
filepath = os.path.join(basepath, "%s.%s.rst" % (struct_module_name, struct.identifier))
|
||||
file = open(filepath, "w", encoding="utf-8")
|
||||
fw = file.write
|
||||
@@ -1473,7 +1542,8 @@ def pyrna2sphinx(basepath):
|
||||
else:
|
||||
fw(".. class:: %s\n\n" % struct_id)
|
||||
|
||||
fw(" %s\n\n" % struct.description)
|
||||
write_indented_lines(" ", fw, struct.description, False)
|
||||
fw("\n")
|
||||
|
||||
# Properties sorted in alphabetical order.
|
||||
sorted_struct_properties = struct.properties[:]
|
||||
@@ -1846,7 +1916,7 @@ except ModuleNotFoundError:
|
||||
# fw(" 'collapse_navigation': True,\n")
|
||||
fw(" 'sticky_navigation': False,\n")
|
||||
fw(" 'navigation_depth': 1,\n")
|
||||
# fw(" 'includehidden': True,\n")
|
||||
fw(" 'includehidden': False,\n")
|
||||
# fw(" 'titles_only': False\n")
|
||||
fw(" }\n\n")
|
||||
|
||||
@@ -1918,12 +1988,21 @@ def write_rst_index(basepath):
|
||||
|
||||
if not EXCLUDE_INFO_DOCS:
|
||||
fw(".. toctree::\n")
|
||||
if USE_INFO_DOCS_FANCY_INDEX:
|
||||
fw(" :hidden:\n")
|
||||
fw(" :maxdepth: 1\n")
|
||||
fw(" :caption: Documentation\n\n")
|
||||
for info, info_desc in INFO_DOCS:
|
||||
fw(" %s <%s>\n" % (info_desc, info))
|
||||
fw(" %s\n" % info)
|
||||
fw("\n")
|
||||
|
||||
if USE_INFO_DOCS_FANCY_INDEX:
|
||||
# Show a fake TOC, allowing for an extra description to be shown as well as the title.
|
||||
fw(title_string("Documentation", "="))
|
||||
for info, info_desc in INFO_DOCS:
|
||||
fw("- :doc:`%s`: %s\n" % (info.removesuffix(".rst"), info_desc))
|
||||
fw("\n")
|
||||
|
||||
fw(".. toctree::\n")
|
||||
fw(" :maxdepth: 1\n")
|
||||
fw(" :caption: Application Modules\n\n")
|
||||
@@ -2256,6 +2335,8 @@ def copy_handwritten_rsts(basepath):
|
||||
if not EXCLUDE_INFO_DOCS:
|
||||
for info, _info_desc in INFO_DOCS:
|
||||
shutil.copy2(os.path.join(RST_DIR, info), basepath)
|
||||
for info in INFO_DOCS_OTHER:
|
||||
shutil.copy2(os.path.join(RST_DIR, info), basepath)
|
||||
|
||||
# TODO: put this docs in Blender's code and use import as per modules above.
|
||||
handwritten_modules = [
|
||||
@@ -2473,6 +2554,9 @@ def main():
|
||||
|
||||
rna2sphinx(SPHINX_IN_TMP)
|
||||
|
||||
if ARGS.changelog:
|
||||
generate_changelog()
|
||||
|
||||
if ARGS.full_rebuild:
|
||||
# Only for full updates.
|
||||
shutil.rmtree(SPHINX_IN, True)
|
||||
|
12
extern/CMakeLists.txt
vendored
12
extern/CMakeLists.txt
vendored
@@ -32,14 +32,6 @@ if(WITH_BINRELOC)
|
||||
add_subdirectory(binreloc)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SYSTEM_GLEW)
|
||||
if(WITH_GLEW_ES)
|
||||
add_subdirectory(glew-es)
|
||||
else()
|
||||
add_subdirectory(glew)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
|
||||
add_subdirectory(lzo)
|
||||
endif()
|
||||
@@ -48,7 +40,7 @@ if(WITH_LZMA)
|
||||
add_subdirectory(lzma)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||
if(WITH_CYCLES OR WITH_COMPOSITOR_CPU OR WITH_OPENSUBDIV)
|
||||
add_subdirectory(clew)
|
||||
if((WITH_CYCLES_DEVICE_CUDA OR WITH_CYCLES_DEVICE_OPTIX) AND WITH_CUDA_DYNLOAD)
|
||||
add_subdirectory(cuew)
|
||||
@@ -96,6 +88,6 @@ if(WITH_MOD_FLUID)
|
||||
add_subdirectory(mantaflow)
|
||||
endif()
|
||||
|
||||
if(WITH_COMPOSITOR)
|
||||
if(WITH_COMPOSITOR_CPU)
|
||||
add_subdirectory(smaa_areatex)
|
||||
endif()
|
||||
|
22
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
22
extern/audaspace/bindings/C/AUD_Special.cpp
vendored
@@ -270,7 +270,7 @@ AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int sampl
|
||||
return length;
|
||||
}
|
||||
|
||||
AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
|
||||
AUD_API int AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data, char* error, size_t errorsize)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -282,15 +282,20 @@ AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned i
|
||||
std::shared_ptr<IWriter> writer = FileWriter::createWriter(filename, convCToDSpec(specs), static_cast<Container>(format), static_cast<Codec>(codec), bitrate);
|
||||
FileWriter::writeReader(reader, writer, length, buffersize, callback, data);
|
||||
|
||||
return nullptr;
|
||||
return true;
|
||||
}
|
||||
catch(Exception& e)
|
||||
{
|
||||
return e.getMessage().c_str();
|
||||
if(error && errorsize)
|
||||
{
|
||||
std::strncpy(error, e.getMessage().c_str(), errorsize);
|
||||
error[errorsize - 1] = '\0';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data)
|
||||
AUD_API int AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length, unsigned int buffersize, const char* filename, AUD_DeviceSpecs specs, AUD_Container format, AUD_Codec codec, unsigned int bitrate, void(*callback)(float, void*), void* data, char* error, size_t errorsize)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -328,11 +333,16 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start
|
||||
reader->seek(start);
|
||||
FileWriter::writeReader(reader, writers, length, buffersize, callback, data);
|
||||
|
||||
return nullptr;
|
||||
return true;
|
||||
}
|
||||
catch(Exception& e)
|
||||
{
|
||||
return e.getMessage().c_str();
|
||||
if(error && errorsize)
|
||||
{
|
||||
std::strncpy(error, e.getMessage().c_str(), errorsize);
|
||||
error[errorsize - 1] = '\0';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
16
extern/audaspace/bindings/C/AUD_Special.h
vendored
16
extern/audaspace/bindings/C/AUD_Special.h
vendored
@@ -70,13 +70,15 @@ extern AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, in
|
||||
* \param bitrate The bitrate for encoding.
|
||||
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
|
||||
* \param data Pass through parameter that is passed to the callback.
|
||||
* \return An error message or NULL in case of success.
|
||||
* \param error String buffer to copy the error message to in case of failure.
|
||||
* \param errorsize The size of the error buffer.
|
||||
* \return Whether or not the operation succeeded.
|
||||
*/
|
||||
extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
extern AUD_API int AUD_mixdown(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
unsigned int buffersize, const char* filename,
|
||||
AUD_DeviceSpecs specs, AUD_Container format,
|
||||
AUD_Codec codec, unsigned int bitrate,
|
||||
void(*callback)(float, void*), void* data);
|
||||
void(*callback)(float, void*), void* data, char* error, size_t errorsize);
|
||||
|
||||
/**
|
||||
* Mixes a sound down into multiple files.
|
||||
@@ -91,13 +93,15 @@ extern AUD_API const char* AUD_mixdown(AUD_Sound* sound, unsigned int start, uns
|
||||
* \param bitrate The bitrate for encoding.
|
||||
* \param callback A callback function that is called periodically during mixdown, reporting progress if length > 0. Can be NULL.
|
||||
* \param data Pass through parameter that is passed to the callback.
|
||||
* \return An error message or NULL in case of success.
|
||||
* \param error String buffer to copy the error message to in case of failure.
|
||||
* \param errorsize The size of the error buffer.
|
||||
* \return Whether or not the operation succeeded.
|
||||
*/
|
||||
extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
extern AUD_API int AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start, unsigned int length,
|
||||
unsigned int buffersize, const char* filename,
|
||||
AUD_DeviceSpecs specs, AUD_Container format,
|
||||
AUD_Codec codec, unsigned int bitrate,
|
||||
void(*callback)(float, void*), void* data);
|
||||
void(*callback)(float, void*), void* data, char* error, size_t errorsize);
|
||||
|
||||
/**
|
||||
* Opens a read device and prepares it for mixdown of the sound scene.
|
||||
|
@@ -363,8 +363,8 @@ int FFMPEGReader::read_packet(void* opaque, uint8_t* buf, int buf_size)
|
||||
|
||||
long long size = std::min(static_cast<long long>(buf_size), reader->m_membuffer->getSize() - reader->m_membufferpos);
|
||||
|
||||
if(size < 0)
|
||||
return -1;
|
||||
if(size <= 0)
|
||||
return AVERROR_EOF;
|
||||
|
||||
std::memcpy(buf, ((data_t*)reader->m_membuffer->getBuffer()) + reader->m_membufferpos, size);
|
||||
reader->m_membufferpos += size;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user