Compare commits

..

2 Commits

Author SHA1 Message Date
d1c8699f83 Merge branch 'master' into arcpatch-D16436
# Conflicts:
#	source/blender/draw/engines/overlay/shaders/infos/overlay_outline_info.hh
#	source/blender/draw/engines/overlay/shaders/infos/overlay_wireframe_info.hh
#	source/blender/gpu/intern/gpu_shader_create_info.cc
#	source/blender/gpu/intern/gpu_shader_create_info.hh
#	source/blender/gpu/metal/kernels/depth_2d_update_info.hh
#	source/blender/gpu/metal/mtl_shader_generator.mm
2022-12-08 22:36:31 +01:00
Jason Fielder
4d18250a2a Metal: Add support for Workbench Shadows.
Implementing non-geometry-shader path for rendering stencil shadows, used by the workbench engine. Patch also contains a few small modifications to Create-info to ensure usage of gl_FragDepth is explicitly specified. This is required for testing of the patch.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261

Differential Revision: https://developer.blender.org/D16436
2022-12-08 22:24:52 +01:00
2350 changed files with 65709 additions and 107687 deletions

View File

@@ -61,17 +61,17 @@ ContinuationIndentWidth: 4
# This tries to match Blender's style as much as possible. One # This tries to match Blender's style as much as possible. One
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
BraceWrapping: { BraceWrapping: {
AfterClass: 'false', AfterClass: 'false'
AfterControlStatement: 'false', AfterControlStatement: 'false'
AfterEnum : 'false', AfterEnum : 'false'
AfterFunction : 'true', AfterFunction : 'true'
AfterNamespace : 'false', AfterNamespace : 'false'
AfterStruct : 'false', AfterStruct : 'false'
AfterUnion : 'false', AfterUnion : 'false'
BeforeCatch : 'true', BeforeCatch : 'true'
BeforeElse : 'true', BeforeElse : 'true'
IndentBraces : 'false', IndentBraces : 'false'
AfterObjCDeclaration: 'true', AfterObjCDeclaration: 'true'
} }
# For switch statements, indent the cases. # For switch statements, indent the cases.

View File

@@ -1,5 +0,0 @@
${CommitTitle}
${CommitBody}
Pull Request #${PullRequestIndex}

View File

@@ -1,3 +0,0 @@
${PullRequestTitle}
Pull Request #${PullRequestIndex}

View File

@@ -1,44 +0,0 @@
name: Bug Report
about: File a bug report
labels:
- "type::Report"
- "status::Needs Triage"
- "priority::Normal"
body:
- type: markdown
attributes:
value: |
### Instructions
First time reporting? See [tips](https://wiki.blender.org/wiki/Process/Bug_Reports).
* Use **Help > Report a Bug** in Blender to fill system information and exact Blender version.
* Test [daily builds](https://builder.blender.org/) to verify if the issue is already fixed.
* Test [previous versions](https://download.blender.org/release/) to find an older working version.
* For feature requests, feedback, questions or build issues, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
* If there are multiple bugs, make multiple bug reports.
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true
value: |
**System Information**
Operating system:
Graphics card:
**Blender Version**
Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen)
Worked: (newest version of Blender that worked as expected)
**Short description of error**
**Exact steps for others to reproduce the error**
Based on the default startup or an attached .blend file (as simple as possible).
- type: markdown
attributes:
value: |
### Help the developers
Bug fixing is important, the developers will handle reports swiftly. For that reason, carefully provide exact steps and a **small and simple .blend file** to reproduce the problem. You do your half of the work, then we do our half!

View File

@@ -1 +0,0 @@
blank_issues_enabled: false

View File

@@ -1,10 +0,0 @@
name: Design
about: Create a design task (for developers only)
labels:
- "type::Design"
body:
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true

View File

@@ -1,10 +0,0 @@
name: To Do
about: Create a to do task (for developers only)
labels:
- "type::To Do"
body:
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true

View File

@@ -1,17 +0,0 @@
name: Pull Request
about: Contribute code to Blender
body:
- type: markdown
attributes:
value: |
### Instructions
Guides to [contributing code](https://wiki.blender.org/index.php/Dev:Doc/Process/Contributing_Code) and effective [code review](https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review).
By submitting code here, you agree that the code is (compatible with) GNU GPL v2 or later.
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true

View File

@@ -117,19 +117,15 @@ enable_testing()
# Keep in sync with: https://wiki.blender.org/wiki/Building_Blender # Keep in sync with: https://wiki.blender.org/wiki/Building_Blender
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "11.0.0") if("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "9.3.1")
message(FATAL_ERROR "The minimum supported version of GCC is 11.0.0, found ${CMAKE_C_COMPILER_VERSION}") message(FATAL_ERROR "The minimum supported version of GCC is 9.3.1")
endif() endif()
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "8.0")) if(CMAKE_COMPILER_IS_GNUCC AND ("${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "8.0"))
message(FATAL_ERROR "The minimum supported version of CLANG is 8.0, found ${CMAKE_C_COMPILER_VERSION}") message(FATAL_ERROR "The minimum supported version of CLANG is 8.0")
endif() endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC) elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
if(MSVC_VERSION VERSION_LESS "1928") if(MSVC_VERSION VERSION_LESS "1928")
# MSVC_VERSION is an internal version number, it doesn't map to something
# the end user would recognize as a version. Because of this, for MSVC we do
# not show the found number. When using our make.bat the actual VS version
# will be displayed on the console before starting the build, anyway.
message(FATAL_ERROR "The minimum supported version of MSVC is 2019 (16.9.16)") message(FATAL_ERROR "The minimum supported version of MSVC is 2019 (16.9.16)")
endif() endif()
endif() endif()
@@ -167,26 +163,14 @@ get_blender_version()
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON) option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
mark_as_advanced(WITH_BLENDER) mark_as_advanced(WITH_BLENDER)
if(WIN32) if(APPLE)
option(WITH_BLENDER_THUMBNAILER "\ # In future, can be used with `quicklookthumbnailing/qlthumbnailreply` to create file
Build \"BlendThumb.dll\" helper for Windows explorer integration to support extracting \ # thumbnails for say Finder. Turn it off for now.
thumbnails from `.blend` files." option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" OFF)
ON elseif(WIN32)
) option(WITH_BLENDER_THUMBNAILER "Build \"BlendThumb.dll\" helper for Windows explorer integration" ON)
else() else()
set(_option_default ON) option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" ON)
if(APPLE)
# In future, can be used with `quicklookthumbnailing/qlthumbnailreply`
# to create file thumbnails for say Finder.
# Turn it off for now, even though it can build on APPLE, it's not likely to be useful.
set(_option_default OFF)
endif()
option(WITH_BLENDER_THUMBNAILER "\
Build stand-alone \"blender-thumbnailer\" command-line thumbnail extraction utility, \
intended for use by file-managers to extract PNG images from `.blend` files."
${_option_default}
)
unset(_option_default)
endif() endif()
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
@@ -226,19 +210,14 @@ option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" ) option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET) mark_as_advanced(WITH_SYSTEM_BULLET)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON) option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
set(_option_default ON)
if(APPLE) if(APPLE)
# There's no OpenXR runtime in sight for macOS, neither is code well # There's no OpenXR runtime in sight for macOS, neither is code well
# tested there -> disable it by default. # tested there -> disable it by default.
set(_option_default OFF) option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" OFF)
endif()
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ${_option_default})
if(APPLE)
mark_as_advanced(WITH_XR_OPENXR) mark_as_advanced(WITH_XR_OPENXR)
else()
option(WITH_XR_OPENXR "Enable VR features through the OpenXR specification" ON)
endif() endif()
unset(_option_default)
option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON) option(WITH_GMP "Enable features depending on GMP (Exact Boolean)" ON)
# Compositor # Compositor
@@ -370,13 +349,12 @@ else()
set(WITH_COREAUDIO OFF) set(WITH_COREAUDIO OFF)
endif() endif()
if(NOT WIN32) if(NOT WIN32)
set(_option_default ON)
if(APPLE) if(APPLE)
set(_option_default OFF) option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" OFF)
else()
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ON)
endif() endif()
option(WITH_JACK "Enable JACK Support (http://www.jackaudio.org)" ${_option_default}) option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
unset(_option_default)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
else() else()
set(WITH_JACK OFF) set(WITH_JACK OFF)
endif() endif()
@@ -417,26 +395,6 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
# Freestyle # Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON) option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# Libraries.
if(UNIX AND NOT APPLE)
# Optionally build without pre-compiled libraries.
# NOTE: this could be supported on all platforms however in practice UNIX is the only platform
# that has good support for detecting installed libraries.
option(WITH_LIBS_PRECOMPILED "\
Detect and link against pre-compiled libraries (typically found under \"../lib/\"). \
Disabling this option will use the system libraries although cached paths \
that point to pre-compiled libraries will be left as-is."
ON
)
mark_as_advanced(WITH_LIBS_PRECOMPILED)
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
if(WITH_STATIC_LIBS)
option(WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF)
mark_as_advanced(WITH_BOOST_ICU)
endif()
endif()
# Misc # Misc
if(WIN32 OR APPLE) if(WIN32 OR APPLE)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON) option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
@@ -444,6 +402,11 @@ endif()
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON) option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON) option(WITH_INSTALL_PORTABLE "Install redistributable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
if(WITH_STATIC_LIBS)
option(WITH_BOOST_ICU "Boost uses ICU library (required for linking with static Boost built with libicu)." OFF)
mark_as_advanced(WITH_BOOST_ICU)
endif()
endif() endif()
option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON) option(WITH_PYTHON_INSTALL "Copy system python into the blender install folder" ON)
@@ -524,7 +487,7 @@ endif()
if(NOT APPLE) if(NOT APPLE)
option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON) option(WITH_CYCLES_DEVICE_HIP "Enable Cycles AMD HIP support" ON)
option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF) option(WITH_CYCLES_HIP_BINARIES "Build Cycles AMD HIP binaries" OFF)
set(CYCLES_HIP_BINARIES_ARCH gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 CACHE STRING "AMD HIP architectures to build binaries for") set(CYCLES_HIP_BINARIES_ARCH gfx900 gfx906 gfx90c gfx902 gfx1010 gfx1011 gfx1012 gfx1030 gfx1031 gfx1032 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 CACHE STRING "AMD HIP architectures to build binaries for")
mark_as_advanced(WITH_CYCLES_DEVICE_HIP) mark_as_advanced(WITH_CYCLES_DEVICE_HIP)
mark_as_advanced(CYCLES_HIP_BINARIES_ARCH) mark_as_advanced(CYCLES_HIP_BINARIES_ARCH)
endif() endif()
@@ -538,14 +501,12 @@ endif()
if(NOT APPLE) if(NOT APPLE)
option(WITH_CYCLES_DEVICE_ONEAPI "Enable Cycles oneAPI compute support" OFF) option(WITH_CYCLES_DEVICE_ONEAPI "Enable Cycles oneAPI compute support" OFF)
option(WITH_CYCLES_ONEAPI_BINARIES "Enable Ahead-Of-Time compilation for Cycles oneAPI device" OFF) option(WITH_CYCLES_ONEAPI_BINARIES "Enable Ahead-Of-Time compilation for Cycles oneAPI device" OFF)
option(WITH_CYCLES_ONEAPI_HOST_TASK_EXECUTION "Switch target of oneAPI implementation from SYCL devices to Host Task (single thread on CPU). This option is only for debugging purposes." OFF)
# https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html # https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html
# acm-g10 is the target for the first Intel Arc Alchemist GPUs. # acm-g10 is the target for the first Intel Arc Alchemist GPUs.
set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "acm-g10" CACHE STRING "oneAPI Intel GPU architectures to build binaries for") set(CYCLES_ONEAPI_SPIR64_GEN_DEVICES "acm-g10" CACHE STRING "oneAPI Intel GPU architectures to build binaries for")
set(CYCLES_ONEAPI_SYCL_TARGETS spir64 spir64_gen CACHE STRING "oneAPI targets to build AOT binaries for") set(CYCLES_ONEAPI_SYCL_TARGETS spir64 spir64_gen CACHE STRING "oneAPI targets to build AOT binaries for")
mark_as_advanced(WITH_CYCLES_ONEAPI_HOST_TASK_EXECUTION)
mark_as_advanced(CYCLES_ONEAPI_SPIR64_GEN_DEVICES) mark_as_advanced(CYCLES_ONEAPI_SPIR64_GEN_DEVICES)
mark_as_advanced(CYCLES_ONEAPI_SYCL_TARGETS) mark_as_advanced(CYCLES_ONEAPI_SYCL_TARGETS)
endif() endif()
@@ -615,8 +576,8 @@ endif()
# OpenGL # OpenGL
option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON) option(WITH_OPENGL "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
option(WITH_GPU_BUILDTIME_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF) option(WITH_GPU_BUILDTIME_SHADER_BUILDER "Shader builder is a developer option enabling linting on GLSL during compilation" OFF)
mark_as_advanced( mark_as_advanced(
WITH_OPENGL WITH_OPENGL
@@ -632,12 +593,16 @@ mark_as_advanced(
# Metal # Metal
if(APPLE) if(APPLE)
option(WITH_METAL_BACKEND "Use Metal for graphics instead of (or as well as) OpenGL on macOS." ON) option(WITH_METAL_BACKEND "Use Metal for graphics instead of (or as well as) OpenGL on macOS." OFF)
mark_as_advanced(WITH_METAL_BACKEND) mark_as_advanced(WITH_METAL_BACKEND)
else() else()
set(WITH_METAL_BACKEND OFF) set(WITH_METAL_BACKEND OFF)
endif() endif()
if(WITH_METAL_BACKEND)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
endif()
if(WIN32) if(WIN32)
getDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) getDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${}) set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
@@ -784,6 +749,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja")
mark_as_advanced(WITH_NINJA_POOL_JOBS) mark_as_advanced(WITH_NINJA_POOL_JOBS)
endif() endif()
if(UNIX AND NOT APPLE)
option(WITH_CXX11_ABI "Use native C++11 ABI of compiler" ON)
mark_as_advanced(WITH_CXX11_ABI)
endif()
# Installation process. # Installation process.
set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after installation process") set(POSTINSTALL_SCRIPT "" CACHE FILEPATH "Run given CMake script after installation process")
mark_as_advanced(POSTINSTALL_SCRIPT) mark_as_advanced(POSTINSTALL_SCRIPT)
@@ -865,17 +835,27 @@ endif()
# enable boost for cycles, audaspace or i18n # enable boost for cycles, audaspace or i18n
# otherwise if the user disabled # otherwise if the user disabled
set_and_warn_dependency(WITH_BOOST WITH_CYCLES OFF)
set_and_warn_dependency(WITH_BOOST WITH_INTERNATIONAL OFF) set_and_warn_dependency(WITH_BOOST WITH_INTERNATIONAL OFF)
set_and_warn_dependency(WITH_BOOST WITH_OPENVDB OFF) set_and_warn_dependency(WITH_BOOST WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_BOOST WITH_OPENCOLORIO OFF)
set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF) set_and_warn_dependency(WITH_BOOST WITH_QUADRIFLOW OFF)
set_and_warn_dependency(WITH_BOOST WITH_USD OFF) set_and_warn_dependency(WITH_BOOST WITH_USD OFF)
set_and_warn_dependency(WITH_BOOST WITH_ALEMBIC OFF)
if(WITH_CYCLES) if(WITH_CYCLES)
set_and_warn_dependency(WITH_BOOST WITH_CYCLES_OSL OFF)
set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF) set_and_warn_dependency(WITH_PUGIXML WITH_CYCLES_OSL OFF)
endif() endif()
set_and_warn_dependency(WITH_PUGIXML WITH_OPENIMAGEIO OFF)
if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_USD OR WITH_ALEMBIC))
message(STATUS "No dependencies need 'WITH_BOOST' forcing WITH_BOOST=OFF")
set(WITH_BOOST OFF)
endif()
set_and_warn_dependency(WITH_TBB WITH_CYCLES OFF) set_and_warn_dependency(WITH_TBB WITH_CYCLES OFF)
set_and_warn_dependency(WITH_TBB WITH_USD OFF) set_and_warn_dependency(WITH_TBB WITH_USD OFF)
set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE OFF)
set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF) set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF) set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
@@ -884,10 +864,14 @@ set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
# OpenVDB and OpenColorIO uses 'half' type from OpenEXR # OpenVDB and OpenColorIO uses 'half' type from OpenEXR
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF) set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO OFF)
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF. # Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF) set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
# USD needs OpenSubDiv, since that is used by the Cycles Hydra render delegate.
set_and_warn_dependency(WITH_OPENSUBDIV WITH_USD OFF)
# auto enable openimageio for cycles # auto enable openimageio for cycles
if(WITH_CYCLES) if(WITH_CYCLES)
set(WITH_OPENIMAGEIO ON) set(WITH_OPENIMAGEIO ON)
@@ -901,6 +885,17 @@ else()
set(WITH_CYCLES_OSL OFF) set(WITH_CYCLES_OSL OFF)
endif() endif()
# auto enable openimageio linking dependencies
if(WITH_OPENIMAGEIO)
set(WITH_IMAGE_OPENEXR ON)
set(WITH_IMAGE_TIFF ON)
endif()
# auto enable alembic linking dependencies
if(WITH_ALEMBIC)
set(WITH_IMAGE_OPENEXR ON)
endif()
# don't store paths to libs for portable distribution # don't store paths to libs for portable distribution
if(WITH_INSTALL_PORTABLE) if(WITH_INSTALL_PORTABLE)
set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -1026,8 +1021,6 @@ set(PLATFORM_LINKLIBS "")
# - CMAKE_EXE_LINKER_FLAGS_DEBUG # - CMAKE_EXE_LINKER_FLAGS_DEBUG
set(PLATFORM_LINKFLAGS "") set(PLATFORM_LINKFLAGS "")
set(PLATFORM_LINKFLAGS_DEBUG "") set(PLATFORM_LINKFLAGS_DEBUG "")
set(PLATFORM_LINKFLAGS_RELEASE "")
set(PLATFORM_LINKFLAGS_EXECUTABLE "")
if(NOT CMAKE_BUILD_TYPE MATCHES "Release") if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
if(WITH_COMPILER_ASAN) if(WITH_COMPILER_ASAN)
@@ -1105,6 +1098,14 @@ if(WITH_CYCLES)
"Configure OIIO or disable WITH_CYCLES" "Configure OIIO or disable WITH_CYCLES"
) )
endif() endif()
if(NOT WITH_BOOST)
message(
FATAL_ERROR
"Cycles requires WITH_BOOST, the library may not have been found. "
"Configure BOOST or disable WITH_CYCLES"
)
endif()
if(WITH_CYCLES_OSL) if(WITH_CYCLES_OSL)
if(NOT WITH_LLVM) if(NOT WITH_LLVM)
message( message(
@@ -1241,6 +1242,13 @@ if(WITH_OPENGL)
add_definitions(-DWITH_OPENGL) add_definitions(-DWITH_OPENGL)
endif() endif()
#-----------------------------------------------------------------------------
# Configure Vulkan.
if(WITH_VULKAN_BACKEND)
list(APPEND BLENDER_GL_LIBRARIES ${VULKAN_LIBRARIES})
endif()
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Configure Metal # Configure Metal
@@ -1290,14 +1298,12 @@ endif()
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Configure Bullet # Configure Bullet
if(WITH_BULLET) if(WITH_BULLET AND WITH_SYSTEM_BULLET)
if(WITH_SYSTEM_BULLET) find_package(Bullet)
find_package(Bullet) set_and_warn_library_found("Bullet" BULLET_FOUND WITH_BULLET)
set_and_warn_library_found("Bullet" BULLET_FOUND WITH_BULLET) else()
else() set(BULLET_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/bullet2/src")
set(BULLET_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/bullet2/src") # set(BULLET_LIBRARIES "")
set(BULLET_LIBRARIES "extern_bullet")
endif()
endif() endif()
@@ -1457,9 +1463,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
add_check_c_compiler_flag(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits) add_check_c_compiler_flag(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
add_check_c_compiler_flag(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness) add_check_c_compiler_flag(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
add_check_c_compiler_flag(C_WARNINGS C_WARN_RESTRICT -Wrestrict) add_check_c_compiler_flag(C_WARNINGS C_WARN_RESTRICT -Wrestrict)
# Useful but too many false positives and inconvenient to suppress each occurrence.
add_check_c_compiler_flag(C_WARNINGS C_WARN_NO_STRINGOP_OVERREAD -Wno-stringop-overread)
add_check_c_compiler_flag(C_WARNINGS C_WARN_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow)
# C-only. # C-only.
add_check_c_compiler_flag(C_WARNINGS C_WARN_NO_NULL -Wnonnull) add_check_c_compiler_flag(C_WARNINGS C_WARN_NO_NULL -Wnonnull)
@@ -1499,9 +1502,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict) add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_RESTRICT -Wrestrict)
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override) add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override)
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized) add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
# Useful but too many false positives and inconvenient to suppress each occurrence.
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_NO_STRINGOP_OVERREAD -Wno-stringop-overread)
add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow)
# causes too many warnings # causes too many warnings
if(NOT APPLE) if(NOT APPLE)
@@ -1721,6 +1721,12 @@ if(
string(APPEND CMAKE_C_FLAGS " -std=gnu11") string(APPEND CMAKE_C_FLAGS " -std=gnu11")
endif() endif()
if(UNIX AND NOT APPLE)
if(NOT WITH_CXX11_ABI)
string(APPEND PLATFORM_CFLAGS " -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO) if(WITH_COMPILER_SHORT_FILE_MACRO)
# Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this). # Use '-fmacro-prefix-map' for Clang and GCC (MSVC doesn't support this).
add_check_c_compiler_flag(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar) add_check_c_compiler_flag(C_PREFIX_MAP_FLAGS C_MACRO_PREFIX_MAP -fmacro-prefix-map=foo=bar)

View File

@@ -71,13 +71,6 @@ Static Source Code Checking
* check_mypy: Checks all Python scripts using mypy, * check_mypy: Checks all Python scripts using mypy,
see: source/tools/check_source/check_mypy_config.py scripts which are included. see: source/tools/check_source/check_mypy_config.py scripts which are included.
Documentation Checking
* check_wiki_file_structure:
Check the WIKI documentation for the source-tree's file structure
matches Blender's source-code.
See: https://wiki.blender.org/wiki/Source/File_Structure
Spell Checkers Spell Checkers
This runs the spell checker from the developer tools repositor. This runs the spell checker from the developer tools repositor.
@@ -218,7 +211,7 @@ endif
# Set the LIBDIR, an empty string when not found. # Set the LIBDIR, an empty string when not found.
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU}) LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU})
ifeq (, $(LIBDIR)) ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU}_glibc_228) LIBDIR:=$(wildcard ../lib/${OS_NCASE}_centos7_${CPU})
endif endif
ifeq (, $(LIBDIR)) ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE}) LIBDIR:=$(wildcard ../lib/${OS_NCASE})
@@ -488,10 +481,6 @@ check_smatch: .FORCE
check_mypy: .FORCE check_mypy: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py" @$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py"
check_wiki_file_structure: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_wiki/check_wiki_file_structure.py"
check_spelling_py: .FORCE check_spelling_py: .FORCE
@cd "$(BUILD_DIR)" ; \ @cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \

View File

@@ -1,38 +0,0 @@
<!--
Keep this document short & concise,
linking to external resources instead of including content in-line.
See 'release/text/readme.html' for the end user read-me.
-->
Blender
=======
Blender is the free and open source 3D creation suite.
It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing,
motion tracking and video editing.
![Blender screenshot](https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg "Blender screenshot")
Project Pages
-------------
- [Main Website](http://www.blender.org)
- [Reference Manual](https://docs.blender.org/manual/en/latest/index.html)
- [User Community](https://www.blender.org/community/)
Development
-----------
- [Build Instructions](https://wiki.blender.org/wiki/Building_Blender)
- [Code Review & Bug Tracker](https://developer.blender.org)
- [Developer Forum](https://devtalk.blender.org)
- [Developer Documentation](https://wiki.blender.org)
License
-------
Blender as a whole is licensed under the GNU General Public License, Version 3.
Individual files may have a different, but compatible license.
See [blender.org/about/license](https://www.blender.org/about/license) for details.

View File

@@ -23,11 +23,13 @@ elseif(APPLE)
set(BOOST_BUILD_COMMAND ./b2) set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off) set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .) set(BOOST_HARVEST_CMD echo .)
set(BOOST_PATCH_COMMAND echo .)
else() else()
set(BOOST_HARVEST_CMD echo .) set(BOOST_HARVEST_CMD echo .)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2) set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off) set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_PATCH_COMMAND echo .)
endif() endif()
set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam) set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
@@ -70,7 +72,7 @@ ExternalProject_Add(external_boost
URL_HASH ${BOOST_HASH_TYPE}=${BOOST_HASH} URL_HASH ${BOOST_HASH_TYPE}=${BOOST_HASH}
PREFIX ${BUILD_DIR}/boost PREFIX ${BUILD_DIR}/boost
UPDATE_COMMAND "" UPDATE_COMMAND ""
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/boost/src/external_boost < ${PATCH_DIR}/boost.diff PATCH_COMMAND ${BOOST_PATCH_COMMAND}
CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND} CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=${BOOST_ARCHITECTURE} address-model=${BOOST_ADDRESS_MODEL} link=shared threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=${BOOST_ARCHITECTURE} address-model=${BOOST_ADDRESS_MODEL} link=shared threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1

View File

@@ -12,6 +12,7 @@ if(UNIX)
automake automake
bison bison
${_libtoolize_name} ${_libtoolize_name}
meson
ninja ninja
pkg-config pkg-config
tclsh tclsh

View File

@@ -24,15 +24,15 @@
set(SBOMCONTENTS) set(SBOMCONTENTS)
get_cmake_property(_variableNames VARIABLES) get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames}) foreach (_variableName ${_variableNames})
if(_variableName MATCHES "CPE$") if(_variableName MATCHES "CPE$")
string(REPLACE ":" ";" CPE_LIST ${${_variableName}}) string(REPLACE ":" ";" CPE_LIST ${${_variableName}})
string(REPLACE "_CPE" "_ID" CPE_DEPNAME ${_variableName}) string(REPLACE "_CPE" "_ID" CPE_DEPNAME ${_variableName})
list(GET CPE_LIST 3 CPE_VENDOR) list(GET CPE_LIST 3 CPE_VENDOR)
list(GET CPE_LIST 4 CPE_NAME) list(GET CPE_LIST 4 CPE_NAME)
list(GET CPE_LIST 5 CPE_VERSION) list(GET CPE_LIST 5 CPE_VERSION)
set(${CPE_DEPNAME} "${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}") set(${CPE_DEPNAME} "${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}")
set(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION},,,\n") set(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION},,,\n")
endif() endif()
endforeach() endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/cve_check.csv.in ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv @ONLY) configure_file(${CMAKE_SOURCE_DIR}/cmake/cve_check.csv.in ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv @ONLY)

View File

@@ -10,44 +10,43 @@ function(download_source dep)
if(PACKAGE_USE_UPSTREAM_SOURCES) if(PACKAGE_USE_UPSTREAM_SOURCES)
set(TARGET_URI ${${dep}_URI}) set(TARGET_URI ${${dep}_URI})
elseif(BLENDER_VERSION) elseif(BLENDER_VERSION)
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE}) set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE})
else() else()
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE}) set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
endif() endif()
# Validate all required variables are set and give an explicit error message # Validate all required variables are set and give an explicit error message
# rather than CMake erroring out later on with a more ambigious error. # rather than CMake erroring out later on with a more ambigious error.
if(NOT DEFINED TARGET_FILE) if (NOT DEFINED TARGET_FILE)
message(FATAL_ERROR "${dep}_FILE variable not set") message(FATAL_ERROR "${dep}_FILE variable not set")
endif() endif()
if(NOT DEFINED TARGET_HASH) if (NOT DEFINED TARGET_HASH)
message(FATAL_ERROR "${dep}_HASH variable not set") message(FATAL_ERROR "${dep}_HASH variable not set")
endif() endif()
if(NOT DEFINED TARGET_HASH_TYPE) if (NOT DEFINED TARGET_HASH_TYPE)
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set") message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
endif() endif()
if(NOT DEFINED TARGET_URI) if (NOT DEFINED TARGET_URI)
message(FATAL_ERROR "${dep}_URI variable not set") message(FATAL_ERROR "${dep}_URI variable not set")
endif() endif()
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE}) set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
message("Checking source : ${dep} (${TARGET_FILE})") message("Checking source : ${dep} (${TARGET_FILE})")
if(NOT EXISTS ${TARGET_FILE}) if(NOT EXISTS ${TARGET_FILE})
message("Checking source : ${dep} - source not found downloading from ${TARGET_URI}") message("Checking source : ${dep} - source not found downloading from ${TARGET_URI}")
file( file(DOWNLOAD ${TARGET_URI} ${TARGET_FILE}
DOWNLOAD ${TARGET_URI} ${TARGET_FILE} TIMEOUT 1800 # seconds
TIMEOUT 1800 # seconds EXPECTED_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
EXPECTED_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH} TLS_VERIFY ON
TLS_VERIFY ON SHOW_PROGRESS
SHOW_PROGRESS )
)
endif() endif()
if(EXISTS ${TARGET_FILE}) if(EXISTS ${TARGET_FILE})
# Sometimes the download fails, but that is not a # Sometimes the download fails, but that is not a
# fail condition for "file(DOWNLOAD" it will warn about # fail condition for "file(DOWNLOAD" it will warn about
# a CRC mismatch and just carry on, we need to explicitly # a crc mismatch and just carry on, we need to explicitly
# catch this and remove the bogus 0 byte file so we can # catch this and remove the bogus 0 byte file so we can
# retry without having to go find the file and manually # retry without having to go find the file and manually
# delete it. # delete it.
file(SIZE ${TARGET_FILE} TARGET_SIZE) file (SIZE ${TARGET_FILE} TARGET_SIZE)
if(${TARGET_SIZE} EQUAL 0) if(${TARGET_SIZE} EQUAL 0)
file(REMOVE ${TARGET_FILE}) file(REMOVE ${TARGET_FILE})
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...") message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")

View File

@@ -2,7 +2,7 @@
# LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with # LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with
# MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms # MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms
# for now. # for now.
string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " DPCPP_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}") string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " DPCPP_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
if(WIN32) if(WIN32)

View File

@@ -15,11 +15,10 @@ set(EMBREE_EXTRA_ARGS
-DTBB_ROOT=${LIBDIR}/tbb -DTBB_ROOT=${LIBDIR}/tbb
) )
if(NOT BLENDER_PLATFORM_ARM) if (NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS} ${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2 -DEMBREE_MAX_ISA=AVX2)
)
endif() endif()
if(TBB_STATIC_LIBRARY) if(TBB_STATIC_LIBRARY)
@@ -53,17 +52,17 @@ if(WIN32)
) )
else() else()
ExternalProject_Add_Step(external_embree after_install ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -26,6 +26,5 @@ endif()
add_dependencies( add_dependencies(
external_epoxy external_epoxy
# Needed for `MESON`.
external_python_site_packages external_python_site_packages
) )

View File

@@ -1,55 +1,9 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32) 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(temp_LIBDIR ${mingw_LIBDIR}) 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")
else() set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(temp_LIBDIR ${LIBDIR}) 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:)
endif()
set(FFMPEG_CFLAGS "\
-I${temp_LIBDIR}/lame/include \
-I${temp_LIBDIR}/openjpeg/include/ \
-I${temp_LIBDIR}/ogg/include \
-I${temp_LIBDIR}/vorbis/include \
-I${temp_LIBDIR}/theora/include \
-I${temp_LIBDIR}/opus/include \
-I${temp_LIBDIR}/vpx/include \
-I${temp_LIBDIR}/x264/include \
-I${temp_LIBDIR}/xvidcore/include \
-I${temp_LIBDIR}/zlib/include \
-I${temp_LIBDIR}/aom/include"
)
set(FFMPEG_LDFLAGS "\
-L${temp_LIBDIR}/lame/lib \
-L${temp_LIBDIR}/openjpeg/lib \
-L${temp_LIBDIR}/ogg/lib \
-L${temp_LIBDIR}/vorbis/lib \
-L${temp_LIBDIR}/theora/lib \
-L${temp_LIBDIR}/opus/lib \
-L${temp_LIBDIR}/vpx/lib \
-L${temp_LIBDIR}/x264/lib \
-L${temp_LIBDIR}/xvidcore/lib \
-L${temp_LIBDIR}/zlib/lib \
-L${temp_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=\
${temp_LIBDIR}/openjpeg/lib/pkgconfig:\
${temp_LIBDIR}/x264/lib/pkgconfig:\
${temp_LIBDIR}/vorbis/lib/pkgconfig:\
${temp_LIBDIR}/ogg/lib/pkgconfig:\
${temp_LIBDIR}/vpx/lib/pkgconfig:\
${temp_LIBDIR}/theora/lib/pkgconfig:\
${temp_LIBDIR}/openjpeg/lib/pkgconfig:\
${temp_LIBDIR}/opus/lib/pkgconfig:\
${temp_LIBDIR}/aom/lib/pkgconfig"
)
unset(temp_LIBDIR)
if(WIN32) if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&) set(FFMPEG_ENV set ${FFMPEG_ENV} &&)

View File

@@ -32,10 +32,9 @@ add_dependencies(
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_freetype after_install ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
# harfbuzz *NEEDS* to find freetype.lib and will not be conviced to take alternative names so just give it # harfbuzz *NEEDS* to find freetype.lib and will not be conviced to take alternative names so just give it
# what it wants. # what it wants.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/freetype/lib/freetype2st.lib ${LIBDIR}/freetype/lib/freetype.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/freetype/lib/freetype2st.lib ${LIBDIR}/freetype/lib/freetype.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -18,7 +18,6 @@ ExternalProject_Add(external_fribidi
add_dependencies( add_dependencies(
external_fribidi external_fribidi
external_python external_python
# Needed for `MESON`.
external_python_site_packages external_python_site_packages
) )

View File

@@ -22,14 +22,6 @@ elseif(UNIX AND NOT APPLE)
) )
endif() endif()
# Boolean crashes with Arm assembly, see T103423.
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
)
endif()
ExternalProject_Add(external_gmp ExternalProject_Add(external_gmp
URL file://${PACKAGE_DIR}/${GMP_FILE} URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -48,21 +40,19 @@ endif()
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
DEPENDEES install DEPENDEES install
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug AND WIN32) if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_gmp after_install ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -5,12 +5,7 @@ if(WIN32)
set(HARFBUZZ_PKG_ENV FREETYPE_DIR=${LIBDIR}/freetype) set(HARFBUZZ_PKG_ENV FREETYPE_DIR=${LIBDIR}/freetype)
else() else()
set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV}) set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV})
set(HARFBUZZ_PKG_ENV "PKG_CONFIG_PATH=\ set(HARFBUZZ_PKG_ENV PKG_CONFIG_PATH=${LIBDIR}/freetype/lib/pkgconfig:${LIBDIR}/brotli/lib/pkgconfig:$PKG_CONFIG_PATH)
${LIBDIR}/freetype/lib/pkgconfig:\
${LIBDIR}/brotli/lib/pkgconfig:\
${LIBDIR}/lib/python3.10/pkgconfig:\
$PKG_CONFIG_PATH"
)
endif() endif()
set(HARFBUZZ_EXTRA_OPTIONS set(HARFBUZZ_EXTRA_OPTIONS
@@ -18,9 +13,6 @@ set(HARFBUZZ_EXTRA_OPTIONS
-Dfreetype=enabled -Dfreetype=enabled
-Dglib=disabled -Dglib=disabled
-Dgobject=disabled -Dgobject=disabled
# Only used for command line utilities,
# disable as this would add an addition & unnecessary build-dependency.
-Dcairo=disabled
) )
ExternalProject_Add(external_harfbuzz ExternalProject_Add(external_harfbuzz
@@ -28,16 +20,8 @@ ExternalProject_Add(external_harfbuzz
URL_HASH ${HARFBUZZ_HASH_TYPE}=${HARFBUZZ_HASH} URL_HASH ${HARFBUZZ_HASH_TYPE}=${HARFBUZZ_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/harfbuzz PREFIX ${BUILD_DIR}/harfbuzz
CONFIGURE_COMMAND ${HARFBUZZ_CONFIGURE_ENV} && CONFIGURE_COMMAND ${HARFBUZZ_CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E env ${HARFBUZZ_PKG_ENV} ${CMAKE_COMMAND} -E env ${HARFBUZZ_PKG_ENV} ${MESON} setup --prefix ${LIBDIR}/harfbuzz ${HARFBUZZ_EXTRA_OPTIONS} --default-library static --libdir lib ${BUILD_DIR}/harfbuzz/src/external_harfbuzz-build ${BUILD_DIR}/harfbuzz/src/external_harfbuzz
${MESON} setup
--prefix ${LIBDIR}/harfbuzz ${HARFBUZZ_EXTRA_OPTIONS}
--default-library static
--libdir lib
${BUILD_DIR}/harfbuzz/src/external_harfbuzz-build
${BUILD_DIR}/harfbuzz/src/external_harfbuzz
BUILD_COMMAND ninja BUILD_COMMAND ninja
INSTALL_COMMAND ninja install INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/harfbuzz INSTALL_DIR ${LIBDIR}/harfbuzz
@@ -46,8 +30,6 @@ ExternalProject_Add(external_harfbuzz
add_dependencies( add_dependencies(
external_harfbuzz external_harfbuzz
external_python external_python
external_freetype
# Needed for `MESON`.
external_python_site_packages external_python_site_packages
) )
@@ -59,3 +41,4 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -11,301 +11,259 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results add_custom_target(Harvest_Release_Results
COMMAND # JPEG rename lib-file + copy include. 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 ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# PNG. # png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib && ${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/ && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# FREEGLUT -> OPENGL. # freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib && ${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/ && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
DEPENDS
)
endif()
DEPENDS 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}
) )
endif()
else()
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
PATTERN "meson*" EXCLUDE
)
endif()
endfunction()
# Set rpath on shared libraries to $ORIGIN since all will be installed in the same
# lib folder, and remove any absolute paths.
#
# Ideally this would be done as part of the Blender build since it makes assumptions
# about where the files will be installed. However it would add patchelf as a new
# dependency for building.
#
# Also removes versioned symlinks, which give errors with macOS notarization.
if(APPLE)
set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path)
else() else()
set(set_rpath_cmd patchelf --set-rpath $ORIGIN) install(
endif() DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
function(harvest_rpath_lib from to pattern) USE_SOURCE_PERMISSIONS
harvest(${from} ${to} ${pattern}) FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
install(CODE "\ PATTERN "cmake" EXCLUDE
cmake_policy(SET CMP0009 NEW)\n PATTERN "__pycache__" EXCLUDE
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n PATTERN "tests" EXCLUDE
foreach(f \${shared_libs}) \n PATTERN "meson*" EXCLUDE
if(IS_SYMLINK \${f})\n
if(APPLE)\n
file(REMOVE_RECURSE \${f})
endif()\n
else()\n
execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
endif()\n
endforeach()")
endfunction()
# Set rpath on utility binaries assuming they are run from their install location.
function(harvest_rpath_bin from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
endforeach()")
endfunction()
# Set rpath on Python module to point to the shared libraries folder in the Blender
# installation.
function(harvest_rpath_python from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
foreach(f \${shared_libs}) \n
if(IS_SYMLINK \${f})\n
if(APPLE)\n
file(REMOVE_RECURSE \${f})
endif()\n
else()\n
get_filename_component(f_dir \${f} DIRECTORY) \n
file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
endif()\n
endforeach()")
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest_rpath_bin(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
harvest(imath/include imath/include "*.h")
harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
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(fribidi/include fribidi/include "*.h")
harvest(fribidi/lib fribidi/lib "*.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(harfbuzz/include harfbuzz/include "*.h")
harvest(harfbuzz/lib harfbuzz/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 "*${SHAREDLIBEXT}*")
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 "libomp.dylib")
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(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"
) )
endif()
endfunction()
# Set rpath on shared libraries to $ORIGIN since all will be installed in the same
# lib folder, and remove any absolute paths.
#
# Ideally this would be done as part of the Blender build since it makes assumptions
# about where the files will be installed. However it would add patchelf as a new
# dependency for building.
if(APPLE)
set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path)
else()
set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
endif()
function(harvest_rpath_lib from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
cmake_policy(SET CMP0009 NEW)\n
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
if(NOT IS_SYMLINK \${f})\n
execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
endif()\n
endforeach()")
endfunction()
# Set rpath on utility binaries assuming they are run from their install location.
function(harvest_rpath_bin from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
endforeach()")
endfunction()
# Set rpath on Python module to point to the shared libraries folder in the Blender
# installation.
function(harvest_rpath_python from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
foreach(f \${shared_libs}) \n
get_filename_component(f_dir \${f} DIRECTORY) \n
file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
endforeach()")
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_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
harvest(imath/include imath/include "*.h")
harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
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(fribidi/include fribidi/include "*.h")
harvest(fribidi/lib fribidi/lib "*.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(harfbuzz/include harfbuzz/include "*.h")
harvest(harfbuzz/lib harfbuzz/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 "*${SHAREDLIBEXT}*")
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(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") harvest(wayland/bin wayland/bin "wayland-scanner")
harvest(wayland/include wayland/include "*.h") harvest(wayland/include wayland/include "*.h")
harvest(wayland_libdecor/include wayland_libdecor/include "*.h") harvest(wayland_libdecor/include wayland_libdecor/include "*.h")
else() else()
harvest(blosc/lib openvdb/lib "*.a") harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a") harvest(xml2/lib opencollada/lib "*.a")
endif() endif()
harvest(opencollada/include/opencollada opencollada/include "*.h") harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a") harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h") harvest(opencolorio/include opencolorio/include "*.h")
harvest_rpath_lib(opencolorio/lib opencolorio/lib "*${SHAREDLIBEXT}*") harvest_rpath_lib(opencolorio/lib opencolorio/lib "*${SHAREDLIBEXT}*")
harvest_rpath_python( harvest_rpath_python(opencolorio/lib/python${PYTHON_SHORT_VERSION} python/lib/python${PYTHON_SHORT_VERSION} "*")
opencolorio/lib/python${PYTHON_SHORT_VERSION} harvest(openexr/include openexr/include "*.h")
python/lib/python${PYTHON_SHORT_VERSION} harvest_rpath_lib(openexr/lib openexr/lib "*${SHAREDLIBEXT}*")
"*" harvest_rpath_bin(openimageio/bin openimageio/bin "idiff")
) harvest_rpath_bin(openimageio/bin openimageio/bin "maketx")
harvest(openexr/include openexr/include "*.h") harvest_rpath_bin(openimageio/bin openimageio/bin "oiiotool")
harvest_rpath_lib(openexr/lib openexr/lib "*${SHAREDLIBEXT}*") harvest(openimageio/include openimageio/include "*")
harvest_rpath_bin(openimageio/bin openimageio/bin "idiff") harvest_rpath_lib(openimageio/lib openimageio/lib "*${SHAREDLIBEXT}*")
harvest_rpath_bin(openimageio/bin openimageio/bin "maketx") harvest_rpath_python(openimageio/lib/python${PYTHON_SHORT_VERSION} python/lib/python${PYTHON_SHORT_VERSION} "*")
harvest_rpath_bin(openimageio/bin openimageio/bin "oiiotool") harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimageio/include openimageio/include "*") harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest_rpath_lib(openimageio/lib openimageio/lib "*${SHAREDLIBEXT}*") harvest(embree/include embree/include "*.h")
harvest_rpath_python( harvest(embree/lib embree/lib "*.a")
openimageio/lib/python${PYTHON_SHORT_VERSION} harvest(openpgl/include openpgl/include "*.h")
python/lib/python${PYTHON_SHORT_VERSION} 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(openimagedenoise/include openimagedenoise/include "*") harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a") harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(embree/include embree/include "*.h") harvest_rpath_lib(opensubdiv/lib opensubdiv/lib "*${SHAREDLIBEXT}*")
harvest(embree/lib embree/lib "*.a") harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest(openpgl/include openpgl/include "*.h") harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
harvest(openpgl/lib openpgl/lib "*.a") harvest_rpath_lib(openvdb/lib openvdb/lib "*${SHAREDLIBEXT}*")
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake") harvest_rpath_python(openvdb/lib/python${PYTHON_SHORT_VERSION} python/lib/python${PYTHON_SHORT_VERSION} "*pyopenvdb*")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h") harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a") harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h") harvest(osl/bin osl/bin "oslc")
harvest_rpath_lib(opensubdiv/lib opensubdiv/lib "*${SHAREDLIBEXT}*") harvest(osl/include osl/include "*.h")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") harvest(osl/lib osl/lib "*.a")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h") harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest_rpath_lib(openvdb/lib openvdb/lib "*${SHAREDLIBEXT}*") harvest(png/include png/include "*.h")
harvest_rpath_python( harvest(png/lib png/lib "*.a")
openvdb/lib/python${PYTHON_SHORT_VERSION} harvest(pugixml/include pugixml/include "*.hpp")
python/lib/python${PYTHON_SHORT_VERSION} harvest(pugixml/lib pugixml/lib "*.a")
"*pyopenvdb*" harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
) harvest(python/include python/include "*h")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") harvest(python/lib python/lib "*")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") harvest(sdl/include/SDL2 sdl/include "*.h")
harvest_rpath_bin(osl/bin osl/bin "oslc") harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(osl/include osl/include "*.h") harvest(sndfile/include sndfile/include "*.h")
harvest(osl/lib osl/lib "*.a") harvest(sndfile/lib sndfile/lib "*.a")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h") harvest(spnav/include spnav/include "*.h")
harvest(png/include png/include "*.h") harvest(spnav/lib spnav/lib "*.a")
harvest(png/lib png/lib "*.a") harvest(tbb/include tbb/include "*.h")
harvest(pugixml/include pugixml/include "*.hpp") harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}")
harvest(pugixml/lib pugixml/lib "*.a") harvest(theora/lib ffmpeg/lib "*.a")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}") harvest(tiff/include tiff/include "*.h")
harvest(python/include python/include "*h") harvest(tiff/lib tiff/lib "*.a")
harvest(python/lib python/lib "*") harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(sdl/include/SDL2 sdl/include "*.h") harvest(opus/lib ffmpeg/lib "*.a")
harvest(sdl/lib sdl/lib "libSDL2.a") harvest(vpx/lib ffmpeg/lib "*.a")
harvest(sndfile/include sndfile/include "*.h") harvest(x264/lib ffmpeg/lib "*.a")
harvest(sndfile/lib sndfile/lib "*.a") harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(spnav/include spnav/include "*.h") harvest(aom/lib ffmpeg/lib "*.a")
harvest(spnav/lib spnav/lib "*.a") harvest(webp/lib webp/lib "*.a")
harvest(tbb/include tbb/include "*.h") harvest(webp/include webp/include "*.h")
harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}") harvest(usd/include usd/include "*.h")
harvest(theora/lib ffmpeg/lib "*.a") harvest_rpath_lib(usd/lib usd/lib "libusd_ms${SHAREDLIBEXT}")
harvest(tiff/include tiff/include "*.h") harvest(usd/lib/usd usd/lib/usd "*")
harvest(tiff/lib tiff/lib "*.a") harvest_rpath_python(usd/lib/python/pxr python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr "*")
harvest(vorbis/lib ffmpeg/lib "*.a") harvest(usd/plugin usd/plugin "*")
harvest(opus/lib ffmpeg/lib "*.a") harvest(materialx/include materialx/include "*.h")
harvest(vpx/lib ffmpeg/lib "*.a") harvest(materialx/lib materialx/lib "*")
harvest(x264/lib ffmpeg/lib "*.a") harvest(materialx/libraries materialx/libraries "*")
harvest(xvidcore/lib ffmpeg/lib "*.a") harvest(materialx/python materialx/python "*")
harvest(aom/lib ffmpeg/lib "*.a") harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
harvest(webp/lib webp/lib "*.a") harvest_rpath_python(materialx/python/MaterialX python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX "*")
harvest(webp/include webp/include "*.h") # We do not need anything from the resources folder, but the MaterialX config
harvest(usd/include usd/include "*.h") # file will complain if the folder does not exist, so just copy the readme.md
harvest_rpath_lib(usd/lib usd/lib "libusd_ms${SHAREDLIBEXT}") # files to ensure the folder will exist.
harvest(usd/lib/usd usd/lib/usd "*") harvest(materialx/resources materialx/resources "README.md")
harvest_rpath_python( harvest(potrace/include potrace/include "*.h")
usd/lib/python/pxr harvest(potrace/lib potrace/lib "*.a")
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr harvest(haru/include haru/include "*.h")
"*" harvest(haru/lib haru/lib "*.a")
) harvest(zstd/include zstd/include "*.h")
harvest(usd/plugin usd/plugin "*") harvest(zstd/lib zstd/lib "*.a")
harvest(materialx/include materialx/include "*.h")
harvest_rpath_lib(materialx/lib materialx/lib "*${SHAREDLIBEXT}*") if(UNIX AND NOT APPLE)
harvest(materialx/libraries materialx/libraries "*") harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")
harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake") harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*")
harvest_rpath_python(
materialx/python/MaterialX harvest(dpcpp dpcpp "*")
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX harvest(igc dpcpp/lib/igc "*")
"*" harvest(ocloc dpcpp/lib/ocloc "*")
) endif()
# We do not need anything from the resources folder, but the MaterialX config
# file will complain if the folder does not exist, so just copy the readme.md
# files to ensure the folder will exist.
harvest(materialx/resources materialx/resources "README.md")
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")
harvest(shaderc shaderc "*")
harvest(vulkan_headers vulkan "*")
harvest_rpath_lib(vulkan_loader/lib vulkan/lib "*${SHAREDLIBEXT}*")
if(APPLE)
harvest(vulkan_loader/loader vulkan/loader "*")
endif()
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")
harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*")
harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()
endif() endif()

View File

@@ -34,21 +34,21 @@ elseif(UNIX)
endif() endif()
set(ISPC_EXTRA_ARGS set(ISPC_EXTRA_ARGS
-DISPC_NO_DUMPS=On -DISPC_NO_DUMPS=On
-DISPC_INCLUDE_EXAMPLES=Off -DISPC_INCLUDE_EXAMPLES=Off
-DISPC_INCLUDE_TESTS=Off -DISPC_INCLUDE_TESTS=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm -DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib -DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang -DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++ -DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++
-DISPC_INCLUDE_TESTS=Off -DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib -DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include -DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include
-DPython3_ROOT_DIR=${LIBDIR}/python/ -DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY} -DPython3_EXECUTABLE=${PYTHON_BINARY}
${ISPC_EXTRA_ARGS_WIN} ${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE} ${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX} ${ISPC_EXTRA_ARGS_UNIX}
) )
ExternalProject_Add(external_ispc ExternalProject_Add(external_ispc

View File

@@ -42,7 +42,7 @@ endif()
# LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with # LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with
# MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms # MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms
# for now. # for now.
string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " LLVM_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}") string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " LLVM_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
# short project name due to long filename issues on windows # short project name due to long filename issues on windows

View File

@@ -33,8 +33,6 @@ set(MESA_EXTRA_FLAGS
# At some point we will likely want to support Wayland. # At some point we will likely want to support Wayland.
# Disable for now since it's not officially supported. # Disable for now since it's not officially supported.
-Dplatforms=x11 -Dplatforms=x11
# Needed to find the local expat.
--pkg-config-path=${LIBDIR}/expat/lib/pkgconfig
--native-file ${BUILD_DIR}/mesa/tmp/native-file.ini --native-file ${BUILD_DIR}/mesa/tmp/native-file.ini
) )
@@ -55,8 +53,4 @@ add_dependencies(
external_mesa external_mesa
ll ll
external_zlib external_zlib
# Run-time dependency.
external_expat
# Needed for `MESON`.
external_python_site_packages
) )

View File

@@ -26,9 +26,9 @@ else()
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2 -DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
) )
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2s.lib) list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2s.lib)
else() else()
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib) list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib)
endif() endif()
set(PATCH_MAYBE_DOS2UNIX_CMD) set(PATCH_MAYBE_DOS2UNIX_CMD)
endif() endif()

View File

@@ -105,10 +105,10 @@ if(WIN32)
) )
endif() endif()
else() else()
ExternalProject_Add_Step(external_opencolorio after_install ExternalProject_Add_Step(external_opencolorio after_install
COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/ COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/ COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/pystring/lib/libpystring.a ${LIBDIR}/opencolorio/lib/ COMMAND cp ${LIBDIR}/pystring/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -39,10 +39,8 @@ if(MSVC)
) )
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openjpeg_msvc after_install ExternalProject_Add_Step(external_openjpeg_msvc after_install
COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -4,10 +4,10 @@
# library itself does not depend on them, so should give no problems. # library itself does not depend on them, so should give no problems.
set(OPENPGL_EXTRA_ARGS set(OPENPGL_EXTRA_ARGS
-DOPENPGL_BUILD_STATIC=ON -DOPENPGL_BUILD_STATIC=ON
-DOPENPGL_TBB_ROOT=${LIBDIR}/tbb -DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb -DTBB_ROOT=${LIBDIR}/tbb
-DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_DEBUG_POSTFIX=_d
) )
if(TBB_STATIC_LIBRARY) if(TBB_STATIC_LIBRARY)
@@ -18,17 +18,17 @@ if(TBB_STATIC_LIBRARY)
endif() endif()
ExternalProject_Add(external_openpgl ExternalProject_Add(external_openpgl
URL file://${PACKAGE_DIR}/${OPENPGL_FILE} URL file://${PACKAGE_DIR}/${OPENPGL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH} URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH}
PREFIX ${BUILD_DIR}/openpgl PREFIX ${BUILD_DIR}/openpgl
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openpgl INSTALL_DIR ${LIBDIR}/openpgl
) )
add_dependencies( add_dependencies(
external_openpgl external_openpgl
external_tbb external_tbb
) )
if(WIN32) if(WIN32)

View File

@@ -117,7 +117,7 @@ else()
set(LIBEXT ".a") set(LIBEXT ".a")
set(LIBPREFIX "lib") set(LIBPREFIX "lib")
set(MESON ${LIBDIR}/python/bin/meson) set(MESON ${LIBDIR}/python/bin/meson)
if(APPLE) if(APPLE)
set(SHAREDLIBEXT ".dylib") set(SHAREDLIBEXT ".dylib")
# Use same Xcode detection as Blender itself. # Use same Xcode detection as Blender itself.

View File

@@ -15,8 +15,8 @@ if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
) )
if(WIN32) if(WIN32)
ExternalProject_Add_Step(external_potrace after_install ExternalProject_Add_Step(external_potrace after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/potrace ${HARVEST_TARGET}/potrace COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/potrace ${HARVEST_TARGET}/potrace
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -2,36 +2,37 @@
if(WIN32) if(WIN32)
if(MSVC14) # vs2015 has timespec if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ") set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ")
else() # everything before doesn't else() # everything before doesn't
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ") set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ")
endif() endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS}) set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS})
ExternalProject_Add(external_pthreads ExternalProject_Add(external_pthreads
URL file://${PACKAGE_DIR}/${PTHREADS_FILE} URL file://${PACKAGE_DIR}/${PTHREADS_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PTHREADS_HASH_TYPE}=${PTHREADS_HASH} URL_HASH ${PTHREADS_HASH_TYPE}=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo . CONFIGURE_COMMAND echo .
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD} BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/_ptw32.h ${LIBDIR}/pthreads/inc/_ptw32.h ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/_ptw32.h ${LIBDIR}/pthreads/inc/_ptw32.h
INSTALL_DIR ${LIBDIR}/pthreads INSTALL_DIR ${LIBDIR}/pthreads
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pthreads after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib
DEPENDEES install
) )
endif()
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pthreads after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib
DEPENDEES install
)
endif()
endif() endif()

View File

@@ -32,11 +32,13 @@ if(WIN32)
# Python will download its own deps and there's very little we can do about # Python will download its own deps and there's very little we can do about
# that beyond placing some code in their externals dir before it tries. # that beyond placing some code in their externals dir before it tries.
# the foldernames *HAVE* to match the ones inside pythons get_externals.cmd. # the foldernames *HAVE* to match the ones inside pythons get_externals.cmd.
# python 3.10.8 still ships zlib 1.2.12, replace it with our 1.2.13
# copy until they update. Same rules apply to openssl foldernames HAVE to match
# regardless of the version actually in there. # regardless of the version actually in there.
PATCH_COMMAND mkdir ${PYTHON_EXTERNALS_FOLDER_DOS} && PATCH_COMMAND mkdir ${PYTHON_EXTERNALS_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\zlib-1.2.13 ${ZLIB_SOURCE_FOLDER_DOS} && mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\zlib-1.2.12 ${ZLIB_SOURCE_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\openssl-1.1.1q ${SSL_SOURCE_FOLDER_DOS} && mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\openssl-1.1.1q ${SSL_SOURCE_FOLDER_DOS} &&
${CMAKE_COMMAND} -E copy ${ZLIB_SOURCE_FOLDER}/../external_zlib-build/zconf.h ${PYTHON_EXTERNALS_FOLDER}/zlib-1.2.13/zconf.h && ${CMAKE_COMMAND} -E copy ${ZLIB_SOURCE_FOLDER}/../external_zlib-build/zconf.h ${PYTHON_EXTERNALS_FOLDER}/zlib-1.2.12/zconf.h &&
${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff
CONFIGURE_COMMAND echo "." CONFIGURE_COMMAND echo "."
BUILD_COMMAND ${CONFIGURE_ENV_MSVC} && cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && set LDFLAGS=/DEBUG && call prepare_ssl.bat && call build.bat -e -p x64 -c ${BUILD_MODE} BUILD_COMMAND ${CONFIGURE_ENV_MSVC} && cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && set LDFLAGS=/DEBUG && call prepare_ssl.bat && call build.bat -e -p x64 -c ${BUILD_MODE}

View File

@@ -5,11 +5,7 @@ if(WIN32 AND BUILD_MODE STREQUAL Debug)
# zstandard is determined to build and link release mode libs in a debug # zstandard is determined to build and link release mode libs in a debug
# configuration, the only way to make it happy is to bend to its will # configuration, the only way to make it happy is to bend to its will
# and give it a library to link with. # and give it a library to link with.
set( set(PIP_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.lib ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib)
PIP_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.lib
${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib
)
else() else()
set(PIP_CONFIGURE_COMMAND echo ".") set(PIP_CONFIGURE_COMMAND echo ".")
endif() endif()
@@ -19,23 +15,7 @@ ExternalProject_Add(external_python_site_packages
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND} CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND}
BUILD_COMMAND "" BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} autopep8==${AUTOPEP8_VERSION} pycodestyle==${PYCODESTYLE_VERSION} toml==${TOML_VERSION} meson==${MESON_VERSION} --no-binary :all:
# setuptools is downgraded to 63.2.0 (same as python 3.10.8) since numpy 1.23.x seemingly has
# issues building on windows with the newer versions that ships with python 3.10.9+
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA}
setuptools==63.2.0
cython==${CYTHON_VERSION}
idna==${IDNA_VERSION}
charset-normalizer==${CHARSET_NORMALIZER_VERSION}
urllib3==${URLLIB3_VERSION}
certifi==${CERTIFI_VERSION}
requests==${REQUESTS_VERSION}
zstandard==${ZSTANDARD_VERSION}
autopep8==${AUTOPEP8_VERSION}
pycodestyle==${PYCODESTYLE_VERSION}
toml==${TOML_VERSION}
meson==${MESON_VERSION}
--no-binary :all:
) )
if(USE_PIP_NUMPY) if(USE_PIP_NUMPY)

View File

@@ -1,5 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(SHADERC_EXTRA_ARGS set(SHADERC_EXTRA_ARGS
-DSHADERC_SKIP_TESTS=On -DSHADERC_SKIP_TESTS=On
-DSHADERC_SPIRV_TOOLS_DIR=${BUILD_DIR}/shaderc_spirv_tools/src/external_shaderc_spirv_tools -DSHADERC_SPIRV_TOOLS_DIR=${BUILD_DIR}/shaderc_spirv_tools/src/external_shaderc_spirv_tools
@@ -45,3 +60,5 @@ if(WIN32)
) )
endif() endif()
endif() endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# These are build time requirements for shaderc. We only have to unpack these # These are build time requirements for shaderc. We only have to unpack these
# shaderc will build them. # shaderc will build them.
@@ -32,3 +48,4 @@ ExternalProject_Add(external_shaderc_spirv_tools
BUILD_COMMAND echo . BUILD_COMMAND echo .
INSTALL_COMMAND echo . INSTALL_COMMAND echo .
) )

View File

@@ -1,15 +1,9 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
set(SNDFILE_EXTRA_ARGS) set(SNDFILE_EXTRA_ARGS)
set(SNDFILE_ENV) set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32) if(WIN32)
set(SNDFILE_ENV "PKG_CONFIG_PATH=\
${mingw_LIBDIR}/ogg/lib/pkgconfig:\
${mingw_LIBDIR}/vorbis/lib/pkgconfig:\
${mingw_LIBDIR}/flac/lib/pkgconfig:\
${mingw_LIBDIR}/opus/lib/pkgconfig"
)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&) set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
# Shared for windows because static libs will drag in a libgcc dependency. # Shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared ) set(SNDFILE_OPTIONS --disable-static --enable-shared )
@@ -47,10 +41,10 @@ endif()
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_sndfile after_install ExternalProject_Add_Step(external_sndfile after_install
COMMAND lib /def:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.def /machine:x64 /out:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib COMMAND lib /def:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.def /machine:x64 /out:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h
DEPENDEES install DEPENDEES install
) )

View File

@@ -5,20 +5,7 @@ ExternalProject_Add(external_spnav
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SPNAV_HASH_TYPE}=${SPNAV_HASH} URL_HASH ${SPNAV_HASH_TYPE}=${SPNAV_HASH}
PREFIX ${BUILD_DIR}/spnav PREFIX ${BUILD_DIR}/spnav
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/spnav --disable-shared --enable-static --with-pic
CONFIGURE_COMMAND
${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/spnav/src/external_spnav/ &&
${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/spnav
# X11 is not needed as Blender polls the device as part of the GHOST event loop.
# This is used to support `3dxserv`, however this is no longer supported by 3DCONNEXION.
# Disable so building without X11 is supported (WAYLAND only).
--disable-x11
--disable-shared
--enable-static
--with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/spnav/src/external_spnav/ && make install
INSTALL_DIR ${LIBDIR}/spnav INSTALL_DIR ${LIBDIR}/spnav

View File

@@ -10,9 +10,9 @@ if(WIN32)
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SSL_HASH_TYPE}=${SSL_HASH} URL_HASH ${SSL_HASH_TYPE}=${SSL_HASH}
PREFIX ${BUILD_DIR}/ssl PREFIX ${BUILD_DIR}/ssl
CONFIGURE_COMMAND echo "." CONFIGURE_COMMAND echo "."
BUILD_COMMAND echo "." BUILD_COMMAND echo "."
INSTALL_COMMAND echo "." INSTALL_COMMAND echo "."
INSTALL_DIR ${LIBDIR}/ssl INSTALL_DIR ${LIBDIR}/ssl
) )
else() else()
@@ -46,4 +46,4 @@ else()
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ssl/src/external_ssl/ && make install
INSTALL_DIR ${LIBDIR}/ssl INSTALL_DIR ${LIBDIR}/ssl
) )
endif() endif()

View File

@@ -29,13 +29,12 @@ elseif(UNIX)
set(USD_PLATFORM_FLAGS set(USD_PLATFORM_FLAGS
-DPYTHON_INCLUDE_DIR=${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/ -DPYTHON_INCLUDE_DIR=${LIBDIR}/python/include/python${PYTHON_SHORT_VERSION}/
-DPYTHON_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${SHAREDLIBEXT} -DPYTHON_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${SHAREDLIBEXT}
) )
if(APPLE) if(APPLE)
set(USD_SHARED_LINKER_FLAGS "-Xlinker -undefined -Xlinker dynamic_lookup") set(USD_SHARED_LINKER_FLAGS "-Xlinker -undefined -Xlinker dynamic_lookup")
list(APPEND USD_PLATFORM_FLAGS list(APPEND USD_PLATFORM_FLAGS
-DCMAKE_SHARED_LINKER_FLAGS=${USD_SHARED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS=${USD_SHARED_LINKER_FLAGS})
)
endif() endif()
endif() endif()
@@ -113,7 +112,7 @@ add_dependencies(
# Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a". # Since USD 21.11 the libraries are prefixed with "usd_", i.e. "libusd_m.a" became "libusd_usd_m.a".
# See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01 # See https://github.com/PixarAnimationStudios/USD/blob/release/CHANGELOG.md#2111---2021-11-01
if(NOT WIN32) if(NOT WIN32)
if(USD_VERSION VERSION_LESS 21.11) if (USD_VERSION VERSION_LESS 21.11)
set(PXR_LIB_PREFIX "") set(PXR_LIB_PREFIX "")
else() else()
set(PXR_LIB_PREFIX "usd_") set(PXR_LIB_PREFIX "usd_")

View File

@@ -195,20 +195,12 @@ set(TIFF_HASH_TYPE MD5)
set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz) set(TIFF_FILE tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*") set(TIFF_CPE "cpe:2.3:a:libtiff:libtiff:${TIFF_VERSION}:*:*:*:*:*:*:*")
# Recent commit from 1.13.0.2 under development, which includes string table set(OSL_VERSION 1.12.7.1)
# changes that make the Cycles OptiX implementation work. Official 1.12 OSL set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/v${OSL_VERSION}.tar.gz)
# releases should also build but without OptiX support. set(OSL_HASH 53211da86c34ba6e0344998c1a6d219c)
set(OSL_VERSION 1a7670600c8b08c2443a78d03c8c27e9a1149140)
set(OSL_URI https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/archive/${OSL_VERSION}.tar.gz)
set(OSL_HASH 7b6d6716b05d1addb92a8f47280bf77f)
set(OSL_HASH_TYPE MD5) set(OSL_HASH_TYPE MD5)
set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz) set(OSL_FILE OpenShadingLanguage-${OSL_VERSION}.tar.gz)
# NOTE: When updating the python version, it's required to check the versions of
# it wants to use in PCbuild/get_externals.bat for the following dependencies:
# BZIP2, FFI, SQLITE and change the versions in this file as well. For compliance
# reasons there can be no exceptions to this.
set(PYTHON_VERSION 3.10.9) set(PYTHON_VERSION 3.10.9)
set(PYTHON_SHORT_VERSION 3.10) set(PYTHON_SHORT_VERSION 3.10)
set(PYTHON_SHORT_VERSION_NO_DOTS 310) set(PYTHON_SHORT_VERSION_NO_DOTS 310)
@@ -232,40 +224,26 @@ set(OPENVDB_HASH 64301c737e16b26c8f3085a31e6397e9)
set(OPENVDB_HASH_TYPE MD5) set(OPENVDB_HASH_TYPE MD5)
set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz) set(OPENVDB_FILE openvdb-${OPENVDB_VERSION}.tar.gz)
# ------------------------------------------------------------------------------
# Python Modules
# Needed by: `requests` module (so the version doesn't change on rebuild).
set(IDNA_VERSION 3.3) set(IDNA_VERSION 3.3)
# Needed by: `requests` module (so the version doesn't change on rebuild).
set(CHARSET_NORMALIZER_VERSION 2.0.10) set(CHARSET_NORMALIZER_VERSION 2.0.10)
# Needed by: `requests` module (so the version doesn't change on rebuild).
set(URLLIB3_VERSION 1.26.8) set(URLLIB3_VERSION 1.26.8)
set(URLLIB3_CPE "cpe:2.3:a:urllib3:urllib3:${URLLIB3_VERSION}:*:*:*:*:*:*:*") set(URLLIB3_CPE "cpe:2.3:a:urllib3:urllib3:${URLLIB3_VERSION}:*:*:*:*:*:*:*")
# Needed by: Python's `requests` module (so add-ons can authenticate against trusted certificates).
set(CERTIFI_VERSION 2021.10.8) set(CERTIFI_VERSION 2021.10.8)
# Needed by: Some of Blender's add-ons (to support convenient interaction with online services).
set(REQUESTS_VERSION 2.27.1) set(REQUESTS_VERSION 2.27.1)
# Needed by: Python's `numpy` module (used by some add-ons).
set(CYTHON_VERSION 0.29.30) set(CYTHON_VERSION 0.29.30)
# Needed by: Python scripts that read `.blend` files, as files may use Z-standard compression. # The version of the zstd library used to build the Python package should match ZSTD_VERSION
# The version of the ZSTD library used to build the Python package should match ZSTD_VERSION
# defined below. At this time of writing, 0.17.0 was already released, # defined below. At this time of writing, 0.17.0 was already released,
# but built against ZSTD 1.5.1, while we use 1.5.0. # but built against zstd 1.5.1, while we use 1.5.0.
set(ZSTANDARD_VERSION 0.16.0) set(ZSTANDARD_VERSION 0.16.0)
# Auto-format Python source (developer tool, not used by Blender at run-time).
set(AUTOPEP8_VERSION 1.6.0) set(AUTOPEP8_VERSION 1.6.0)
# Needed by: `autopep8` (so the version doesn't change on rebuild).
set(PYCODESTYLE_VERSION 2.8.0) set(PYCODESTYLE_VERSION 2.8.0)
# Needed by: `autopep8` (so the version doesn't change on rebuild).
set(TOML_VERSION 0.10.2) set(TOML_VERSION 0.10.2)
# Build system for other packages (not used by Blender at run-time).
set(MESON_VERSION 0.63.0) set(MESON_VERSION 0.63.0)
set(NUMPY_VERSION 1.23.5) set(NUMPY_VERSION 1.23.2)
set(NUMPY_SHORT_VERSION 1.23) set(NUMPY_SHORT_VERSION 1.23)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.tar.gz) set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.tar.gz)
set(NUMPY_HASH 8b2692a511a3795f3af8af2cd7566a15) set(NUMPY_HASH 9bf2a361509797de14ceee607387fe0f)
set(NUMPY_HASH_TYPE MD5) set(NUMPY_HASH_TYPE MD5)
set(NUMPY_FILE numpy-${NUMPY_VERSION}.tar.gz) set(NUMPY_FILE numpy-${NUMPY_VERSION}.tar.gz)
set(NUMPY_CPE "cpe:2.3:a:numpy:numpy:${NUMPY_VERSION}:*:*:*:*:*:*:*") set(NUMPY_CPE "cpe:2.3:a:numpy:numpy:${NUMPY_VERSION}:*:*:*:*:*:*:*")
@@ -359,7 +337,7 @@ set(SNDFILE_VERSION 1.1.0)
set(SNDFILE_URI https://github.com/libsndfile/libsndfile/releases/download/1.1.0/libsndfile-${SNDFILE_VERSION}.tar.xz) set(SNDFILE_URI https://github.com/libsndfile/libsndfile/releases/download/1.1.0/libsndfile-${SNDFILE_VERSION}.tar.xz)
set(SNDFILE_HASH e63dead2b4f0aaf323687619d007ee6a) set(SNDFILE_HASH e63dead2b4f0aaf323687619d007ee6a)
set(SNDFILE_HASH_TYPE MD5) set(SNDFILE_HASH_TYPE MD5)
set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.xz) set(SNDFILE_FILE libsndfile-${SNDFILE_VERSION}.tar.gz)
set(SNDFILE_CPE "cpe:2.3:a:libsndfile_project:libsndfile:${SNDFILE_VERSION}:*:*:*:*:*:*:*") set(SNDFILE_CPE "cpe:2.3:a:libsndfile_project:libsndfile:${SNDFILE_VERSION}:*:*:*:*:*:*:*")
set(WEBP_VERSION 1.2.2) set(WEBP_VERSION 1.2.2)
@@ -369,9 +347,9 @@ set(WEBP_HASH_TYPE MD5)
set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz) set(WEBP_FILE libwebp-${WEBP_VERSION}.tar.gz)
set(WEBP_CPE "cpe:2.3:a:webmproject:libwebp:${WEBP_VERSION}:*:*:*:*:*:*:*") set(WEBP_CPE "cpe:2.3:a:webmproject:libwebp:${WEBP_VERSION}:*:*:*:*:*:*:*")
set(SPNAV_VERSION 1.1) set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI https://github.com/FreeSpacenav/libspnav/releases/download/v${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz) set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
set(SPNAV_HASH 7c0032034672dfba3c4bb9b49a440e70) set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
set(SPNAV_HASH_TYPE MD5) set(SPNAV_HASH_TYPE MD5)
set(SPNAV_FILE libspnav-${SPNAV_VERSION}.tar.gz) set(SPNAV_FILE libspnav-${SPNAV_VERSION}.tar.gz)
@@ -459,7 +437,9 @@ set(LZMA_HASH 5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df)
set(LZMA_HASH_TYPE SHA256) set(LZMA_HASH_TYPE SHA256)
set(LZMA_FILE xz-${LZMA_VERSION}.tar.bz2) set(LZMA_FILE xz-${LZMA_VERSION}.tar.bz2)
# NOTE: Python's build has been modified to use our ssl version. # NOTE: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat. For compliance reasons there
# can be no exceptions to this.
set(SSL_VERSION 1.1.1q) set(SSL_VERSION 1.1.1q)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz) set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca) set(SSL_HASH d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca)
@@ -470,10 +450,10 @@ set(SSL_CPE "cpe:2.3:a:openssl:openssl:${SSL_VERSION}:*:*:*:*:*:*:*")
# Note: This will *HAVE* to match the version python ships on windows which # Note: This will *HAVE* to match the version python ships on windows which
# is hardcoded in pythons PCbuild/get_externals.bat for compliance reasons there # is hardcoded in pythons PCbuild/get_externals.bat for compliance reasons there
# can be no exceptions to this. # can be no exceptions to this.
set(SQLITE_VERSION 3.39.4) set(SQLITE_VERSION 3.37.2)
set(SQLLITE_LONG_VERSION 3390400) set(SQLLITE_LONG_VERSION 3370200)
set(SQLITE_URI https://www.sqlite.org/2022/sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz) set(SQLITE_URI https://www.sqlite.org/2022/sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_HASH c4c5c39269d1b9bb1487cff580c1f583608229b2) set(SQLITE_HASH e56faacadfb4154f8fbd0f2a3f827d13706b70a1)
set(SQLITE_HASH_TYPE SHA1) set(SQLITE_HASH_TYPE SHA1)
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz) set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*") set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(VULKAN_HEADERS_EXTRA_ARGS) set(VULKAN_HEADERS_EXTRA_ARGS)
@@ -14,17 +30,6 @@ set(VULKAN_LOADER_EXTRA_ARGS
-DVULKAN_HEADERS_INSTALL_DIR=${LIBDIR}/vulkan_headers -DVULKAN_HEADERS_INSTALL_DIR=${LIBDIR}/vulkan_headers
) )
if(UNIX AND NOT APPLE)
# These are used in `cmake/FindWayland.cmake` from `external_vulkan_loader`.
# NOTE: When upgrading to CMAKE 3.22 we it would be cleaner to use: `PKG_CONFIG_ARGN`,
# so `pkgconfig` would find wayland.
set(VULKAN_LOADER_EXTRA_ARGS
${VULKAN_LOADER_EXTRA_ARGS}
-DPKG_WAYLAND_INCLUDE_DIRS=${LIBDIR}/wayland/include
-DPKG_WAYLAND_LIBRARY_DIRS=${LIBDIR}/wayland/lib64
)
endif()
ExternalProject_Add(external_vulkan_loader ExternalProject_Add(external_vulkan_loader
URL file://${PACKAGE_DIR}/${VULKAN_LOADER_FILE} URL file://${PACKAGE_DIR}/${VULKAN_LOADER_FILE}
URL_HASH ${VULKAN_LOADER_HASH_TYPE}=${VULKAN_LOADER_HASH} URL_HASH ${VULKAN_LOADER_HASH_TYPE}=${VULKAN_LOADER_HASH}
@@ -38,12 +43,7 @@ add_dependencies(
external_vulkan_headers external_vulkan_headers
) )
if(UNIX AND NOT APPLE) if(WIN32)
add_dependencies(
external_vulkan_loader
external_wayland
)
elseif(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_vulkan_loader after_install ExternalProject_Add_Step(external_vulkan_loader after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/vulkan_loader/ ${HARVEST_TARGET}/vulkan COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/vulkan_loader/ ${HARVEST_TARGET}/vulkan
@@ -52,3 +52,4 @@ elseif(WIN32)
) )
endif() endif()
endif() endif()

View File

@@ -5,6 +5,7 @@ ExternalProject_Add(external_wayland
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${WAYLAND_HASH_TYPE}=${WAYLAND_HASH} URL_HASH ${WAYLAND_HASH_TYPE}=${WAYLAND_HASH}
PREFIX ${BUILD_DIR}/wayland 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 & LIBXML2. # Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own LIBEXPAT & LIBXML2.
# #
# NOTE: passing link args "ffi/lib" should not be needed, but # NOTE: passing link args "ffi/lib" should not be needed, but
@@ -23,7 +24,4 @@ add_dependencies(
external_expat external_expat
external_xml2 external_xml2
external_ffi external_ffi
# Needed for `MESON`.
external_python_site_packages
) )

View File

@@ -15,6 +15,4 @@ ExternalProject_Add(external_wayland_protocols
add_dependencies( add_dependencies(
external_wayland_protocols external_wayland_protocols
external_wayland external_wayland
# Needed for `MESON`.
external_python_site_packages
) )

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32) if(WIN32)
set(XML2_EXTRA_ARGS set(XML2_EXTRA_ARGS
-DLIBXML2_WITH_ZLIB=OFF -DLIBXML2_WITH_ZLIB=OFF
-DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_LZMA=OFF
-DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_PYTHON=OFF

View File

@@ -10,8 +10,7 @@ if(WIN32)
set(YAMLCPP_EXTRA_ARGS set(YAMLCPP_EXTRA_ARGS
${YAMLCPP_EXTRA_ARGS} ${YAMLCPP_EXTRA_ARGS}
-DBUILD_GMOCK=OFF -DBUILD_GMOCK=OFF
-DYAML_MSVC_SHARED_RT=ON -DYAML_MSVC_SHARED_RT=ON)
)
endif() endif()
ExternalProject_Add(external_yamlcpp ExternalProject_Add(external_yamlcpp

View File

@@ -1,23 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later # macOS utility to remove all rpaths and add a new one.
# macOS utility to remove all `rpaths` and add a new one.
import os
import re
import subprocess import subprocess
import sys import sys
# Strip version numbers from dependenciesm macOS notarizatiom fails
# with version symlinks.
def strip_lib_version(name):
name = re.sub(r'(\.[0-9]+)+.dylib', '.dylib', name)
name = re.sub(r'(\.[0-9]+)+.so', '.so', name)
name = re.sub(r'(\.[0-9]+)+.cpython', '.cpython', name)
return name
rpath = sys.argv[1] rpath = sys.argv[1]
file = sys.argv[2] file = sys.argv[2]
@@ -31,18 +17,3 @@ for i, token in enumerate(tokens):
subprocess.run(['install_name_tool', '-delete_rpath', old_rpath, file]) subprocess.run(['install_name_tool', '-delete_rpath', old_rpath, file])
subprocess.run(['install_name_tool', '-add_rpath', rpath, file]) subprocess.run(['install_name_tool', '-add_rpath', rpath, file])
# Strip version from dependencies.
p = subprocess.run(['otool', '-L', file], capture_output=True)
tokens = p.stdout.split()
for i, token in enumerate(tokens):
token = token.decode("utf-8")
if token.startswith("@rpath"):
new_token = strip_lib_version(token)
subprocess.run(['install_name_tool', '-change', token, new_token, file])
# Strip version from library itself.
new_file = strip_lib_version(file)
new_id = '@rpath/' + os.path.basename(new_file)
os.rename(file, new_file)
subprocess.run(['install_name_tool', '-id', new_id, new_file])

View File

@@ -39,15 +39,15 @@ with-all,with-opencollada,with-jack,with-pulseaudio,with-embree,with-oidn,with-n
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,ver-level-zero:\ ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,ver-level-zero:\
force-all,force-python,force-boost,force-tbb,\ 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-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-materialx,force-usd,\ force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\
force-xr-openxr,force-level-zero,force-openpgl,\ force-xr-openxr,force-level-zero,force-openpgl,\
build-all,build-python,build-boost,build-tbb,\ 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-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-materialx,build-usd,\ build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
build-xr-openxr,build-level-zero,build-openpgl,\ build-xr-openxr,build-level-zero,build-openpgl,\
skip-python,skip-boost,skip-tbb,\ skip-python,skip-boost,skip-tbb,\
skip-ocio,skip-imath,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\ 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-materialx,skip-usd,\ skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\
skip-xr-openxr,skip-level-zero,skip-openpgl \ skip-xr-openxr,skip-level-zero,skip-openpgl \
-- "$@" \ -- "$@" \
) )
@@ -223,9 +223,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--build-ffmpeg --build-ffmpeg
Force the build of FFMpeg. Force the build of FFMpeg.
--build-materialx
Force the build of MaterialX.
--build-usd --build-usd
Force the build of Universal Scene Description. Force the build of Universal Scene Description.
@@ -299,9 +296,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-ffmpeg --force-ffmpeg
Force the rebuild of FFMpeg. Force the rebuild of FFMpeg.
--force-materialx
Force the rebuild of MaterialX.
--force-usd --force-usd
Force the rebuild of Universal Scene Description. Force the rebuild of Universal Scene Description.
@@ -368,9 +362,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-ffmpeg --skip-ffmpeg
Unconditionally skip FFMpeg installation/building. Unconditionally skip FFMpeg installation/building.
--skip-materialx
Unconditionally skip MaterialX installation/building.
--skip-usd --skip-usd
Unconditionally skip Universal Scene Description installation/building. Unconditionally skip Universal Scene Description installation/building.
@@ -403,7 +394,7 @@ CLANG_FORMAT_VERSION="10.0"
CLANG_FORMAT_VERSION_MIN="6.0" CLANG_FORMAT_VERSION_MIN="6.0"
CLANG_FORMAT_VERSION_MEX="14.0" CLANG_FORMAT_VERSION_MEX="14.0"
PYTHON_VERSION="3.10.9" PYTHON_VERSION="3.10.8"
PYTHON_VERSION_SHORT="3.10" PYTHON_VERSION_SHORT="3.10"
PYTHON_VERSION_MIN="3.10" PYTHON_VERSION_MIN="3.10"
PYTHON_VERSION_MEX="3.12" PYTHON_VERSION_MEX="3.12"
@@ -411,7 +402,6 @@ PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_SHORT
PYTHON_FORCE_BUILD=false PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false PYTHON_SKIP=false
_with_built_python=false
# Additional Python modules. # Additional Python modules.
PYTHON_IDNA_VERSION="3.3" PYTHON_IDNA_VERSION="3.3"
@@ -444,7 +434,7 @@ PYTHON_ZSTANDARD_VERSION_MIN="0.15.2"
PYTHON_ZSTANDARD_VERSION_MEX="0.20.0" PYTHON_ZSTANDARD_VERSION_MEX="0.20.0"
PYTHON_ZSTANDARD_NAME="zstandard" PYTHON_ZSTANDARD_NAME="zstandard"
PYTHON_NUMPY_VERSION="1.23.5" PYTHON_NUMPY_VERSION="1.22.0"
PYTHON_NUMPY_VERSION_MIN="1.14" PYTHON_NUMPY_VERSION_MIN="1.14"
PYTHON_NUMPY_VERSION_MEX="2.0" PYTHON_NUMPY_VERSION_MEX="2.0"
PYTHON_NUMPY_NAME="numpy" PYTHON_NUMPY_NAME="numpy"
@@ -472,13 +462,11 @@ PYTHON_MODULES_PIP=(
) )
BOOST_VERSION="1.80.0" BOOST_VERSION="1.78.0"
BOOST_VERSION_SHORT="1.80" BOOST_VERSION_SHORT="1.78"
BOOST_VERSION_MIN="1.49" BOOST_VERSION_MIN="1.49"
BOOST_VERSION_MEX="2.0" BOOST_VERSION_MEX="2.0"
# XXX Boost currently has an issue with python/tbb, see rB019b930 for details and patch used to fix it. BOOST_FORCE_BUILD=false
# So for now it has to be built, system packages are not usable. :(
BOOST_FORCE_BUILD=true
BOOST_FORCE_REBUILD=false BOOST_FORCE_REBUILD=false
BOOST_SKIP=false BOOST_SKIP=false
@@ -491,8 +479,8 @@ TBB_FORCE_BUILD=false
TBB_FORCE_REBUILD=false TBB_FORCE_REBUILD=false
TBB_SKIP=false TBB_SKIP=false
OCIO_VERSION="2.2.0" OCIO_VERSION="2.1.1"
OCIO_VERSION_SHORT="2.2" OCIO_VERSION_SHORT="2.1"
OCIO_VERSION_MIN="2.0" OCIO_VERSION_MIN="2.0"
OCIO_VERSION_MEX="3.0" OCIO_VERSION_MEX="3.0"
OCIO_FORCE_BUILD=false OCIO_FORCE_BUILD=false
@@ -517,10 +505,10 @@ OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false OPENEXR_SKIP=false
_with_built_openexr=false _with_built_openexr=false
OIIO_VERSION="2.4.6.0" OIIO_VERSION="2.3.20.0"
OIIO_VERSION_SHORT="2.4" OIIO_VERSION_SHORT="2.3"
OIIO_VERSION_MIN="2.2.0" OIIO_VERSION_MIN="2.1.12"
OIIO_VERSION_MEX="2.5.0" OIIO_VERSION_MEX="2.4.0"
OIIO_FORCE_BUILD=false OIIO_FORCE_BUILD=false
OIIO_FORCE_REBUILD=false OIIO_FORCE_REBUILD=false
OIIO_SKIP=false OIIO_SKIP=false
@@ -535,8 +523,8 @@ LLVM_FORCE_REBUILD=false
LLVM_SKIP=false LLVM_SKIP=false
# OSL needs to be compiled for now! # OSL needs to be compiled for now!
OSL_VERSION="1.13.0.2" OSL_VERSION="1.12.6.2"
OSL_VERSION_SHORT="1.13" OSL_VERSION_SHORT="1.12"
OSL_VERSION_MIN="1.11" OSL_VERSION_MIN="1.11"
OSL_VERSION_MEX="2.0" OSL_VERSION_MEX="2.0"
OSL_FORCE_BUILD=false OSL_FORCE_BUILD=false
@@ -544,9 +532,9 @@ OSL_FORCE_REBUILD=false
OSL_SKIP=false OSL_SKIP=false
# OpenSubdiv needs to be compiled for now # OpenSubdiv needs to be compiled for now
OSD_VERSION="3.5.0" OSD_VERSION="3.4.4"
OSD_VERSION_SHORT="3.5" OSD_VERSION_SHORT="3.4"
OSD_VERSION_MIN="3.5" OSD_VERSION_MIN="3.4"
OSD_VERSION_MEX="4.0" OSD_VERSION_MEX="4.0"
OSD_FORCE_BUILD=false OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false OSD_FORCE_REBUILD=false
@@ -555,10 +543,10 @@ OSD_SKIP=false
# OpenVDB needs to be compiled for now # OpenVDB needs to be compiled for now
OPENVDB_BLOSC_VERSION="1.21.1" OPENVDB_BLOSC_VERSION="1.21.1"
OPENVDB_VERSION="10.0.0" OPENVDB_VERSION="9.0.0"
OPENVDB_VERSION_SHORT="10.0" OPENVDB_VERSION_SHORT="9.0"
OPENVDB_VERSION_MIN="10.0" OPENVDB_VERSION_MIN="9.0"
OPENVDB_VERSION_MEX="11.0" OPENVDB_VERSION_MEX="9.1"
OPENVDB_FORCE_BUILD=false OPENVDB_FORCE_BUILD=false
OPENVDB_FORCE_REBUILD=false OPENVDB_FORCE_REBUILD=false
OPENVDB_SKIP=false OPENVDB_SKIP=false
@@ -572,16 +560,8 @@ ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false ALEMBIC_SKIP=false
MATERIALX_VERSION="1.38.6" USD_VERSION="22.03"
MATERIALX_VERSION_SHORT="1.38" USD_VERSION_SHORT="22.03"
MATERIALX_VERSION_MIN="1.38"
MATERIALX_VERSION_MEX="1.40"
MATERIALX_FORCE_BUILD=false
MATERIALX_FORCE_REBUILD=false
MATERIALX_SKIP=false
USD_VERSION="22.11"
USD_VERSION_SHORT="22.11"
USD_VERSION_MIN="20.05" USD_VERSION_MIN="20.05"
USD_VERSION_MEX="23.00" USD_VERSION_MEX="23.00"
USD_FORCE_BUILD=false USD_FORCE_BUILD=false
@@ -916,9 +896,6 @@ while true; do
--build-alembic) --build-alembic)
ALEMBIC_FORCE_BUILD=true; shift; continue ALEMBIC_FORCE_BUILD=true; shift; continue
;; ;;
--build-materialx)
MATERIALX_FORCE_BUILD=true; shift; continue
;;
--build-usd) --build-usd)
USD_FORCE_BUILD=true; shift; continue USD_FORCE_BUILD=true; shift; continue
;; ;;
@@ -948,7 +925,6 @@ while true; do
OIDN_FORCE_REBUILD=true OIDN_FORCE_REBUILD=true
FFMPEG_FORCE_REBUILD=true FFMPEG_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true ALEMBIC_FORCE_REBUILD=true
MATERIALX_FORCE_REBUILD=true
USD_FORCE_REBUILD=true USD_FORCE_REBUILD=true
XR_OPENXR_FORCE_REBUILD=true XR_OPENXR_FORCE_REBUILD=true
LEVEL_ZERO_FORCE_REBUILD=true LEVEL_ZERO_FORCE_REBUILD=true
@@ -1004,9 +980,6 @@ while true; do
--force-alembic) --force-alembic)
ALEMBIC_FORCE_REBUILD=true; shift; continue ALEMBIC_FORCE_REBUILD=true; shift; continue
;; ;;
--force-materialx)
MATERIALX_FORCE_REBUILD=true; shift; continue
;;
--force-usd) --force-usd)
USD_FORCE_REBUILD=true; shift; continue USD_FORCE_REBUILD=true; shift; continue
;; ;;
@@ -1070,9 +1043,6 @@ while true; do
--skip-usd) --skip-usd)
USD_SKIP=true; shift; continue USD_SKIP=true; shift; continue
;; ;;
--skip-materialx)
MATERIALX_SKIP=true; shift; continue
;;
--skip-xr-openxr) --skip-xr-openxr)
XR_OPENXR_SKIP=true; shift; continue XR_OPENXR_SKIP=true; shift; continue
;; ;;
@@ -1138,9 +1108,7 @@ PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHO
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'` _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/boost_$_boost_version_nodots.tar.bz2" ) BOOST_SOURCE=( "https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/boost_$_boost_version_nodots.tar.bz2" )
BOOST_BUILD_MODULES="--with-filesystem --with-locale --with-thread --with-regex --with-system --with-date_time --with-wave --with-atomic --with-serialization --with-program_options --with-iostreams --with-python" BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options --with-serialization --with-atomic"
# Used by debian distros.
BOOST_DEB_PACKAGE_MODULES=( "libboost-filesystem" "libboost-locale" "libboost-thread" "libboost-regex" "libboost-system" "libboost-date-time" "libboost-wave" "libboost-atomic" "libboost-serialization" "libboost-program-options" "libboost-iostreams" "libboost-python" "libboost-numpy" )
TBB_SOURCE=( "https://github.com/oneapi-src/oneTBB/archive/$TBB_VERSION$TBB_VERSION_UPDATE.tar.gz" ) TBB_SOURCE=( "https://github.com/oneapi-src/oneTBB/archive/$TBB_VERSION$TBB_VERSION_UPDATE.tar.gz" )
TBB_SOURCE_CMAKE=( "https://raw.githubusercontent.com/wjakob/tbb/master/CMakeLists.txt" ) TBB_SOURCE_CMAKE=( "https://raw.githubusercontent.com/wjakob/tbb/master/CMakeLists.txt" )
@@ -1170,11 +1138,17 @@ _LLVM_SOURCE_ROOT="https://github.com/llvm/llvm-project/releases/download/llvmor
LLVM_SOURCE=( "$_LLVM_SOURCE_ROOT/llvm-$LLVM_VERSION.src.tar.xz" ) LLVM_SOURCE=( "$_LLVM_SOURCE_ROOT/llvm-$LLVM_VERSION.src.tar.xz" )
LLVM_CLANG_SOURCE=( "$_LLVM_SOURCE_ROOT/clang-$LLVM_VERSION.src.tar.xz" "$_LLVM_SOURCE_ROOT/cfe-$LLVM_VERSION.src.tar.xz" ) LLVM_CLANG_SOURCE=( "$_LLVM_SOURCE_ROOT/clang-$LLVM_VERSION.src.tar.xz" "$_LLVM_SOURCE_ROOT/cfe-$LLVM_VERSION.src.tar.xz" )
OSL_USE_REPO=true OSL_USE_REPO=false
OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/v$OSL_VERSION.tar.gz" ) OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/v$OSL_VERSION.tar.gz" )
OSL_SOURCE_REPO=( "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage.git" ) #~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
OSL_SOURCE_REPO_BRANCH="main" #~ OSL_SOURCE_REPO_BRANCH="master"
OSL_SOURCE_REPO_UID="1a7670600c8b08c2443a78d03c8c27e9a1149140" #~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
#~ OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" )
#~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
#~ OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO_UID="7d40ff5fe8e47b030042afb92d0e955f5aa96f48"
#~ OSL_SOURCE_REPO_BRANCH="blender-fixes"
OSD_USE_REPO=false OSD_USE_REPO=false
# Script foo to make the version string compliant with the archive name: # Script foo to make the version string compliant with the archive name:
@@ -1197,8 +1171,6 @@ ALEMBIC_SOURCE=( "https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.
# ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb" # ALEMBIC_SOURCE_REPO_UID="e6c90d4faa32c4550adeaaf3f556dad4b73a92bb"
# ALEMBIC_SOURCE_REPO_BRANCH="master" # ALEMBIC_SOURCE_REPO_BRANCH="master"
MATERIALX_SOURCE=( "https://github.com/AcademySoftwareFoundation/MaterialX/archive/refs/tags/v${MATERIALX_VERSION}.tar.gz" )
USD_SOURCE=( "https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz" ) USD_SOURCE=( "https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz" )
OPENCOLLADA_USE_REPO=false OPENCOLLADA_USE_REPO=false
@@ -1251,10 +1223,8 @@ Those libraries should be available as packages in all recent distributions (opt
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal]. * libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed). * libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libwayland-client0, libdecor, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland) * libwayland-client0, libdecor, libwayland-cursor0, libwayland-egl1, libxkbcommon0, libdbus-1-3, libegl1 (Wayland)
* libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex, pybind11. * libsqlite3, libzstd, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp, flex.
* libsdl2, libepoxy, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf]. * libsdl2, libepoxy, libpugixml, libpotrace, [libgmp], fontconfig, [libharu/libhpdf].\""
* [libvulkan/vulkan-loader].
* [libfribidi], [libharfbuzz].\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES: DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -1515,17 +1485,9 @@ _init_python() {
_update_deps_python() { _update_deps_python() {
if [ "$1" = true ]; then if [ "$1" = true ]; then
BOOST_FORCE_BUILD=true BOOST_FORCE_BUILD=true
OCIO_FORCE_BUILD=true
OIIO_FORCE_BUILD=true
OPENVDB_FORCE_BUILD=true
USD_FORCE_BUILD=true
fi fi
if [ "$2" = true ]; then if [ "$2" = true ]; then
BOOST_FORCE_REBUILD=true BOOST_FORCE_REBUILD=true
OCIO_FORCE_REBUILD=true
OIIO_FORCE_REBUILD=true
OPENVDB_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
fi fi
} }
@@ -1611,9 +1573,6 @@ compile_Python() {
PRINT "" PRINT ""
$_python -m pip install $module --no-binary :all: $_python -m pip install $module --no-binary :all:
done done
_with_built_python=true
_with_built_python_execpath="$INST/python-$PYTHON_VERSION_SHORT/bin/python3"
} }
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@@ -1632,14 +1591,12 @@ _update_deps_boost() {
OSL_FORCE_BUILD=true OSL_FORCE_BUILD=true
OPENVDB_FORCE_BUILD=true OPENVDB_FORCE_BUILD=true
ALEMBIC_FORCE_BUILD=true ALEMBIC_FORCE_BUILD=true
USD_FORCE_BUILD=true
fi fi
if [ "$2" = true ]; then if [ "$2" = true ]; then
OIIO_FORCE_REBUILD=true OIIO_FORCE_REBUILD=true
OSL_FORCE_REBUILD=true OSL_FORCE_REBUILD=true
OPENVDB_FORCE_REBUILD=true OPENVDB_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true ALEMBIC_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
fi fi
} }
@@ -1659,7 +1616,7 @@ compile_Boost() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
boost_magic=15 boost_magic=14
_init_boost _init_boost
@@ -1685,13 +1642,11 @@ compile_Boost() {
mkdir -p $SRC mkdir -p $SRC
download BOOST_SOURCE[@] $_src.tar.bz2 download BOOST_SOURCE[@] $_src.tar.bz2
tar -C $SRC --transform "s,\w*,boost-$BOOST_VERSION,x" -xf $_src.tar.bz2 tar -C $SRC --transform "s,\w*,boost-$BOOST_VERSION,x" -xf $_src.tar.bz2
patch -d $_src -p1 < $SCRIPT_DIR/patches/boost.diff
fi fi
cd $_src cd $_src
if [ ! -f $_src/b2 ]; then if [ ! -f $_src/b2 ]; then
if [ -d $_with_built_python ]; then if [ -d $INST/python-$PYTHON_VERSION_INSTALLED ]; then
./bootstrap.sh --with-python-root="$INST/python-$PYTHON_VERSION_INSTALLED" ./bootstrap.sh --with-python-root="$INST/python-$PYTHON_VERSION_INSTALLED"
else else
./bootstrap.sh ./bootstrap.sh
@@ -1886,7 +1841,7 @@ compile_OCIO() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
ocio_magic=5 ocio_magic=3
_init_ocio _init_ocio
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -1941,13 +1896,9 @@ compile_OCIO() {
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst" cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D OCIO_BUILD_APPS=OFF" cmake_d="$cmake_d -D OCIO_BUILD_APPS=OFF"
cmake_d="$cmake_d -D OCIO_BUILD_PYTHON=ON" cmake_d="$cmake_d -D OCIO_BUILD_PYTHON=OFF"
cmake_d="$cmake_d -D OCIO_BUILD_GPU_TESTS=OFF" cmake_d="$cmake_d -D OCIO_BUILD_GPU_TESTS=OFF"
if [ "$_with_built_python" = true ]; then
cmake_d="$cmake_d -D Python_EXECUTABLE=$_with_built_python_execpath"
fi
if [ $(uname -m) == "aarch64" ]; then if [ $(uname -m) == "aarch64" ]; then
cmake_d="$cmake_d -D OCIO_USE_SSE=OFF" cmake_d="$cmake_d -D OCIO_USE_SSE=OFF"
fi fi
@@ -2137,13 +2088,11 @@ _update_deps_openexr() {
OIIO_FORCE_BUILD=true OIIO_FORCE_BUILD=true
OPENVDB_FORCE_BUILD=true OPENVDB_FORCE_BUILD=true
ALEMBIC_FORCE_BUILD=true ALEMBIC_FORCE_BUILD=true
USD_FORCE_BUILD=true
fi fi
if [ "$2" = true ]; then if [ "$2" = true ]; then
OIIO_FORCE_REBUILD=true OIIO_FORCE_REBUILD=true
OPENVDB_FORCE_REBUILD=true OPENVDB_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true ALEMBIC_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
fi fi
} }
@@ -2272,11 +2221,9 @@ _init_oiio() {
_update_deps_oiio() { _update_deps_oiio() {
if [ "$1" = true ]; then if [ "$1" = true ]; then
OSL_FORCE_BUILD=true OSL_FORCE_BUILD=true
USD_FORCE_BUILD=true
fi fi
if [ "$2" = true ]; then if [ "$2" = true ]; then
OSL_FORCE_REBUILD=true OSL_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
fi fi
} }
@@ -2296,7 +2243,7 @@ compile_OIIO() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
oiio_magic=20 oiio_magic=18
_init_oiio _init_oiio
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -2350,7 +2297,6 @@ compile_OIIO() {
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF" cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
cmake_d="$cmake_d -D LINKSTATIC=OFF" cmake_d="$cmake_d -D LINKSTATIC=OFF"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
if [ $(uname -m) != "aarch64" ]; then if [ $(uname -m) != "aarch64" ]; then
cmake_d="$cmake_d -D USE_SIMD=sse2" cmake_d="$cmake_d -D USE_SIMD=sse2"
@@ -2366,37 +2312,21 @@ compile_OIIO() {
cmake_d="$cmake_d -D OpenEXR_ROOT=$INST/openexr" cmake_d="$cmake_d -D OpenEXR_ROOT=$INST/openexr"
fi fi
cmake_d="$cmake_d -D USE_PYTHON=ON" # ptex is only needed when nicholas bishop is ready
if [ "$_with_built_python" = true ]; then cmake_d="$cmake_d -D USE_PTEX=OFF"
cmake_d="$cmake_d -D Python_EXECUTABLE=$_with_built_python_execpath"
fi
# Optional tests and cmd tools # Optional tests and cmd tools
cmake_d="$cmake_d -D USE_QT=OFF" cmake_d="$cmake_d -D USE_QT=OFF"
cmake_d="$cmake_d -D USE_QT5=OFF" cmake_d="$cmake_d -D USE_PYTHON=OFF"
cmake_d="$cmake_d -D USE_OPENGL=OFF"
cmake_d="$cmake_d -D USE_TBB=OFF"
cmake_d="$cmake_d -D USE_BZIP2=OFF"
cmake_d="$cmake_d -D USE_FREETYPE=OFF"
cmake_d="$cmake_d -D USE_OPENCOLORIO=OFF"
cmake_d="$cmake_d -D USE_WEBP=ON"
cmake_d="$cmake_d -D USE_OPENJPEG=ON"
cmake_d="$cmake_d -D USE_FFMPEG=OFF" cmake_d="$cmake_d -D USE_FFMPEG=OFF"
cmake_d="$cmake_d -D USE_OPENCV=OFF" cmake_d="$cmake_d -D USE_OPENCV=OFF"
cmake_d="$cmake_d -D USE_OPENVDB=OFF" cmake_d="$cmake_d -D USE_OPENVDB=OFF"
cmake_d="$cmake_d -D USE_NUKE=OFF"
cmake_d="$cmake_d -D USE_DCMTK=OFF"
cmake_d="$cmake_d -D USE_LIBHEIF=OFF"
cmake_d="$cmake_d -D USE_GIF=OFF"
cmake_d="$cmake_d -D USE_LIBRAW=OFF"
cmake_d="$cmake_d -D USE_LIBSQUISH=OFF"
cmake_d="$cmake_d -D BUILD_TESTING=OFF" cmake_d="$cmake_d -D BUILD_TESTING=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF" cmake_d="$cmake_d -D OIIO_BUILD_TESTS=OFF"
cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=ON" cmake_d="$cmake_d -D OIIO_BUILD_TOOLS=OFF"
cmake_d="$cmake_d -D TXT2MAN=" cmake_d="$cmake_d -D TXT2MAN="
#cmake_d="$cmake_d -D CMAKE_EXPORT_COMPILE_COMMANDS=ON"
#cmake_d="$cmake_d -D CMAKE_VERBOSE_MAKEFILE=ON"
if [ -d $INST/boost ]; then if [ -d $INST/boost ]; then
cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON -D Boost_NO_BOOST_CMAKE=ON" cmake_d="$cmake_d -D BOOST_ROOT=$INST/boost -D Boost_NO_SYSTEM_PATHS=ON -D Boost_NO_BOOST_CMAKE=ON"
@@ -2474,7 +2404,7 @@ compile_LLVM() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
llvm_magic=4 llvm_magic=3
_init_llvm _init_llvm
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -2523,9 +2453,9 @@ compile_LLVM() {
mkdir build mkdir build
cd build cd build
LLVM_TARGETS="X86;NVPTX" LLVM_TARGETS="X86"
if [ $(uname -m) == "aarch64" ]; then if [ $(uname -m) == "aarch64" ]; then
LLVM_TARGETS="AArch64;NVPTX" LLVM_TARGETS="AArch64"
fi fi
cmake_d="-D CMAKE_BUILD_TYPE=Release" cmake_d="-D CMAKE_BUILD_TYPE=Release"
@@ -2592,7 +2522,7 @@ compile_OSL() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
osl_magic=22 osl_magic=21
_init_osl _init_osl
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -2623,9 +2553,8 @@ compile_OSL() {
INFO "Unpacking OpenShadingLanguage-$OSL_VERSION" INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \ tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
-xf $_src.tar.gz -xf $_src.tar.gz
patch -d $_src -p1 < $SCRIPT_DIR/patches/osl.diff
fi fi
patch -d $_src -p1 < $SCRIPT_DIR/patches/osl.diff
fi fi
cd $_src cd $_src
@@ -2637,8 +2566,6 @@ compile_OSL() {
# Stick to same rev as windows' libs... # Stick to same rev as windows' libs...
git checkout $OSL_SOURCE_REPO_UID git checkout $OSL_SOURCE_REPO_UID
git reset --hard git reset --hard
patch -d $_src -p1 < $SCRIPT_DIR/patches/osl.diff
fi fi
# Always refresh the whole build! # Always refresh the whole build!
@@ -2954,12 +2881,7 @@ _init_openvdb() {
} }
_update_deps_openvdb() { _update_deps_openvdb() {
if [ "$1" = true ]; then :
USD_FORCE_BUILD=true
fi
if [ "$2" = true ]; then
USD_FORCE_REBUILD=true
fi
} }
clean_OPENVDB() { clean_OPENVDB() {
@@ -2981,7 +2903,7 @@ compile_OPENVDB() {
PRINT "" PRINT ""
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
openvdb_magic=5 openvdb_magic=4
_init_openvdb _init_openvdb
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -3030,18 +2952,12 @@ compile_OPENVDB() {
cmake_d="-D CMAKE_BUILD_TYPE=Release" cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D USE_STATIC_DEPENDENCIES=OFF" cmake_d="$cmake_d -D USE_STATIC_DEPENDENCIES=OFF"
cmake_d="$cmake_d -D OPENVDB_CORE_SHARED=ON"
cmake_d="$cmake_d -D OPENVDB_CORE_STATIC=OFF"
cmake_d="$cmake_d -D OPENVDB_BUILD_BINARIES=OFF" cmake_d="$cmake_d -D OPENVDB_BUILD_BINARIES=OFF"
if [ "$WITH_NANOVDB" = true ]; then if [ "$WITH_NANOVDB" = true ]; then
cmake_d="$cmake_d -D USE_NANOVDB=ON" cmake_d="$cmake_d -D USE_NANOVDB=ON"
cmake_d="$cmake_d -D OPENVDB_BUILD_NANOVDB=ON"
cmake_d="$cmake_d -D NANOVDB_BUILD_TOOLS=OFF"
else else
cmake_d="$cmake_d -D USE_NANOVDB=OFF" cmake_d="$cmake_d -D USE_NANOVDB=OFF"
cmake_d="$cmake_d -D OPENVDB_BUILD_NANOVDB=OFF"
cmake_d="$cmake_d -D NANOVDB_BUILD_TOOLS=OFF"
fi fi
if [ -d $INST/boost ]; then if [ -d $INST/boost ]; then
@@ -3053,9 +2969,6 @@ compile_OPENVDB() {
fi fi
if [ -d $INST/tbb ]; then if [ -d $INST/tbb ]; then
cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb" cmake_d="$cmake_d -D TBB_ROOT=$INST/tbb"
# Work around until we use oneTBB, otherwise OpenVDB forcefully
# uses oneTBB if it can find it on the system.
cmake_d="$cmake_d -D Tbb_INCLUDE_DIR=$INST/tbb/include"
fi fi
if [ "$_with_built_imath" = true ]; then if [ "$_with_built_imath" = true ]; then
@@ -3069,13 +2982,6 @@ compile_OPENVDB() {
cmake_d="$cmake_d -D Blosc_ROOT=$INST/blosc" cmake_d="$cmake_d -D Blosc_ROOT=$INST/blosc"
fi fi
cmake_d="$cmake_d -D OPENVDB_BUILD_PYTHON_MODULE=ON"
cmake_d="$cmake_d -D OPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON"
cmake_d="$cmake_d -D USE_NUMPY=ON"
if [ "$_with_built_python" = true ]; then
cmake_d="$cmake_d -D Python_EXECUTABLE=$_with_built_python_execpath"
fi
cmake $cmake_d .. cmake $cmake_d ..
make -j$THREADS install make -j$THREADS install
@@ -3213,103 +3119,6 @@ compile_ALEMBIC() {
run_ldconfig "alembic" run_ldconfig "alembic"
} }
#### Build materialX ####
_init_materialx() {
_src=$SRC/MaterialX-$MATERIALX_VERSION
_git=false
_inst=$INST/materialx-$MATERIALX_VERSION_SHORT
_inst_shortcut=$INST/materialx
}
_update_deps_materialx() {
:
}
clean_MATERIALX() {
_init_materialx
if [ -d $_inst ]; then
# Force rebuilding the dependencies if needed.
_update_deps_materialx false true
fi
_clean
}
compile_MATERIALX() {
if [ "$NO_BUILD" = true ]; then
WARNING "--no-build enabled, MaterialX will not be compiled!"
return
fi
# To be changed each time we make edits that would modify the compiled result!
materialx_magic=1
_init_materialx
# Force having own builds for the dependencies.
_update_deps_materialx true false
# Clean install if needed!
magic_compile_check materialx-$MATERIALX_VERSION $materialx_magic
if [ $? -eq 1 -o "$MATERIALX_FORCE_REBUILD" = true ]; then
clean_MATERIALX
fi
if [ ! -d $_inst ]; then
INFO "Building MaterialX-$MATERIALX_VERSION"
# Force rebuilding the dependencies.
_update_deps_materialx true true
prepare_inst
if [ ! -d $_src ]; then
mkdir -p $SRC
download MATERIALX_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking MaterialX-$MATERIALX_VERSION"
tar -C $SRC -xf $_src.tar.gz
patch -d $_src -p1 < $SCRIPT_DIR/patches/materialx.diff
fi
cd $_src
cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -DMATERIALX_BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -DCMAKE_DEBUG_POSTFIX=_d"
cmake_d="$cmake_d -DMATERIALX_BUILD_RENDER=OFF"
cmake_d="$cmake_d -DMATERIALX_BUILD_PYTHON=ON"
cmake_d="$cmake_d -DMATERIALX_INSTALL_PYTHON=OFF"
if [ "$_with_built_python" = true ]; then
cmake_d="$cmake_d -D Python_EXECUTABLE=$_with_built_python_execpath"
fi
cmake $cmake_d ./
make -j$THREADS install
make clean
if [ ! -d $_inst ]; then
ERROR "MaterialX-$MATERIALX_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set materialx-$MATERIALX_VERSION $materialx_magic
cd $CWD
INFO "Done compiling MaterialX-$MATERIALX_VERSION!"
else
INFO "Own MaterialX-$MATERIALX_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-materialx option."
fi
if [ -d $_inst ]; then
_create_inst_shortcut
fi
run_ldconfig "materialx"
}
#### Build USD #### #### Build USD ####
_init_usd() { _init_usd() {
_src=$SRC/USD-$USD_VERSION _src=$SRC/USD-$USD_VERSION
@@ -3338,7 +3147,7 @@ compile_USD() {
fi fi
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
usd_magic=2 usd_magic=1
_init_usd _init_usd
# Force having own builds for the dependencies. # Force having own builds for the dependencies.
@@ -3372,46 +3181,18 @@ compile_USD() {
cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="-D CMAKE_INSTALL_PREFIX=$_inst"
# For the reasoning behind these options, please see usd.cmake. # For the reasoning behind these options, please see usd.cmake.
if [ -d $INST/boost ]; then if [ -d $INST/boost ]; then
cmake_d="$cmake_d -DBOOST_ROOT=$INST/boost" cmake_d="$cmake_d $cmake_d -D BOOST_ROOT=$INST/boost"
fi fi
if [ -d $INST/tbb ]; then if [ -d $INST/tbb ]; then
cmake_d="$cmake_d -DTBB_ROOT_DIR=$INST/tbb" cmake_d="$cmake_d $cmake_d -D TBB_ROOT_DIR=$INST/tbb"
fi fi
cmake_d="$cmake_d -DPXR_ENABLE_PYTHON_SUPPORT=OFF"
cmake_d="$cmake_d -DPXR_ENABLE_PYTHON_SUPPORT=ON" cmake_d="$cmake_d -DPXR_BUILD_IMAGING=OFF"
cmake_d="$cmake_d -DPXR_USE_PYTHON_3=ON"
if [ "$_with_built_python" = true ]; then
cmake_d="$cmake_d -D PYTHON_EXECUTABLE=$_with_built_python_execpath"
fi
cmake_d="$cmake_d -DPXR_BUILD_IMAGING=ON"
cmake_d="$cmake_d -DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON"
if [ -d $INST/openexr ]; then
cmake_d="$cmake_d -DOPENEXR_LOCATION=$INST/openexr"
fi
if [ -d $INST/oiio ]; then
cmake_d="$cmake_d -DOpenImageIO_ROOT=$INST/oiio"
fi
cmake_d="$cmake_d -DPXR_ENABLE_OPENVDB_SUPPORT=ON"
if [ -d $INST/openvdb ]; then
cmake_d="$cmake_d -DOPENVDB_LOCATION=$INST/openvdb"
fi
cmake_d="$cmake_d -DPXR_ENABLE_GL_SUPPORT=ON"
cmake_d="$cmake_d -DPXR_BUILD_TESTS=OFF" cmake_d="$cmake_d -DPXR_BUILD_TESTS=OFF"
cmake_d="$cmake_d -DPXR_BUILD_EXAMPLES=OFF"
cmake_d="$cmake_d -DPXR_BUILD_TUTORIALS=OFF"
cmake_d="$cmake_d -DPXR_BUILD_USD_TOOLS=OFF"
cmake_d="$cmake_d -DPXR_ENABLE_HDF5_SUPPORT=OFF"
cmake_d="$cmake_d -DPXR_ENABLE_MATERIALX_SUPPORT=OFF"
cmake_d="$cmake_d -DPXR_BUILD_USDVIEW=OFF"
cmake_d="$cmake_d -DPXR_BUILD_MONOLITHIC=ON"
cmake_d="$cmake_d -DBUILD_SHARED_LIBS=ON" cmake_d="$cmake_d -DBUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -DPXR_BUILD_MONOLITHIC=ON"
cmake_d="$cmake_d -DPXR_BUILD_USD_TOOLS=OFF"
cmake_d="$cmake_d -DCMAKE_DEBUG_POSTFIX=_d" cmake_d="$cmake_d -DCMAKE_DEBUG_POSTFIX=_d"
cmake $cmake_d ./ cmake $cmake_d ./
@@ -4424,12 +4205,11 @@ install_DEB() {
git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \ git libfreetype6-dev libfontconfig-dev libx11-dev flex bison libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \ libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libwayland-dev libdecor-0-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \ libwayland-dev libdecor-0-dev wayland-protocols libegl-dev libxkbcommon-dev libdbus-1-dev linux-libc-dev \
libvulkan-dev libshaderc-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \ libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libepoxy-dev yasm pybind11-dev \ libopenal-dev libepoxy-dev yasm \
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \ libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev \
libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev \ libgmp-dev libpugixml-dev libpotrace-dev libhpdf-dev libzstd-dev libpystring-dev \
libglfw3-dev libfribidi-dev libharfbuzz-dev" libglfw3-dev"
VORBIS_USE=true VORBIS_USE=true
OGG_USE=true OGG_USE=true
@@ -4613,7 +4393,7 @@ install_DEB() {
boost_version=$(echo `get_package_version_DEB libboost-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/') boost_version=$(echo `get_package_version_DEB libboost-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_DEB ${BOOST_DEB_PACKAGE_MODULES[@]/%/$boost_version-dev} install_packages_DEB libboost-{filesystem,iostreams,locale,regex,system,thread,wave,program-options}$boost_version-dev
clean_Boost clean_Boost
else else
compile_Boost compile_Boost
@@ -4805,16 +4585,6 @@ install_DEB() {
compile_ALEMBIC compile_ALEMBIC
fi fi
PRINT ""
if [ "$MATERIALX_SKIP" = true ]; then
WARNING "Skipping MaterialX installation, as requested..."
elif [ "$MATERIALX_FORCE_BUILD" = true ]; then
INFO "Forced MaterialX building, as requested..."
compile_MATERIALX
else
compile_MATERIALX
fi
PRINT "" PRINT ""
if [ "$USD_SKIP" = true ]; then if [ "$USD_SKIP" = true ]; then
WARNING "Skipping USD installation, as requested..." WARNING "Skipping USD installation, as requested..."
@@ -5158,12 +4928,10 @@ install_RPM() {
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \ libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \ libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
wayland-devel libdecor-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \ wayland-devel libdecor-devel wayland-protocols-devel mesa-libEGL-devel libxkbcommon-devel dbus-devel kernel-headers \
vulkan-loader-devel libshaderc-devel \
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \ wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
libepoxy-devel yasm patch pybind11-devel \ libepoxy-devel yasm patch \
libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \ libxml2-devel yaml-cpp-devel tinyxml-devel jemalloc-devel \
gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel pystring-devel \ gmp-devel pugixml-devel potrace-devel libharu-devel libzstd-devel pystring-devel"
fribidi-devel harfbuzz-devel"
OPENJPEG_USE=true OPENJPEG_USE=true
VORBIS_USE=true VORBIS_USE=true
@@ -5544,16 +5312,6 @@ install_RPM() {
compile_ALEMBIC compile_ALEMBIC
fi fi
PRINT ""
if [ "$MATERIALX_SKIP" = true ]; then
WARNING "Skipping MaterialX installation, as requested..."
elif [ "$MATERIALX_FORCE_BUILD" = true ]; then
INFO "Forced MaterialX building, as requested..."
compile_MATERIALX
else
compile_MATERIALX
fi
PRINT "" PRINT ""
if [ "$USD_SKIP" = true ]; then if [ "$USD_SKIP" = true ]; then
WARNING "Skipping USD installation, as requested..." WARNING "Skipping USD installation, as requested..."
@@ -5824,10 +5582,9 @@ install_ARCH() {
_packages="$BASE_DEVEL git cmake fontconfig flex \ _packages="$BASE_DEVEL git cmake fontconfig flex \
libxi libxcursor libxrandr libxinerama libepoxy libdecor libpng libtiff wget openal \ libxi libxcursor libxrandr libxinerama libepoxy libdecor libpng libtiff wget openal \
vulkan-icd-loader vulkan-headers shaderc \ $OPENJPEG_DEV yasm sdl2 fftw \
$OPENJPEG_DEV yasm sdl2 fftw pybind11 \
libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \ libxml2 yaml-cpp tinyxml python-requests jemalloc gmp potrace pugixml libharu \
zstd pystring fribidi harfbuzz" zstd pystring"
OPENJPEG_USE=true OPENJPEG_USE=true
VORBIS_USE=true VORBIS_USE=true
@@ -6159,16 +5916,6 @@ install_ARCH() {
compile_ALEMBIC compile_ALEMBIC
fi fi
PRINT ""
if [ "$MATERIALX_SKIP" = true ]; then
WARNING "Skipping MaterialX installation, as requested..."
elif [ "$MATERIALX_FORCE_BUILD" = true ]; then
INFO "Forced MaterialX building, as requested..."
compile_MATERIALX
else
compile_MATERIALX
fi
PRINT "" PRINT ""
if [ "$USD_SKIP" = true ]; then if [ "$USD_SKIP" = true ]; then
WARNING "Skipping USD installation, as requested..." WARNING "Skipping USD installation, as requested..."
@@ -6460,27 +6207,6 @@ install_OTHER() {
fi fi
PRINT ""
if [ "$MATERIALX_SKIP" = true ]; then
WARNING "Skipping MaterialX installation, as requested..."
elif [ "$MATERIALX_FORCE_BUILD" = true ]; then
INFO "Forced MaterialX building, as requested..."
compile_MATERIALX
else
compile_MATERIALX
fi
PRINT ""
if [ "$USD_SKIP" = true ]; then
WARNING "Skipping USD installation, as requested..."
elif [ "$USD_FORCE_BUILD" = true ]; then
INFO "Forced USD building, as requested..."
compile_USD
else
compile_USD
fi
if [ "$WITH_OPENCOLLADA" = true ]; then if [ "$WITH_OPENCOLLADA" = true ]; then
PRINT "" PRINT ""
if [ "$OPENCOLLADA_SKIP" = true ]; then if [ "$OPENCOLLADA_SKIP" = true ]; then
@@ -6558,8 +6284,7 @@ print_info() {
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*" _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 *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*" _buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *BLOSC* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
_buildargs="$_buildargs -U *MATERIALX* -U *USD*"
_buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR* -U *OPENPGL*" _buildargs="$_buildargs -U *EMBREE* -U *OPENIMAGEDENOISE* -U *OPENXR* -U *OPENPGL*"
_1="-D WITH_CODEC_SNDFILE=ON" _1="-D WITH_CODEC_SNDFILE=ON"
@@ -6746,17 +6471,6 @@ print_info() {
fi fi
fi fi
if [ "$MATERIALX_SKIP" = false ]; then
_1="-D WITH_MATERIALX=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/materialx ]; then
_1="-D MaterialX_DIR=$INST/materialx/lib/cmake/MaterialX"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$USD_SKIP" = false ]; then if [ "$USD_SKIP" = false ]; then
_1="-D WITH_USD=ON" _1="-D WITH_USD=ON"
PRINT " $_1" PRINT " $_1"

View File

@@ -11,31 +11,19 @@ if [ `id -u` -ne 0 ]; then
exit 1 exit 1
fi fi
# Required by: config manager command below to enable powertools. # yum-config-manager does not come in the default minimal install,
dnf install 'dnf-command(config-manager)'
# Packages `ninja-build` and `meson` are not available unless CBR or PowerTools repositories are enabled.
# See: https://wiki.rockylinux.org/rocky/repo/#notes-on-unlisted-repositories
dnf config-manager --set-enabled powertools
# Required by: epel-release has the patchelf and rubygem-asciidoctor packages
dnf install epel-release
# `yum-config-manager` does not come in the default minimal install,
# so make sure it is installed and available. # so make sure it is installed and available.
yum -y update yum -y update
yum -y install yum-utils yum -y install yum-utils
# Install all the packages needed for a new tool-chain. # Install all the packages needed for a new toolchain.
# #
# NOTE: Keep this separate from the packages install, since otherwise # NOTE: Keep this separate from the packages install, since otherwise
# older tool-chain will be installed. # older toolchain will be installed.
yum -y update yum -y update
yum -y install scl-utils yum -y install epel-release
yum -y install scl-utils-build yum -y install centos-release-scl
yum -y install devtoolset-9
# Currently this is defined by the VFX platform (CY2023), see: https://vfxplatform.com
yum -y install gcc-toolset-11
# Install packages needed for Blender's dependencies. # Install packages needed for Blender's dependencies.
PACKAGES_FOR_LIBS=( PACKAGES_FOR_LIBS=(
@@ -59,12 +47,19 @@ PACKAGES_FOR_LIBS=(
automake automake
libtool libtool
# TODO: why is this needed? # Meta-build system used by various packages.
patchelf meson
# Builds generated by meson use Ninja for the actual build. # Builds generated by meson use Ninja for the actual build.
ninja-build ninja-build
# Required by Blender build option: `WITH_GHOST_X11`.
libXrandr-devel
libXinerama-devel
libXcursor-devel
libXi-devel
libX11-devel
libXt-devel
# Required by Blender build option: `WITH_GHOST_WAYLAND`. # Required by Blender build option: `WITH_GHOST_WAYLAND`.
mesa-libEGL-devel mesa-libEGL-devel
# Required by: Blender & `external_opensubdiv` (probably others). # Required by: Blender & `external_opensubdiv` (probably others).
@@ -84,47 +79,52 @@ PACKAGES_FOR_LIBS=(
# Why are both needed? # Why are both needed?
yasm yasm
# NOTE(@campbellbarton): while `python39` is available, the default Python version is 3.6. # Required by: `meson` (Python based build system).
# This is used for the `python3-mako` package for e.g. python36
# So use the "default" system Python since it means it's most compatible with other packages. # Required by: `mako` (Python module used for building `external_mesa`)
python3 python-setuptools
# Required by: `external_mesa`.
python3-mako
# Required by: `external_mesa`.
expat-devel
# Required by: `external_igc` & `external_osl` as a build-time dependency. # Required by: `external_igc` & `external_osl` as a build-time dependency.
bison bison
# Required by: `external_osl` as a build-time dependency. # Required by: `external_osl` as a build-time dependency.
flex flex
# TODO: dependencies build without this, consider removal.
# Required by: `external_ispc`.
ncurses-devel ncurses-devel
# Required by: `external_ispc` (when building with CLANG).
libstdc++-static
) )
# Additional packages needed for building Blender. # Additional packages needed for building Blender.
PACKAGES_FOR_BLENDER=( PACKAGES_FOR_BLENDER=(
# Required by Blender build option: `WITH_GHOST_WAYLAND`. # Required by Blender build option: `WITH_GHOST_WAYLAND`.
libxkbcommon-devel libxkbcommon-devel
# Required by Blender build option: `WITH_GHOST_X11`.
libX11-devel
libXcursor-devel
libXi-devel
libXinerama-devel
libXrandr-devel
libXt-devel
libXxf86vm-devel
) )
yum -y install -y ${PACKAGES_FOR_LIBS[@]} ${PACKAGES_FOR_BLENDER[@]} yum -y install -y ${PACKAGES_FOR_LIBS[@]} ${PACKAGES_FOR_BLENDER[@]}
# Dependencies for pip (needed for `buildbot-worker`), uses Python3.6. # Dependencies for Mesa
yum -y install python3 python3-pip python3-devel 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. # Dependencies for asound.
yum -y install -y \ yum -y install -y \
alsa-lib-devel pulseaudio-libs-devel 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

View File

@@ -1,12 +0,0 @@
--- a/boost/python//detail/wrap_python.hpp 2022-12-09 19:16:17
+++ b/boost/python//detail/wrap_python.hpp 2022-12-09 19:18:08
@@ -206,7 +206,8 @@
#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
-# define _DEBUG
+// BLENDER: TBB excepts this to have a value.
+# define _DEBUG 1
# ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
# undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
# undef _CRT_NOFORCE_MANIFEST

View File

@@ -90,25 +90,3 @@ diff -Naur orig/openvdb/openvdb/tree/ValueAccessor.h openvdb/openvdb/openvdb/tre
CacheItem(TreeCacheT& parent) CacheItem(TreeCacheT& parent)
: mParent(&parent) : mParent(&parent)
diff --git a/nanovdb/nanovdb/NanoVDB.h b/nanovdb/nanovdb/NanoVDB.h
index f7fc304..fde5c47 100644
--- a/nanovdb/nanovdb/NanoVDB.h
+++ b/nanovdb/nanovdb/NanoVDB.h
@@ -1877,7 +1877,7 @@ __hostdev__ static inline uint32_t FindLowestOn(uint64_t v)
{
NANOVDB_ASSERT(v);
#if (defined(__CUDA_ARCH__) || defined(__HIP__)) && defined(NANOVDB_USE_INTRINSICS)
- return __ffsll(v);
+ return __ffsll(static_cast<unsigned long long int>(v));
#elif defined(_MSC_VER) && defined(NANOVDB_USE_INTRINSICS)
unsigned long index;
_BitScanForward64(&index, v);
@@ -2592,7 +2592,7 @@ public:
///
/// @note This method is only defined for IndexGrid = NanoGrid<ValueIndex>
template <typename T = BuildType>
- __hostdev__ typename enable_if<is_same<T, ValueIndex>::value, uint64_t>::type valueCount() const {return DataType::mData1;}
+ __hostdev__ typename enable_if<is_same<T, ValueIndex>::value, const uint64_t&>::type valueCount() const {return DataType::mData1;}
/// @brief Return a const reference to the tree
__hostdev__ const TreeT& tree() const { return *reinterpret_cast<const TreeT*>(this->treePtr()); }

View File

@@ -36,39 +36,3 @@ index a97a755..07ce853 100644
if (self.compiler.find_library_file(self.lib_dirs, lib_name)): if (self.compiler.find_library_file(self.lib_dirs, lib_name)):
ffi_lib = lib_name ffi_lib = lib_name
break break
--- a/Modules/posixmodule.c 2022-12-09 21:44:03
+++ b/Modules/posixmodule.c 2022-12-09 21:39:46
@@ -10564,10 +10564,15 @@
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_MKFIFOAT
if (dir_fd != DEFAULT_DIR_FD) {
+// BLENDER: disable also at compile time for compatibility when linking with older Xcode.
+// https://github.com/python/cpython/issues/97897
+#ifndef __APPLE__
if (HAVE_MKFIFOAT_RUNTIME) {
result = mkfifoat(dir_fd, path->narrow, mode);
+ } else
+#endif
+ {
- } else {
mkfifoat_unavailable = 1;
result = 0;
}
@@ -10638,10 +10633,15 @@
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_MKNODAT
if (dir_fd != DEFAULT_DIR_FD) {
+// BLENDER: disable also at compile time for compatibility when linking with older Xcode.
+// https://github.com/python/cpython/issues/97897
+#ifndef __APPLE__
if (HAVE_MKNODAT_RUNTIME) {
result = mknodat(dir_fd, path->narrow, mode, device);
+ } else
+#endif
+ {
- } else {
mknodat_unavailable = 1;
result = 0;
}

View File

@@ -30,19 +30,3 @@ diff -ru ./src/video/SDL_video.c ./src/video/SDL_video.c
if (SDL_strcmp(_this->name, "cocoa") == 0) { /* don't do this for X11, etc */ if (SDL_strcmp(_this->name, "cocoa") == 0) { /* don't do this for X11, etc */
if (Cocoa_IsWindowInFullscreenSpace(window)) { if (Cocoa_IsWindowInFullscreenSpace(window)) {
return SDL_FALSE; return SDL_FALSE;
--- CMakeLists.txt 2022-12-09 20:40:00
+++ CMakeLists.txt 2022-12-09 20:40:00
@@ -526,6 +526,13 @@
list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
endif()
+ # BLENDER: make libs compatible with older Xcode.
+ # https://github.com/KhronosGroup/MoltenVK/issues/1756
+ check_c_compiler_flag(-fno-objc-msgsend-selector-stubs HAVE_GCC_NO_OBJC_MSGSEND_SELECTOR_STUBS)
+ if(HAVE_GCC_NO_OBJC_MSGSEND_SELECTOR_STUBS)
+ list(APPEND EXTRA_CFLAGS "-fno-objc-msgsend-selector-stubs")
+ endif()
+
check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)

View 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',

View File

@@ -4,9 +4,10 @@
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake") include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
message(STATUS "Building in Rocky 8 Linux 64bit environment") message(STATUS "Building in CentOS 7 64bit environment")
set(LIBDIR_NAME "linux_x86_64_glibc_228") set(LIBDIR_NAME "linux_centos7_x86_64")
set(WITH_CXX11_ABI OFF CACHE BOOL "" FORCE)
# ######## Linux-specific build options ######## # ######## Linux-specific build options ########
# Options which are specific to Linux-only platforms # Options which are specific to Linux-only platforms
@@ -27,4 +28,4 @@ set(LIBDIR "${CMAKE_CURRENT_LIST_DIR}/../../../../lib/${LIBDIR_NAME}" CACHE STRI
# Platform specific configuration, to ensure static linking against everything. # Platform specific configuration, to ensure static linking against everything.
# Additional linking libraries # Additional linking libraries
set(CMAKE_EXE_LINKER_FLAGS "-lrt -no-pie" CACHE STRING "" FORCE) set(CMAKE_EXE_LINKER_FLAGS "-lrt -no-pie" CACHE STRING "" FORCE)

View File

@@ -19,13 +19,9 @@ ENDIF()
SET(_moltenvk_SEARCH_DIRS SET(_moltenvk_SEARCH_DIRS
${MOLTENVK_ROOT_DIR} ${MOLTENVK_ROOT_DIR}
${LIBDIR}/vulkan/MoltenVK
) )
# FIXME: These finder modules typically don't use LIBDIR,
# this should be set by `./build_files/cmake/platform/` instead.
IF(DEFINED LIBDIR)
SET(_moltenvk_SEARCH_DIRS ${_moltenvk_SEARCH_DIRS} ${LIBDIR}/moltenvk)
ENDIF()
FIND_PATH(MOLTENVK_INCLUDE_DIR FIND_PATH(MOLTENVK_INCLUDE_DIR
NAMES NAMES

View File

@@ -172,7 +172,7 @@ ENDIF()
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG
_openexr_LIBRARIES OPENEXR_INCLUDE_DIR) _openexr_LIBRARIES OPENEXR_INCLUDE_DIR)
IF(OPENEXR_FOUND) IF(OPENEXR_FOUND)

View File

@@ -17,13 +17,9 @@ ENDIF()
SET(_optix_SEARCH_DIRS SET(_optix_SEARCH_DIRS
${OPTIX_ROOT_DIR} ${OPTIX_ROOT_DIR}
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
) )
# TODO: Which environment uses this?
if(DEFINED ENV{PROGRAMDATA})
list(APPEND _optix_SEARCH_DIRS "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0")
endif()
FIND_PATH(OPTIX_INCLUDE_DIR FIND_PATH(OPTIX_INCLUDE_DIR
NAMES NAMES
optix.h optix.h

View File

@@ -67,8 +67,6 @@ ENDIF()
STRING(REPLACE "." "" PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) STRING(REPLACE "." "" PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_PYTHON_ABI_FLAGS "")
SET(_python_SEARCH_DIRS SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR} ${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${PYTHON_VERSION_NO_DOTS}" "$ENV{HOME}/py${PYTHON_VERSION_NO_DOTS}"

View File

@@ -1,63 +0,0 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2023 Blender Foundation.
# - Find ShaderC libraries
# Find the ShaderC includes and libraries
# This module defines
# SHADERC_INCLUDE_DIRS, where to find MoltenVK headers, Set when
# SHADERC_INCLUDE_DIR is found.
# SHADERC_LIBRARIES, libraries to link against to use ShaderC.
# SHADERC_ROOT_DIR, The base directory to search for ShaderC.
# This can also be an environment variable.
# SHADERC_FOUND, If false, do not try to use ShaderC.
#
# If SHADERC_ROOT_DIR was defined in the environment, use it.
IF(NOT SHADERC_ROOT_DIR AND NOT $ENV{SHADERC_ROOT_DIR} STREQUAL "")
SET(SHADERC_ROOT_DIR $ENV{SHADERC_ROOT_DIR})
ENDIF()
SET(_shaderc_SEARCH_DIRS
${SHADERC_ROOT_DIR}
)
# FIXME: These finder modules typically don't use LIBDIR,
# this should be set by `./build_files/cmake/platform/` instead.
IF(DEFINED LIBDIR)
SET(_shaderc_SEARCH_DIRS ${_shaderc_SEARCH_DIRS} ${LIBDIR}/shaderc)
ENDIF()
FIND_PATH(SHADERC_INCLUDE_DIR
NAMES
shaderc/shaderc.h
HINTS
${_shaderc_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(SHADERC_LIBRARY
NAMES
shaderc_combined
HINTS
${_shaderc_SEARCH_DIRS}
PATH_SUFFIXES
lib
)
# handle the QUIETLY and REQUIRED arguments and set SHADERC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ShaderC DEFAULT_MSG SHADERC_LIBRARY SHADERC_INCLUDE_DIR)
IF(SHADERC_FOUND)
SET(SHADERC_LIBRARIES ${SHADERC_LIBRARY})
SET(SHADERC_INCLUDE_DIRS ${SHADERC_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(
SHADERC_INCLUDE_DIR
SHADERC_LIBRARY
)
UNSET(_shaderc_SEARCH_DIRS)

View File

@@ -1,63 +0,0 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2023 Blender Foundation.
# - Find Vulkan libraries
# Find the Vulkan includes and libraries
# This module defines
# VULKAN_INCLUDE_DIRS, where to find Vulkan headers, Set when
# VULKAN_INCLUDE_DIR is found.
# VULKAN_LIBRARIES, libraries to link against to use Vulkan.
# VULKAN_ROOT_DIR, The base directory to search for Vulkan.
# This can also be an environment variable.
# VULKAN_FOUND, If false, do not try to use Vulkan.
#
# If VULKAN_ROOT_DIR was defined in the environment, use it.
IF(NOT VULKAN_ROOT_DIR AND NOT $ENV{VULKAN_ROOT_DIR} STREQUAL "")
SET(VULKAN_ROOT_DIR $ENV{VULKAN_ROOT_DIR})
ENDIF()
SET(_vulkan_SEARCH_DIRS
${VULKAN_ROOT_DIR}
)
# FIXME: These finder modules typically don't use LIBDIR,
# this should be set by `./build_files/cmake/platform/` instead.
IF(DEFINED LIBDIR)
SET(_vulkan_SEARCH_DIRS ${_vulkan_SEARCH_DIRS} ${LIBDIR}/vulkan)
ENDIF()
FIND_PATH(VULKAN_INCLUDE_DIR
NAMES
vulkan/vulkan.h
HINTS
${_vulkan_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(VULKAN_LIBRARY
NAMES
vulkan
HINTS
${_vulkan_SEARCH_DIRS}
PATH_SUFFIXES
lib
)
# handle the QUIETLY and REQUIRED arguments and set VULKAN_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
IF(VULKAN_FOUND)
SET(VULKAN_LIBRARIES ${VULKAN_LIBRARY})
SET(VULKAN_INCLUDE_DIRS ${VULKAN_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(
VULKAN_INCLUDE_DIR
VULKAN_LIBRARY
)
UNSET(_vulkan_SEARCH_DIRS)

View File

@@ -6,80 +6,18 @@
import re import re
import sys import sys
from typing import Optional
cmakelists_file = sys.argv[-1] cmakelists_file = sys.argv[-1]
def count_backslashes_before_pos(file_data: str, pos: int) -> int: def main():
slash_count = 0
pos -= 1
while pos >= 0:
if file_data[pos] != '\\':
break
pos -= 1
slash_count += 1
return slash_count
def extract_cmake_string_at_pos(file_data: str, pos_beg: int) -> Optional[str]:
assert file_data[pos_beg - 1] == '"'
pos = pos_beg
# Dummy assignment.
pos_end = pos_beg
while True:
pos_next = file_data.find('"', pos)
if pos_next == -1:
raise Exception("Un-terminated string (parse error?)")
count_slashes = count_backslashes_before_pos(file_data, pos_next)
if (count_slashes % 2) == 0:
pos_end = pos_next
# Found the closing quote.
break
# The quote was back-slash escaped, step over it.
pos = pos_next + 1
file_data[pos_next]
assert file_data[pos_end] == '"'
if pos_beg == pos_end:
return None
# See: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#escape-sequences
text = file_data[pos_beg: pos_end].replace(
# Handle back-slash literals.
"\\\\", "\\",
).replace(
# Handle tabs.
"\\t", "\t",
).replace(
# Handle escaped quotes.
"\\\"", "\"",
).replace(
# Handle tabs.
"\\;", ";",
).replace(
# Handle trailing newlines.
"\\\n", "",
)
return text
def main() -> None:
options = [] options = []
with open(cmakelists_file, 'r', encoding="utf-8") as fh: for l in open(cmakelists_file, 'r').readlines():
file_data = fh.read() if not l.lstrip().startswith('#'):
for m in re.finditer(r"^\s*option\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+(\")", file_data, re.MULTILINE): l_option = re.sub(r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+\"(.*)\"\s*.*', r'\g<1> - \g<2>', l)
option_name = m.group(1) if l_option != l:
option_descr = extract_cmake_string_at_pos(file_data, m.span(2)[1]) l_option = l_option.strip()
if option_descr is None: if l_option.startswith('WITH_'):
# Possibly a parsing error, at least show something. options.append(l_option)
option_descr = "(UNDOCUMENTED)"
options.append("{:s}: {:s}".format(option_name, option_descr))
print('\n'.join(options)) print('\n'.join(options))

View File

@@ -22,7 +22,7 @@ endif()
# Used for: `source/blender/blenlib/intern/system.c`. # Used for: `source/blender/blenlib/intern/system.c`.
# `execinfo` is not available on non-GLIBC systems (at least not on MUSL-LIBC), # `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. # so check the presence of the header before including it and using the it for back-trace.
set(HAVE_EXECINFO_H OFF) set(HAVE_EXECINFO_H OFF)
if(NOT MSVC) if(NOT MSVC)
include(CheckIncludeFiles) include(CheckIncludeFiles)

View File

@@ -326,8 +326,8 @@ function(blender_add_lib__impl
# NOTE: If separated libraries for debug and release are needed every library is the list are # NOTE: If separated libraries for debug and release are needed every library is the list are
# to be prefixed explicitly. # to be prefixed explicitly.
# #
# Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d" # Use: "optimized libfoo optimized libbar debug libfoo_d debug libbar_d"
# NOT: "optimized libfoo libbar debug libfoo_d libbar_d" # NOT: "optimized libfoo libbar debug libfoo_d libbar_d"
if(NOT "${library_deps}" STREQUAL "") if(NOT "${library_deps}" STREQUAL "")
set(next_library_mode "") set(next_library_mode "")
foreach(library ${library_deps}) foreach(library ${library_deps})
@@ -535,7 +535,7 @@ function(setup_platform_linker_flags
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " ${PLATFORM_LINKFLAGS_DEBUG}") set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " ${PLATFORM_LINKFLAGS_DEBUG}")
get_target_property(target_type ${target} TYPE) get_target_property(target_type ${target} TYPE)
if(target_type STREQUAL "EXECUTABLE") if (target_type STREQUAL "EXECUTABLE")
set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${PLATFORM_LINKFLAGS_EXECUTABLE}") set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${PLATFORM_LINKFLAGS_EXECUTABLE}")
endif() endif()
endfunction() endfunction()
@@ -550,9 +550,7 @@ function(setup_platform_linker_libs
endif() endif()
if(WIN32 AND NOT UNIX) if(WIN32 AND NOT UNIX)
if(DEFINED PTHREADS_LIBRARIES) target_link_libraries(${target} ${PTHREADS_LIBRARIES})
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif()
endif() endif()
# target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) # target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
@@ -1117,7 +1115,7 @@ function(find_python_package
# endif() # endif()
# Not set, so initialize. # Not set, so initialize.
else() else()
string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}") string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}")
list(GET _PY_VER_SPLIT 0 _PY_VER_MAJOR) list(GET _PY_VER_SPLIT 0 _PY_VER_MAJOR)
# re-cache # re-cache
@@ -1221,10 +1219,10 @@ macro(openmp_delayload
else() else()
set(OPENMP_DLL_NAME "vcomp140") set(OPENMP_DLL_NAME "vcomp140")
endif() endif()
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib") set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_DEBUG " /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") set_property(TARGET ${projectname} APPEND_STRING PROPERTY LINK_FLAGS_MINSIZEREL " /DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
endif() endif()
endif() endif()
endmacro() endmacro()
@@ -1264,7 +1262,7 @@ endmacro()
# Utility to gather and install precompiled shared libraries. # Utility to gather and install precompiled shared libraries.
macro(add_bundled_libraries library_dir) macro(add_bundled_libraries library_dir)
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
set(_library_dir ${LIBDIR}/${library_dir}) set(_library_dir ${LIBDIR}/${library_dir})
if(WIN32) if(WIN32)
file(GLOB _all_library_versions ${_library_dir}/*\.dll) file(GLOB _all_library_versions ${_library_dir}/*\.dll)
@@ -1277,7 +1275,7 @@ macro(add_bundled_libraries library_dir)
list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir}) list(APPEND PLATFORM_BUNDLED_LIBRARY_DIRS ${_library_dir})
unset(_all_library_versions) unset(_all_library_versions)
unset(_library_dir) unset(_library_dir)
endif() endif()
endmacro() endmacro()
macro(windows_install_shared_manifest) macro(windows_install_shared_manifest)
@@ -1336,13 +1334,13 @@ macro(windows_generate_shared_manifest)
NAME "blender.shared" NAME "blender.shared"
) )
install( install(
FILES ${CMAKE_BINARY_DIR}/Release/blender.shared.manifest FILES ${CMAKE_BINARY_DIR}/Release/blender.shared.manifest
DESTINATION "./blender.shared" DESTINATION "./blender.shared"
CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
) )
install( install(
FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest
DESTINATION "./blender.shared" DESTINATION "./blender.shared"
CONFIGURATIONS Debug CONFIGURATIONS Debug
) )
endmacro() endmacro()

View File

@@ -86,25 +86,38 @@ endif()
if(WITH_USD) if(WITH_USD)
find_package(USD REQUIRED) find_package(USD REQUIRED)
add_bundled_libraries(usd/lib)
endif() endif()
add_bundled_libraries(usd/lib)
if(WITH_MATERIALX) if(WITH_MATERIALX)
find_package(MaterialX) find_package(MaterialX)
set_and_warn_library_found("MaterialX" MaterialX_FOUND WITH_MATERIALX) set_and_warn_library_found("MaterialX" MaterialX_FOUND WITH_MATERIALX)
if(WITH_MATERIALX)
add_bundled_libraries(materialx/lib)
endif()
endif() endif()
add_bundled_libraries(materialx/lib)
if(WITH_VULKAN_BACKEND) if(WITH_VULKAN_BACKEND)
find_package(MoltenVK REQUIRED) find_package(MoltenVK REQUIRED)
find_package(ShaderC REQUIRED)
find_package(Vulkan REQUIRED) if(EXISTS ${LIBDIR}/vulkan)
set(VULKAN_FOUND On)
set(VULKAN_ROOT_DIR ${LIBDIR}/vulkan/macOS)
set(VULKAN_INCLUDE_DIR ${VULKAN_ROOT_DIR}/include)
set(VULKAN_LIBRARY ${VULKAN_ROOT_DIR}/lib/libvulkan.1.dylib)
set(VULKAN_INCLUDE_DIRS ${VULKAN_INCLUDE_DIR} ${MOLTENVK_INCLUDE_DIRS})
set(VULKAN_LIBRARIES ${VULKAN_LIBRARY} ${MOLTENVK_LIBRARIES})
else()
message(WARNING "Vulkan SDK was not found, disabling WITH_VULKAN_BACKEND")
set(WITH_VULKAN_BACKEND OFF)
endif()
endif() endif()
if(WITH_OPENSUBDIV) if(WITH_OPENSUBDIV)
find_package(OpenSubdiv) find_package(OpenSubdiv)
add_bundled_libraries(opensubdiv/lib)
endif() endif()
add_bundled_libraries(opensubdiv/lib)
if(WITH_CODEC_SNDFILE) if(WITH_CODEC_SNDFILE)
find_package(SndFile) find_package(SndFile)
@@ -142,9 +155,9 @@ list(APPEND FREETYPE_LIBRARIES
if(WITH_IMAGE_OPENEXR) if(WITH_IMAGE_OPENEXR)
find_package(OpenEXR) find_package(OpenEXR)
add_bundled_libraries(openexr/lib)
add_bundled_libraries(imath/lib)
endif() endif()
add_bundled_libraries(openexr/lib)
add_bundled_libraries(imath/lib)
if(WITH_CODEC_FFMPEG) if(WITH_CODEC_FFMPEG)
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg) set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
@@ -256,11 +269,12 @@ if(WITH_BOOST)
set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS}) set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
set(BOOST_DEFINITIONS) set(BOOST_DEFINITIONS)
add_bundled_libraries(boost/lib)
mark_as_advanced(Boost_LIBRARIES) mark_as_advanced(Boost_LIBRARIES)
mark_as_advanced(Boost_INCLUDE_DIRS) mark_as_advanced(Boost_INCLUDE_DIRS)
unset(_boost_FIND_COMPONENTS) unset(_boost_FIND_COMPONENTS)
endif() endif()
add_bundled_libraries(boost/lib)
if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG) if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it ! string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it !
@@ -282,13 +296,13 @@ if(WITH_OPENIMAGEIO)
) )
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD") set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff") set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
add_bundled_libraries(openimageio/lib)
endif() endif()
add_bundled_libraries(openimageio/lib)
if(WITH_OPENCOLORIO) if(WITH_OPENCOLORIO)
find_package(OpenColorIO 2.0.0 REQUIRED) find_package(OpenColorIO 2.0.0 REQUIRED)
add_bundled_libraries(opencolorio/lib)
endif() endif()
add_bundled_libraries(opencolorio/lib)
if(WITH_OPENVDB) if(WITH_OPENVDB)
find_package(OpenVDB) find_package(OpenVDB)
@@ -299,8 +313,8 @@ if(WITH_OPENVDB)
unset(BLOSC_LIBRARIES CACHE) unset(BLOSC_LIBRARIES CACHE)
endif() endif()
set(OPENVDB_DEFINITIONS) set(OPENVDB_DEFINITIONS)
add_bundled_libraries(openvdb/lib)
endif() endif()
add_bundled_libraries(openvdb/lib)
if(WITH_NANOVDB) if(WITH_NANOVDB)
find_package(NanoVDB) find_package(NanoVDB)
@@ -348,8 +362,8 @@ endif()
if(WITH_TBB) if(WITH_TBB)
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
add_bundled_libraries(tbb/lib)
endif() endif()
add_bundled_libraries(tbb/lib)
if(WITH_POTRACE) if(WITH_POTRACE)
find_package(Potrace REQUIRED) find_package(Potrace REQUIRED)
@@ -367,9 +381,9 @@ if(WITH_OPENMP)
set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/") set(OpenMP_LIBRARY_DIR "${LIBDIR}/openmp/lib/")
set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp") set(OpenMP_LINKER_FLAGS "-L'${OpenMP_LIBRARY_DIR}' -lomp")
set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib") set(OpenMP_LIBRARY "${OpenMP_LIBRARY_DIR}/libomp.dylib")
add_bundled_libraries(openmp/lib)
endif() endif()
endif() endif()
add_bundled_libraries(openmp/lib)
if(WITH_XR_OPENXR) if(WITH_XR_OPENXR)
find_package(XR_OpenXR_SDK REQUIRED) find_package(XR_OpenXR_SDK REQUIRED)

View File

@@ -155,8 +155,8 @@ if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
# M1 chips run Big Sur onwards. # M1 chips run Big Sur onwards.
set(OSX_MIN_DEPLOYMENT_TARGET 11.00) set(OSX_MIN_DEPLOYMENT_TARGET 11.00)
else() else()
# 10.15 is our min. target, if you use higher sdk, weak linking happens # 10.13 is our min. target, if you use higher sdk, weak linking happens
set(OSX_MIN_DEPLOYMENT_TARGET 10.15) set(OSX_MIN_DEPLOYMENT_TARGET 10.13)
endif() endif()
set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE) set(CMAKE_OSX_DEPLOYMENT_TARGET "${OSX_MIN_DEPLOYMENT_TARGET}" CACHE STRING "" FORCE)

View File

@@ -1,47 +1,17 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation. All rights reserved. # Copyright 2022 Blender Foundation. All rights reserved.
# Auto update existing CMake caches for new libraries. # Auto update existing CMake caches for new libraries
# Assert that `LIBDIR` is defined.
if(NOT (DEFINED LIBDIR))
message(FATAL_ERROR "Logical error, expected 'LIBDIR' to be defined!")
endif()
# Clear cached variables whose name matches `pattern`.
function(unset_cache_variables pattern) function(unset_cache_variables pattern)
get_cmake_property(_cache_variables CACHE_VARIABLES) get_cmake_property(_cache_variables CACHE_VARIABLES)
foreach(_cache_variable ${_cache_variables}) foreach (_cache_variable ${_cache_variables})
if("${_cache_variable}" MATCHES "${pattern}") if("${_cache_variable}" MATCHES "${pattern}")
unset(${_cache_variable} CACHE) unset(${_cache_variable} CACHE)
endif() endif()
endforeach() endforeach()
endfunction() endfunction()
# Clear cached variables with values containing `contents`.
function(unset_cached_varables_containting contents msg)
get_cmake_property(_cache_variables CACHE_VARIABLES)
set(_found)
set(_print_msg)
foreach(_cache_variable ${_cache_variables})
# Skip "_" prefixed variables, these are used for internal book-keeping,
# not under user control.
string(FIND "${_cache_variable}" "_" _found)
if(NOT (_found EQUAL 0))
string(FIND "${${_cache_variable}}" "${contents}" _found)
if(NOT (_found EQUAL -1))
if(_found)
unset(${_cache_variable} CACHE)
set(_print_msg ON)
endif()
endif()
endif()
endforeach()
if(_print_msg)
message(STATUS ${msg})
endif()
endfunction()
# Detect update from 3.1 to 3.2 libs. # Detect update from 3.1 to 3.2 libs.
if(UNIX AND if(UNIX AND
DEFINED OPENEXR_VERSION AND DEFINED OPENEXR_VERSION AND
@@ -93,13 +63,3 @@ if(UNIX AND
unset_cache_variables("^TBB") unset_cache_variables("^TBB")
unset_cache_variables("^USD") unset_cache_variables("^USD")
endif() endif()
if(UNIX AND (NOT APPLE) AND LIBDIR AND (EXISTS ${LIBDIR}))
# Only search for the path if it's found on the system.
set(_libdir_stale "/lib/linux_centos7_x86_64/")
unset_cached_varables_containting(
"${_libdir_stale}"
"Auto clearing old ${_libdir_stale} paths from CMake configuration"
)
unset(_libdir_stale)
endif()

View File

@@ -4,52 +4,39 @@
# Libraries configuration for any *nix system including Linux and Unix (excluding APPLE). # Libraries configuration for any *nix system including Linux and Unix (excluding APPLE).
# Detect precompiled library directory # Detect precompiled library directory
if(NOT DEFINED LIBDIR)
# Path to a locally compiled libraries.
set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
if(NOT WITH_LIBS_PRECOMPILED) # Path to precompiled libraries with known CentOS 7 ABI.
unset(LIBDIR) set(LIBDIR_CENTOS7_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_centos7_x86_64)
else()
if(NOT DEFINED LIBDIR)
# Path to a locally compiled libraries.
set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
# Path to precompiled libraries with known glibc 2.28 ABI. # Choose the best suitable libraries.
set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_x86_64_glibc_228) if(EXISTS ${LIBDIR_NATIVE_ABI})
set(LIBDIR ${LIBDIR_NATIVE_ABI})
# Choose the best suitable libraries. set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
if(EXISTS ${LIBDIR_NATIVE_ABI}) elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_NATIVE_ABI}) set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
if(WITH_MEM_JEMALLOC)
# jemalloc provides malloc hooks.
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False)
else()
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True) set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
elseif(EXISTS ${LIBDIR_GLIBC228_ABI})
set(LIBDIR ${LIBDIR_GLIBC228_ABI})
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() endif()
# Avoid namespace pollustion.
unset(LIBDIR_NATIVE_ABI)
unset(LIBDIR_GLIBC228_ABI)
endif() endif()
if(NOT (EXISTS ${LIBDIR})) # Avoid namespace pollustion.
message(STATUS unset(LIBDIR_NATIVE_ABI)
"Unable to find LIBDIR: ${LIBDIR}, system libraries may be used " unset(LIBDIR_CENTOS7_ABI)
"(disable WITH_LIBS_PRECOMPILED to suppress this message)."
)
unset(LIBDIR)
endif()
endif() endif()
# Support restoring this value once pre-compiled libraries have been handled. # Support restoring this value once pre-compiled libraries have been handled.
set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS}) set(WITH_STATIC_LIBS_INIT ${WITH_STATIC_LIBS})
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
file(GLOB LIB_SUBDIRS ${LIBDIR}/*) file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
@@ -99,7 +86,7 @@ endmacro()
# These are libraries that may be precompiled. For this we disable searching in # These are libraries that may be precompiled. For this we disable searching in
# the system directories so that we don't accidentally use them instead. # the system directories so that we don't accidentally use them instead.
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
without_system_libs_begin() without_system_libs_begin()
endif() endif()
@@ -111,7 +98,6 @@ find_package_wrapper(Epoxy REQUIRED)
if(WITH_VULKAN_BACKEND) if(WITH_VULKAN_BACKEND)
find_package_wrapper(Vulkan REQUIRED) find_package_wrapper(Vulkan REQUIRED)
find_package_wrapper(ShaderC REQUIRED)
endif() endif()
function(check_freetype_for_brotli) function(check_freetype_for_brotli)
@@ -129,7 +115,7 @@ endfunction()
if(NOT WITH_SYSTEM_FREETYPE) if(NOT WITH_SYSTEM_FREETYPE)
# FreeType compiled with Brotli compression for woff2. # FreeType compiled with Brotli compression for woff2.
find_package_wrapper(Freetype REQUIRED) find_package_wrapper(Freetype REQUIRED)
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
find_package_wrapper(Brotli REQUIRED) find_package_wrapper(Brotli REQUIRED)
# NOTE: This is done on WIN32 & APPLE but fails on some Linux systems. # NOTE: This is done on WIN32 & APPLE but fails on some Linux systems.
@@ -156,7 +142,7 @@ if(WITH_PYTHON)
if(WITH_PYTHON_MODULE AND NOT WITH_INSTALL_PORTABLE) if(WITH_PYTHON_MODULE AND NOT WITH_INSTALL_PORTABLE)
# Installing into `site-packages`, warn when installing into `./../lib/` # Installing into `site-packages`, warn when installing into `./../lib/`
# which script authors almost certainly don't want. # which script authors almost certainly don't want.
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
path_is_prefix(LIBDIR PYTHON_SITE_PACKAGES _is_prefix) path_is_prefix(LIBDIR PYTHON_SITE_PACKAGES _is_prefix)
if(_is_prefix) if(_is_prefix)
message(WARNING " message(WARNING "
@@ -181,9 +167,11 @@ endif()
if(WITH_IMAGE_OPENEXR) if(WITH_IMAGE_OPENEXR)
find_package_wrapper(OpenEXR) # our own module find_package_wrapper(OpenEXR) # our own module
set_and_warn_library_found("OpenEXR" OPENEXR_FOUND WITH_IMAGE_OPENEXR) set_and_warn_library_found("OpenEXR" OPENEXR_FOUND WITH_IMAGE_OPENEXR)
if(WITH_IMAGE_OPENEXR)
add_bundled_libraries(openexr/lib)
add_bundled_libraries(imath/lib)
endif()
endif() endif()
add_bundled_libraries(openexr/lib)
add_bundled_libraries(imath/lib)
if(WITH_IMAGE_OPENJPEG) if(WITH_IMAGE_OPENJPEG)
find_package_wrapper(OpenJPEG) find_package_wrapper(OpenJPEG)
@@ -232,7 +220,7 @@ if(WITH_CODEC_SNDFILE)
endif() endif()
if(WITH_CODEC_FFMPEG) if(WITH_CODEC_FFMPEG)
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg) set(FFMPEG_ROOT_DIR ${LIBDIR}/ffmpeg)
# Override FFMPEG components to also include static library dependencies # Override FFMPEG components to also include static library dependencies
# included with precompiled libraries, and to ensure correct link order. # included with precompiled libraries, and to ensure correct link order.
@@ -247,7 +235,7 @@ if(WITH_CODEC_FFMPEG)
vpx vpx
x264 x264
xvidcore) xvidcore)
if((DEFINED LIBDIR) AND (EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)) if(EXISTS ${LIBDIR}/ffmpeg/lib/libaom.a)
list(APPEND FFMPEG_FIND_COMPONENTS aom) list(APPEND FFMPEG_FIND_COMPONENTS aom)
endif() endif()
elseif(FFMPEG) elseif(FFMPEG)
@@ -341,8 +329,13 @@ endif()
if(WITH_OPENVDB) if(WITH_OPENVDB)
find_package(OpenVDB) find_package(OpenVDB)
set_and_warn_library_found("OpenVDB" OPENVDB_FOUND WITH_OPENVDB) set_and_warn_library_found("OpenVDB" OPENVDB_FOUND WITH_OPENVDB)
if(OPENVDB_FOUND)
add_bundled_libraries(openvdb/lib)
find_package_wrapper(Blosc)
set_and_warn_library_found("Blosc" BLOSC_FOUND WITH_OPENVDB_BLOSC)
endif()
endif() endif()
add_bundled_libraries(openvdb/lib)
if(WITH_NANOVDB) if(WITH_NANOVDB)
find_package_wrapper(NanoVDB) find_package_wrapper(NanoVDB)
@@ -361,14 +354,18 @@ endif()
if(WITH_USD) if(WITH_USD)
find_package_wrapper(USD) find_package_wrapper(USD)
set_and_warn_library_found("USD" USD_FOUND WITH_USD) set_and_warn_library_found("USD" USD_FOUND WITH_USD)
if(WITH_USD)
add_bundled_libraries(usd/lib)
endif()
endif() endif()
add_bundled_libraries(usd/lib)
if(WITH_MATERIALX) if(WITH_MATERIALX)
find_package_wrapper(MaterialX) find_package_wrapper(MaterialX)
set_and_warn_library_found("MaterialX" MaterialX_FOUND WITH_MATERIALX) set_and_warn_library_found("MaterialX" MaterialX_FOUND WITH_MATERIALX)
if(WITH_MATERIALX)
add_bundled_libraries(materialx/lib)
endif()
endif() endif()
add_bundled_libraries(materialx/lib)
if(WITH_BOOST) if(WITH_BOOST)
# uses in build instructions to override include and library variables # uses in build instructions to override include and library variables
@@ -424,8 +421,9 @@ if(WITH_BOOST)
find_package(IcuLinux) find_package(IcuLinux)
list(APPEND BOOST_LIBRARIES ${ICU_LIBRARIES}) list(APPEND BOOST_LIBRARIES ${ICU_LIBRARIES})
endif() endif()
add_bundled_libraries(boost/lib)
endif() endif()
add_bundled_libraries(boost/lib)
if(WITH_PUGIXML) if(WITH_PUGIXML)
find_package_wrapper(PugiXML) find_package_wrapper(PugiXML)
@@ -445,13 +443,10 @@ if(WITH_OPENIMAGEIO)
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${JPEG_LIBRARIES} ${JPEG_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${BOOST_LIBRARIES}
) )
set(OPENIMAGEIO_DEFINITIONS "") set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_BOOST)
list(APPEND OPENIMAGEIO_LIBRARIES "${BOOST_LIBRARIES}")
endif()
if(WITH_IMAGE_TIFF) if(WITH_IMAGE_TIFF)
list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}") list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
endif() endif()
@@ -463,16 +458,21 @@ if(WITH_OPENIMAGEIO)
endif() endif()
set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO) set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO)
if(WITH_OPENIMAGEIO)
add_bundled_libraries(openimageio/lib)
endif()
endif() endif()
add_bundled_libraries(openimageio/lib)
if(WITH_OPENCOLORIO) if(WITH_OPENCOLORIO)
find_package_wrapper(OpenColorIO 2.0.0) find_package_wrapper(OpenColorIO 2.0.0)
set(OPENCOLORIO_DEFINITIONS "") set(OPENCOLORIO_DEFINITIONS)
set_and_warn_library_found("OpenColorIO" OPENCOLORIO_FOUND WITH_OPENCOLORIO) set_and_warn_library_found("OpenColorIO" OPENCOLORIO_FOUND WITH_OPENCOLORIO)
if(WITH_OPENCOLORIO)
add_bundled_libraries(opencolorio/lib)
endif()
endif() endif()
add_bundled_libraries(opencolorio/lib)
if(WITH_CYCLES AND WITH_CYCLES_EMBREE) if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
find_package(Embree 3.8.0 REQUIRED) find_package(Embree 3.8.0 REQUIRED)
@@ -484,7 +484,7 @@ if(WITH_OPENIMAGEDENOISE)
endif() endif()
if(WITH_LLVM) if(WITH_LLVM)
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
set(LLVM_STATIC ON) set(LLVM_STATIC ON)
endif() endif()
@@ -498,7 +498,7 @@ if(WITH_LLVM)
endif() endif()
# Symbol conflicts with same UTF library used by OpenCollada # Symbol conflicts with same UTF library used by OpenCollada
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0")) if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY}) list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
endif() endif()
@@ -513,14 +513,18 @@ if(WITH_OPENSUBDIV)
set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere
set_and_warn_library_found("OpenSubdiv" OPENSUBDIV_FOUND WITH_OPENSUBDIV) set_and_warn_library_found("OpenSubdiv" OPENSUBDIV_FOUND WITH_OPENSUBDIV)
if(WITH_OPENSUBDIV)
add_bundled_libraries(opensubdiv/lib)
endif()
endif() endif()
add_bundled_libraries(opensubdiv/lib)
if(WITH_TBB) if(WITH_TBB)
find_package_wrapper(TBB) find_package_wrapper(TBB)
set_and_warn_library_found("TBB" TBB_FOUND WITH_TBB) set_and_warn_library_found("TBB" TBB_FOUND WITH_TBB)
if(WITH_TBB)
add_bundled_libraries(tbb/lib)
endif()
endif() endif()
add_bundled_libraries(tbb/lib)
if(WITH_XR_OPENXR) if(WITH_XR_OPENXR)
find_package(XR_OpenXR_SDK) find_package(XR_OpenXR_SDK)
@@ -554,7 +558,7 @@ if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
endif() endif()
endif() endif()
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
without_system_libs_end() without_system_libs_end()
endif() endif()
@@ -569,14 +573,9 @@ else()
endif() endif()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
# `FindThreads` documentation notes that this may be empty list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# with the system libraries provide threading functionality. # used by other platforms
if(CMAKE_THREAD_LIBS_INIT) set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
# used by other platforms
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
if(CMAKE_DL_LIBS) if(CMAKE_DL_LIBS)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS}) list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
@@ -598,7 +597,7 @@ add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
# #
# Keep last, so indirectly linked libraries don't override our own pre-compiled libs. # Keep last, so indirectly linked libraries don't override our own pre-compiled libs.
if(DEFINED LIBDIR) if(EXISTS ${LIBDIR})
# Clear the prefix path as it causes the `LIBDIR` to override system locations. # Clear the prefix path as it causes the `LIBDIR` to override system locations.
unset(CMAKE_PREFIX_PATH) unset(CMAKE_PREFIX_PATH)
@@ -654,7 +653,7 @@ if(WITH_GHOST_WAYLAND)
# When dynamically linked WAYLAND is used and `${LIBDIR}/wayland` is present, # When dynamically linked WAYLAND is used and `${LIBDIR}/wayland` is present,
# there is no need to search for the libraries as they are not needed for building. # there is no need to search for the libraries as they are not needed for building.
# Only the headers are needed which can reference the known paths. # Only the headers are needed which can reference the known paths.
if((DEFINED LIBDIR) AND (EXISTS "${LIBDIR}/wayland" AND WITH_GHOST_WAYLAND_DYNLOAD)) if(EXISTS "${LIBDIR}/wayland" AND WITH_GHOST_WAYLAND_DYNLOAD)
set(_use_system_wayland OFF) set(_use_system_wayland OFF)
else() else()
set(_use_system_wayland ON) set(_use_system_wayland ON)
@@ -668,7 +667,8 @@ if(WITH_GHOST_WAYLAND)
pkg_check_modules(wayland-protocols wayland-protocols>=1.15) pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
else() else()
# Rocky8 packages have too old a version, a newer version exist in the pre-compiled libraries. # CentOS 7 packages have too old a version, a newer version exist in the
# precompiled libraries.
find_path(WAYLAND_PROTOCOLS_DIR find_path(WAYLAND_PROTOCOLS_DIR
NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
PATH_SUFFIXES share/wayland-protocols PATH_SUFFIXES share/wayland-protocols
@@ -718,7 +718,7 @@ if(WITH_GHOST_WAYLAND)
add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR) add_definitions(-DWITH_GHOST_WAYLAND_LIBDECOR)
endif() endif()
if((DEFINED LIBDIR) AND (EXISTS "${LIBDIR}/wayland/bin/wayland-scanner")) if(EXISTS "${LIBDIR}/wayland/bin/wayland-scanner")
set(WAYLAND_SCANNER "${LIBDIR}/wayland/bin/wayland-scanner") set(WAYLAND_SCANNER "${LIBDIR}/wayland/bin/wayland-scanner")
else() else()
pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
@@ -793,7 +793,7 @@ if(WITH_GHOST_X11)
endif() endif()
if(WITH_X11_ALPHA) if(WITH_X11_ALPHA)
find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
mark_as_advanced(X11_Xrender_LIB) mark_as_advanced(X11_Xrender_LIB)
if(NOT X11_Xrender_LIB) if(NOT X11_Xrender_LIB)
message(FATAL_ERROR "libXrender not found. Disable WITH_X11_ALPHA if you message(FATAL_ERROR "libXrender not found. Disable WITH_X11_ALPHA if you

View File

@@ -140,8 +140,8 @@ if(WITH_WINDOWS_BUNDLE_CRT)
install(FILES ${CMAKE_BINARY_DIR}/blender.crt.manifest DESTINATION ./blender.crt) install(FILES ${CMAKE_BINARY_DIR}/blender.crt.manifest DESTINATION ./blender.crt)
set(BUNDLECRT "<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.crt\" version=\"1.0.0.0\" /></dependentAssembly></dependency>") set(BUNDLECRT "<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.crt\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
set(BUNDLECRT "${BUNDLECRT}<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.shared\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
endif() endif()
set(BUNDLECRT "${BUNDLECRT}<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.shared\" version=\"1.0.0.0\" /></dependentAssembly></dependency>")
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY) configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
@@ -302,7 +302,7 @@ endif()
file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*) file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*)
foreach(child ${children}) foreach(child ${children})
if(IS_DIRECTORY ${LIBDIR}/${child}) if(IS_DIRECTORY ${LIBDIR}/${child})
list(APPEND CMAKE_PREFIX_PATH ${LIBDIR}/${child}) list(APPEND CMAKE_PREFIX_PATH ${LIBDIR}/${child})
endif() endif()
endforeach() endforeach()
@@ -555,7 +555,7 @@ if(WITH_BOOST)
set(BOOST_PREFIX "") set(BOOST_PREFIX "")
# This is file new in 3.4 if it does not exist, assume we are building against 3.3 libs # This is file new in 3.4 if it does not exist, assume we are building against 3.3 libs
set(BOOST_34_TRIGGER_FILE ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib) set(BOOST_34_TRIGGER_FILE ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib)
if(NOT EXISTS ${BOOST_34_TRIGGER_FILE}) if (NOT EXISTS ${BOOST_34_TRIGGER_FILE})
set(BOOST_DEBUG_POSTFIX "vc142-mt-gd-x64-${BOOST_VERSION}") set(BOOST_DEBUG_POSTFIX "vc142-mt-gd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "lib") set(BOOST_PREFIX "lib")
endif() endif()
@@ -573,7 +573,7 @@ if(WITH_BOOST)
debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_thread-${BOOST_DEBUG_POSTFIX}.lib debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_thread-${BOOST_DEBUG_POSTFIX}.lib
debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_chrono-${BOOST_DEBUG_POSTFIX}.lib debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_chrono-${BOOST_DEBUG_POSTFIX}.lib
) )
if(EXISTS ${BOOST_34_TRIGGER_FILE}) if (EXISTS ${BOOST_34_TRIGGER_FILE})
if(WITH_USD) if(WITH_USD)
set(BOOST_PYTHON_LIBRARIES set(BOOST_PYTHON_LIBRARIES
debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib debug ${BOOST_LIBPATH}/${BOOST_PREFIX}boost_python310-${BOOST_DEBUG_POSTFIX}.lib
@@ -624,7 +624,7 @@ endif()
if(WITH_LLVM) if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation") set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_INCLUDE_DIRS ${LLVM_ROOT_DIR}/$<$<CONFIG:Debug>:Debug>/include CACHE PATH "Path to the LLVM include directory") set(LLVM_INCLUDE_DIRS ${LLVM_ROOT_DIR}/$<$<CONFIG:Debug>:Debug>/include CACHE PATH "Path to the LLVM include directory")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib) file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib) if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)
@@ -1030,7 +1030,7 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
${SYCL_ROOT_DIR}/bin/pi_*.dll ${SYCL_ROOT_DIR}/bin/pi_*.dll
) )
list(REMOVE_ITEM _sycl_pi_runtime_libraries_glob "${SYCL_ROOT_DIR}/bin/pi_opencl.dll") list(REMOVE_ITEM _sycl_pi_runtime_libraries_glob "${SYCL_ROOT_DIR}/bin/pi_opencl.dll")
list(APPEND _sycl_runtime_libraries ${_sycl_pi_runtime_libraries_glob}) list (APPEND _sycl_runtime_libraries ${_sycl_pi_runtime_libraries_glob})
unset(_sycl_pi_runtime_libraries_glob) unset(_sycl_pi_runtime_libraries_glob)
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries}) list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})

View File

@@ -30,7 +30,7 @@ update-code:
linux-x86_64: linux-x86_64:
branch: trunk branch: trunk
commit_id: HEAD commit_id: HEAD
path: lib/linux_x86_64_glibc_228 path: lib/linux_centos7_x86_64
windows-amd64: windows-amd64:
branch: trunk branch: trunk
commit_id: HEAD commit_id: HEAD
@@ -43,17 +43,13 @@ update-code:
branch: trunk branch: trunk
commit_id: HEAD commit_id: HEAD
path: lib/benchmarks path: lib/benchmarks
assets:
branch: trunk
commit_id: HEAD
path: lib/assets
# #
# Buildbot only configs # Buildbot only configs
# #
buildbot: buildbot:
gcc: gcc:
version: '11.0.0' version: '9.0.0'
cuda10: cuda10:
version: '10.1.243' version: '10.1.243'
cuda11: cuda11:
@@ -63,7 +59,7 @@ buildbot:
optix: optix:
version: '7.3.0' version: '7.3.0'
ocloc: ocloc:
version: '101.4032' version: '101.3430'
cmake: cmake:
default: default:
version: any version: any

View File

@@ -24,7 +24,7 @@ import os
import re import re
import platform import platform
import string import string
import setuptools import setuptools # type: ignore
import sys import sys
from typing import ( from typing import (
@@ -208,7 +208,7 @@ def main() -> None:
return paths return paths
# Ensure this wheel is marked platform specific. # Ensure this wheel is marked platform specific.
class BinaryDistribution(setuptools.dist.Distribution): class BinaryDistribution(setuptools.dist.Distribution): # type: ignore
def has_ext_modules(self) -> bool: def has_ext_modules(self) -> bool:
return True return True

View File

@@ -13,10 +13,10 @@ import sys
import make_utils import make_utils
from make_utils import call from make_utils import call
# Parse arguments. # Parse arguments
def parse_arguments() -> argparse.Namespace: def parse_arguments():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--ctest-command", default="ctest") parser.add_argument("--ctest-command", default="ctest")
parser.add_argument("--cmake-command", default="cmake") parser.add_argument("--cmake-command", default="cmake")

View File

@@ -41,7 +41,7 @@ def parse_arguments() -> argparse.Namespace:
parser.add_argument("--svn-command", default="svn") parser.add_argument("--svn-command", default="svn")
parser.add_argument("--svn-branch", default=None) parser.add_argument("--svn-branch", default=None)
parser.add_argument("--git-command", default="git") parser.add_argument("--git-command", default="git")
parser.add_argument("--use-linux-libraries", action="store_true") parser.add_argument("--use-centos-libraries", action="store_true")
return parser.parse_args() return parser.parse_args()
@@ -71,8 +71,8 @@ def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None
# this script is bundled as part of the precompiled libraries. However it # this script is bundled as part of the precompiled libraries. However it
# is used by the buildbot. # is used by the buildbot.
lib_platform = "win64_vc15" lib_platform = "win64_vc15"
elif args.use_linux_libraries: elif args.use_centos_libraries:
lib_platform = "linux_x86_64_glibc_228" lib_platform = "linux_centos7_x86_64"
else: else:
# No precompiled libraries for Linux. # No precompiled libraries for Linux.
lib_platform = None lib_platform = None
@@ -104,30 +104,17 @@ def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None
svn_url_tests = svn_url + lib_tests svn_url_tests = svn_url + lib_tests
call(svn_non_interactive + ["checkout", svn_url_tests, lib_tests_dirpath]) call(svn_non_interactive + ["checkout", svn_url_tests, lib_tests_dirpath])
lib_assets = "assets" # Update precompiled libraries and tests
lib_assets_dirpath = os.path.join(lib_dirpath, lib_assets)
if not os.path.exists(lib_assets_dirpath):
print_stage("Checking out Assets")
if make_utils.command_missing(args.svn_command):
sys.stderr.write("svn not found, can't checkout assets\n")
sys.exit(1)
svn_url_assets = svn_url + lib_assets
call(svn_non_interactive + ["checkout", svn_url_assets, lib_assets_dirpath])
# Update precompiled libraries, assets and tests
if not os.path.isdir(lib_dirpath): if not os.path.isdir(lib_dirpath):
print("Library path: %r, not found, skipping" % lib_dirpath) print("Library path: %r, not found, skipping" % lib_dirpath)
else: else:
paths_local_and_remote = [] paths_local_and_remote = []
if os.path.exists(os.path.join(lib_dirpath, ".svn")): if os.path.exists(os.path.join(lib_dirpath, ".svn")):
print_stage("Updating Precompiled Libraries, Assets and Tests (one repository)") print_stage("Updating Precompiled Libraries and Tests (one repository)")
paths_local_and_remote.append((lib_dirpath, svn_url)) paths_local_and_remote.append((lib_dirpath, svn_url))
else: else:
print_stage("Updating Precompiled Libraries, Assets and Tests (multiple repositories)") print_stage("Updating Precompiled Libraries and Tests (multiple repositories)")
# Separate paths checked out. # Separate paths checked out.
for dirname in os.listdir(lib_dirpath): for dirname in os.listdir(lib_dirpath):
if dirname.startswith("."): if dirname.startswith("."):

View File

@@ -10,9 +10,8 @@ Only keyword arguments can be used to pass operator properties.
Operators don't have return values as you might expect, Operators don't have return values as you might expect,
instead they return a set() which is made up of: instead they return a set() which is made up of:
``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``. ``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``.
Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``, the latter Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``.
meaning that the operator execution was aborted without making any changes or
saving an undo history entry.
Calling an operator in the wrong context will raise a ``RuntimeError``, Calling an operator in the wrong context will raise a ``RuntimeError``,
there is a poll() method to avoid this problem. there is a poll() method to avoid this problem.

View File

@@ -13,16 +13,16 @@ Blender stores 4 main arrays to define mesh geometry.
- :class:`Mesh.polygons`: (reference a range of loops) - :class:`Mesh.polygons`: (reference a range of loops)
Each polygon references a slice in the loop array, this way, polygons do not store vertices or corner data such as UVs directly, Each polygon reference a slice in the loop array, this way, polygons do not store vertices or corner data such as UV's directly,
only a reference to loops that the polygon uses. only a reference to loops that the polygon uses.
:class:`Mesh.loops`, :class:`Mesh.uv_layers` :class:`Mesh.vertex_colors` are all aligned so the same polygon loop :class:`Mesh.loops`, :class:`Mesh.uv_layers` :class:`Mesh.vertex_colors` are all aligned so the same polygon loop
indices can be used to find the UVs and vertex colors as with as the vertices. indices can be used to find the UV's and vertex colors as with as the vertices.
To compare mesh API options see: :ref:`NGons and Tessellation Faces <info_gotcha_mesh_faces>` To compare mesh API options see: :ref:`NGons and Tessellation Faces <info_gotcha_mesh_faces>`
This example script prints the vertices and UVs for each polygon, assumes the active object is a mesh with UVs. This example script prints the vertices and UV's for each polygon, assumes the active object is a mesh with UVs.
""" """
import bpy import bpy

View File

@@ -44,7 +44,6 @@ class ModalOperator(bpy.types.Operator):
elif event.type == 'LEFTMOUSE': # Confirm elif event.type == 'LEFTMOUSE': # Confirm
return {'FINISHED'} return {'FINISHED'}
elif event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel elif event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel
# Revert all changes that have been made
context.object.location.x = self.init_loc_x context.object.location.x = self.init_loc_x
return {'CANCELLED'} return {'CANCELLED'}

View File

@@ -7,16 +7,9 @@ This script shows simple operator which prints a message.
Since the operator only has an :class:`Operator.execute` function it takes no Since the operator only has an :class:`Operator.execute` function it takes no
user input. user input.
The function should return ``{'FINISHED'}`` or ``{'CANCELLED'}``, the latter
meaning that operator execution was aborted without making any changes, and
saving an undo entry isn't neccesary. If an error is detected after some changes
have already been made, use the ``{'FINISHED'}`` return code, or the behavior
of undo will be confusing for the user.
.. note:: .. note::
Operator subclasses must be registered before accessing them from blender. Operator subclasses must be registered before accessing them from blender.
""" """
import bpy import bpy

View File

@@ -370,7 +370,7 @@ def main():
args_in_wash = get_args_wash(args_in, args_in_index, False) args_in_wash = get_args_wash(args_in, args_in_index, False)
fw(".. function:: %s(bm, %s)\n\n" % (b[0], ", ".join([arg_name_with_default(arg) for arg in args_in_wash]))) fw(".. function:: %s(bm, %s)\n\n" % (b[0], ", ".join([print_arg_in(arg) for arg in args_in_wash])))
# -- wash the comment # -- wash the comment
comment_washed = [] comment_washed = []
@@ -423,8 +423,8 @@ def main():
print(OUT_RST) print(OUT_RST)
def arg_name_with_default(arg): def print_arg_in(arg):
name, default_value, _, _ = arg (name, default_value, _, _) = arg
if default_value is None: if default_value is None:
return name return name
return name + '=' + default_value return name + '=' + default_value

View File

@@ -2098,8 +2098,6 @@ def write_rst_types_index(basepath):
fw(title_string("Types (bpy.types)", "=")) fw(title_string("Types (bpy.types)", "="))
fw(".. module:: bpy.types\n\n") fw(".. module:: bpy.types\n\n")
fw(".. toctree::\n") fw(".. toctree::\n")
# Only show top-level entries (avoids unreasonably large pages).
fw(" :maxdepth: 1\n")
fw(" :glob:\n\n") fw(" :glob:\n\n")
fw(" bpy.types.*\n\n") fw(" bpy.types.*\n\n")
@@ -2126,8 +2124,6 @@ def write_rst_ops_index(basepath):
write_example_ref("", fw, "bpy.ops") write_example_ref("", fw, "bpy.ops")
fw(".. toctree::\n") fw(".. toctree::\n")
fw(" :caption: Submodules\n") fw(" :caption: Submodules\n")
# Only show top-level entries (avoids unreasonably large pages).
fw(" :maxdepth: 1\n")
fw(" :glob:\n\n") fw(" :glob:\n\n")
fw(" bpy.ops.*\n\n") fw(" bpy.ops.*\n\n")
file.close() file.close()

View File

@@ -513,19 +513,17 @@ if(WITH_FFTW)
src/fx/Convolver.cpp src/fx/Convolver.cpp
src/fx/ConvolverReader.cpp src/fx/ConvolverReader.cpp
src/fx/ConvolverSound.cpp src/fx/ConvolverSound.cpp
src/fx/Equalizer.cpp
src/fx/FFTConvolver.cpp src/fx/FFTConvolver.cpp
src/fx/HRTF.cpp src/fx/HRTF.cpp
src/fx/ImpulseResponse.cpp src/fx/ImpulseResponse.cpp
src/util/FFTPlan.cpp src/util/FFTPlan.cpp
) )
set(FFTW_HDR set(FFTW_HDR
include/fx/BinauralSound.h include/fx/BinauralSound.h
include/fx/BinauralReader.h include/fx/BinauralReader.h
include/fx/Convolver.h include/fx/Convolver.h
include/fx/ConvolverReader.h include/fx/ConvolverReader.h
include/fx/ConvolverSound.h include/fx/ConvolverSound.h
include/fx/Equalizer.h
include/fx/FFTConvolver.h include/fx/FFTConvolver.h
include/fx/HRTF.h include/fx/HRTF.h
include/fx/HRTFLoader.h include/fx/HRTFLoader.h

View File

@@ -54,7 +54,6 @@
#ifdef WITH_CONVOLUTION #ifdef WITH_CONVOLUTION
#include "fx/BinauralSound.h" #include "fx/BinauralSound.h"
#include "fx/ConvolverSound.h" #include "fx/ConvolverSound.h"
#include "fx/Equalizer.h"
#endif #endif
#include <cassert> #include <cassert>
@@ -769,14 +768,4 @@ AUD_API AUD_Sound* AUD_Sound_Binaural(AUD_Sound* sound, AUD_HRTF* hrtfs, AUD_Sou
} }
} }
AUD_API AUD_Sound* AUD_Sound_equalize(AUD_Sound* sound, float *definition, int size, float maxFreqEq, int sizeConversion)
{
assert(sound);
std::shared_ptr<Buffer> buf = std::shared_ptr<Buffer>(new Buffer(sizeof(float)*size));
std::memcpy(buf->getBuffer(), definition, sizeof(float)*size);
AUD_Sound *equalizer=new AUD_Sound(new Equalizer(*sound, buf, size, maxFreqEq, sizeConversion));
return equalizer;
}
#endif #endif

View File

@@ -397,16 +397,6 @@ extern AUD_API AUD_Sound* AUD_Sound_mutable(AUD_Sound* sound);
#ifdef WITH_CONVOLUTION #ifdef WITH_CONVOLUTION
extern AUD_API AUD_Sound* AUD_Sound_Convolver(AUD_Sound* sound, AUD_ImpulseResponse* filter, AUD_ThreadPool* threadPool); extern AUD_API AUD_Sound* AUD_Sound_Convolver(AUD_Sound* sound, AUD_ImpulseResponse* filter, AUD_ThreadPool* threadPool);
extern AUD_API AUD_Sound* AUD_Sound_Binaural(AUD_Sound* sound, AUD_HRTF* hrtfs, AUD_Source* source, AUD_ThreadPool* threadPool); extern AUD_API AUD_Sound* AUD_Sound_Binaural(AUD_Sound* sound, AUD_HRTF* hrtfs, AUD_Source* source, AUD_ThreadPool* threadPool);
/**
* Creates an Equalizer for the sound
* \param sound The handle of the sound
* \param definition buffer of size*sizeof(float) with the array of equalization values
* \param maxFreqEq Maximum frequency refered by the array
* \param sizeConversion Size of the transformation. Must be 2^number (for example 1024, 2048,...)
* \return A handle to the Equalizer refered to that sound
*/
extern AUD_API AUD_Sound* AUD_Sound_equalize(AUD_Sound* sound, float *definition, int size, float maxFreqEq, int sizeConversion);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -53,7 +53,6 @@ extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds);
* \param buffer The buffer to write to. Must have a size of 3*4*length. * \param buffer The buffer to write to. Must have a size of 3*4*length.
* \param length How many samples to read from the sound. * \param length How many samples to read from the sound.
* \param samples_per_second How many samples to read per second of the sound. * \param samples_per_second How many samples to read per second of the sound.
* \param interrupt Must point to a short that equals 0. If it is set to a non-zero value, the method will be interrupted and return 0.
* \return How many samples really have been read. Always <= length. * \return How many samples really have been read. Always <= length.
*/ */
extern AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int samples_per_second, short* interrupt); extern AUD_API int AUD_readSound(AUD_Sound* sound, float* buffer, int length, int samples_per_second, short* interrupt);

View File

@@ -5,12 +5,12 @@ import os
import codecs import codecs
import numpy import numpy
from setuptools import setup, Extension from distutils.core import setup, Extension
if len(sys.argv) > 2 and sys.argv[1] == '--build-docs': if len(sys.argv) > 2 and sys.argv[1] == '--build-docs':
import subprocess import subprocess
from setuptools import Distribution from distutils.core import Distribution
from setuptools.command.build import build from distutils.command.build import build
dist = Distribution() dist = Distribution()
cmd = build(dist) cmd = build(dist)

View File

@@ -1,106 +0,0 @@
/*******************************************************************************
* Copyright 2022 Marcos Perez Gonzalez
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#pragma once
/**
* @file Equalizer.h
* @ingroup fx
* The Equalizer class.
*/
#include <memory>
#include <vector>
#include "ISound.h"
#include "ImpulseResponse.h"
AUD_NAMESPACE_BEGIN
class Buffer;
class ImpulseResponse;
/**
* This class represents a sound that can be modified depending on a given impulse response.
*/
class AUD_API Equalizer : public ISound
{
private:
/**
* A pointer to the imput sound.
*/
std::shared_ptr<ISound> m_sound;
/**
* Local definition of Equalizer
*/
std::shared_ptr<Buffer> m_bufEQ;
/**
* A pointer to the impulse response.
*/
std::shared_ptr<ImpulseResponse> m_impulseResponse;
/**
* delete copy constructor and operator=
*/
Equalizer(const Equalizer&) = delete;
Equalizer& operator=(const Equalizer&) = delete;
/**
* Create ImpulseResponse from the definition in the Buffer,
* using at the end a minimum phase change
*/
std::shared_ptr<ImpulseResponse> createImpulseResponse();
/**
* Create an Impulse Response with minimum phase distortion using Homomorphic
* The input is an Impulse Response
*/
std::shared_ptr<Buffer> minimumPhaseFilterHomomorphic(std::shared_ptr<Buffer> original, int lOriginal, int lWork);
/**
* Create an Impulse Response with minimum phase distortion using Hilbert
* The input is an Impulse Response
*/
std::shared_ptr<Buffer> minimumPhaseFilterHilbert(std::shared_ptr<Buffer> original, int lOriginal, int lWork);
public:
/**
* Creates a new Equalizer.
* \param sound The sound that will be equalized
*/
Equalizer(std::shared_ptr<ISound> sound, std::shared_ptr<Buffer> bufEQ, int externalSizeEq, float maxFreqEq, int sizeConversion);
virtual ~Equalizer();
virtual std::shared_ptr<IReader> createReader();
/*
* Length of the external equalizer definition. It must be the number of "float" positions of the Buffer
*/
int external_size_eq;
/*
* Length of the internal equalizer definition
*/
int filter_length;
/*
* Maximum frequency used in the equalizer definition
*/
float maxFreqEq;
};
AUD_NAMESPACE_END

View File

@@ -27,7 +27,7 @@
AUD_NAMESPACE_BEGIN AUD_NAMESPACE_BEGIN
BinauralReader::BinauralReader(std::shared_ptr<IReader> reader, std::shared_ptr<HRTF> hrtfs, std::shared_ptr<Source> source, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) : BinauralReader::BinauralReader(std::shared_ptr<IReader> reader, std::shared_ptr<HRTF> hrtfs, std::shared_ptr<Source> source, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) :
m_position(0), m_reader(reader), m_hrtfs(hrtfs), m_source(source), m_N(plan->getSize()), m_transition(false), m_transPos(CROSSFADE_SAMPLES*NUM_OUTCHANNELS), m_eosReader(false), m_eosTail(false), m_threadPool(threadPool) m_reader(reader), m_hrtfs(hrtfs), m_source(source), m_N(plan->getSize()), m_threadPool(threadPool), m_position(0), m_eosReader(false), m_eosTail(false), m_transition(false), m_transPos(CROSSFADE_SAMPLES*NUM_OUTCHANNELS)
{ {
if(m_hrtfs->isEmpty()) if(m_hrtfs->isEmpty())
AUD_THROW(StateException, "The provided HRTF object is empty"); AUD_THROW(StateException, "The provided HRTF object is empty");

View File

@@ -23,7 +23,7 @@
AUD_NAMESPACE_BEGIN AUD_NAMESPACE_BEGIN
Convolver::Convolver(std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> ir, int irLength, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) : Convolver::Convolver(std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> ir, int irLength, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) :
m_N(plan->getSize()), m_M(plan->getSize()/2), m_L(plan->getSize()/2), m_irBuffers(ir), m_numThreads(std::min(threadPool->getNumOfThreads(), static_cast<unsigned int>(m_irBuffers->size() - 1))), m_threadPool(threadPool), m_irLength(irLength), m_tailCounter(0), m_eos(false) m_N(plan->getSize()), m_M(plan->getSize()/2), m_L(plan->getSize()/2), m_irBuffers(ir), m_irLength(irLength), m_threadPool(threadPool), m_numThreads(std::min(threadPool->getNumOfThreads(), static_cast<unsigned int>(m_irBuffers->size() - 1))), m_tailCounter(0), m_eos(false)
{ {
m_resetFlag = false; m_resetFlag = false;

View File

@@ -24,7 +24,7 @@
AUD_NAMESPACE_BEGIN AUD_NAMESPACE_BEGIN
ConvolverReader::ConvolverReader(std::shared_ptr<IReader> reader, std::shared_ptr<ImpulseResponse> ir, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) : ConvolverReader::ConvolverReader(std::shared_ptr<IReader> reader, std::shared_ptr<ImpulseResponse> ir, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan) :
m_position(0), m_reader(reader), m_ir(ir), m_N(plan->getSize()), m_eosReader(false), m_eosTail(false), m_inChannels(reader->getSpecs().channels), m_irChannels(ir->getSpecs().channels), m_threadPool(threadPool) m_reader(reader), m_ir(ir), m_N(plan->getSize()), m_eosReader(false), m_eosTail(false), m_inChannels(reader->getSpecs().channels), m_irChannels(ir->getSpecs().channels), m_threadPool(threadPool), m_position(0)
{ {
m_nChannelThreads = std::min((int)threadPool->getNumOfThreads(), m_inChannels); m_nChannelThreads = std::min((int)threadPool->getNumOfThreads(), m_inChannels);
m_futures.resize(m_nChannelThreads); m_futures.resize(m_nChannelThreads);

View File

@@ -1,367 +0,0 @@
/*******************************************************************************
* Copyright 2022 Marcos Perez Gonzalez
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#include "fx/Equalizer.h"
#include <chrono>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include "Exception.h"
#include "fx/ConvolverReader.h"
#include "fx/ImpulseResponse.h"
#include "util/Buffer.h"
#include "util/FFTPlan.h"
#include "util/ThreadPool.h"
AUD_NAMESPACE_BEGIN
Equalizer::Equalizer(std::shared_ptr<ISound> sound, std::shared_ptr<Buffer> bufEQ, int externalSizeEq, float maxFreqEq, int sizeConversion) : m_sound(sound), m_bufEQ(bufEQ)
{
this->maxFreqEq = maxFreqEq;
this->external_size_eq = externalSizeEq;
filter_length = sizeConversion;
}
Equalizer::~Equalizer()
{
}
std::shared_ptr<IReader> Equalizer::createReader()
{
std::shared_ptr<FFTPlan> fp = std::shared_ptr<FFTPlan>(new FFTPlan(filter_length));
// 2 threads to start with
return std::shared_ptr<ConvolverReader>(new ConvolverReader(m_sound->createReader(), createImpulseResponse(), std::shared_ptr<ThreadPool>(new ThreadPool(2)), fp));
}
float calculateValueArray(float* data, float minX, float maxX, int length, float posX)
{
if(posX < minX)
return 1.0;
if(posX > maxX)
return data[length - 1];
float interval = (maxX - minX) / (float) length;
int idx = (int) ((posX - minX) / interval);
return data[idx];
}
void complex_prod(float a, float b, float c, float d, float* r, float* imag)
{
float prod1 = a * c;
float prod2 = b * d;
float prod3 = (a + b) * (c + d);
// Real Part
*r = prod1 - prod2;
// Imaginary Part
*imag = prod3 - (prod1 + prod2);
}
/**
* The creation of the ImpuseResponse which will be convoluted with the sound
*
* The implementation is based on scikit-signal
*/
std::shared_ptr<ImpulseResponse> Equalizer::createImpulseResponse()
{
std::shared_ptr<FFTPlan> fp = std::shared_ptr<FFTPlan>(new FFTPlan(filter_length));
fftwf_complex* buffer = (fftwf_complex*) fp->getBuffer();
std::memset(buffer, 0, filter_length * sizeof(fftwf_complex));
std::shared_ptr<IReader> soundReader = m_sound.get()->createReader();
Specs specsSound = soundReader.get()->getSpecs();
int sampleRate = specsSound.rate;
for(unsigned i = 0; i < filter_length / 2; i++)
{
double freq = (((float) i) / (float) filter_length) * (float) sampleRate;
double dbGain = calculateValueArray(m_bufEQ->getBuffer(), 0.0, maxFreqEq, external_size_eq, freq);
// gain = 10^(decibels / 20.0)
// 0 db = 1
// 20 db = 10
// 40 db = 100
float gain = (float) pow(10.0, dbGain / 20.0);
if(i == filter_length / 2 - 1)
{
gain = 0;
}
// IMPORTANT!!!! It is needed for the minimum phase step.
// Without this, the amplitude would be square rooted
//
gain *= gain;
// Calculation of exponential with std.. or "by hand"
/*
std::complex<float> preShift= std::complex<float>(0.0, -(filter_length - 1)
/ 2. * M_PI * freq / ( sampleRate/2)); std::complex<float> shift =
std::exp(preShift);
std::complex<float> cGain = gain * shift;
*/
float imaginary_shift = -(filter_length - 1) / 2. * M_PI * freq / (sampleRate / 2);
float cGain_real = gain * cos(imaginary_shift);
float cGain_imag = gain * sin(imaginary_shift);
int i2 = filter_length - i - 1;
buffer[i][0] = cGain_real; // Real
buffer[i][1] = cGain_imag; // Imag
if(i > 0 && i2 < filter_length)
{
buffer[i2][0] = cGain_real; // Real
buffer[i2][1] = cGain_imag; // Imag
}
}
// In place. From Complex to sample_t
fp->IFFT(buffer);
// Window Hamming
sample_t* pt_sample_t = (sample_t*) buffer;
float half_filter = ((float) filter_length) / 2.0;
for(int i = 0; i < filter_length; i++)
{
// Centered in filter_length/2
float window = 0.54 - 0.46 * cos((2 * M_PI * (float) i) / (float) (filter_length - 1));
pt_sample_t[i] *= window;
}
std::shared_ptr<Buffer> b2 = std::shared_ptr<Buffer>(new Buffer(filter_length * sizeof(sample_t)));
sample_t* buffer_real = (sample_t*) buffer;
sample_t* buffer2 = b2->getBuffer();
float normaliziter = (float) filter_length;
for(int i = 0; i < filter_length; i++)
{
buffer2[i] = (buffer_real[i] / normaliziter);
}
fp->freeBuffer(buffer);
//
// Here b2 is the buffer with a "valid" FIR (remember the squared amplitude
//
std::shared_ptr<Buffer> ir_minimum = minimumPhaseFilterHomomorphic(b2, filter_length, -1);
Specs specsIR;
specsIR.rate = sampleRate;
specsIR.channels = CHANNELS_MONO;
return std::shared_ptr<ImpulseResponse>(new ImpulseResponse(std::shared_ptr<StreamBuffer>(new StreamBuffer(ir_minimum, specsIR)), fp));
}
std::shared_ptr<Buffer> Equalizer::minimumPhaseFilterHomomorphic(std::shared_ptr<Buffer> original, int lOriginal, int lWork)
{
void* b_orig = original->getBuffer();
if(lWork < lOriginal || lWork < 0)
{
lWork = (int) pow(2, ceil(log2((float) (2 * (lOriginal - 1) / 0.01))));
}
std::shared_ptr<FFTPlan> fp = std::shared_ptr<FFTPlan>(new FFTPlan(lWork, 0.1));
fftwf_complex* buffer = (fftwf_complex*) fp->getBuffer();
sample_t* b_work = (sample_t*) buffer;
// Padding with 0
std::memset(b_work, 0, lWork * sizeof(sample_t));
std::memcpy(b_work, b_orig, lOriginal * sizeof(sample_t));
fp->FFT(b_work);
for(int i = 0; i < lWork / 2; i++)
{
buffer[i][0] = fabs(sqrt(buffer[i][0] * buffer[i][0] + buffer[i][1] * buffer[i][1]));
buffer[i][1] = 0.0;
int conjugate = lWork - i - 1;
buffer[conjugate][0] = buffer[i][0];
buffer[conjugate][1] = 0.0;
}
double threshold = pow(10.0, -7);
float logThreshold = (float) log(threshold);
// take 0.25*log(|H|**2) = 0.5*log(|H|)
for(int i = 0; i < lWork; i++)
{
if(buffer[i][0] < threshold)
{
buffer[i][0] = 0.5 * logThreshold;
}
else
{
buffer[i][0] = 0.5 * log(buffer[i][0]);
}
}
fp->IFFT(buffer);
// homomorphic filter
int stop = (lOriginal + 1) / 2;
b_work[0] = b_work[0] / (float) lWork;
for(int i = 1; i < stop; i++)
{
b_work[i] = b_work[i] / (float) lWork * 2.0;
}
for(int i = stop; i < lWork; i++)
{
b_work[i] = 0;
}
fp->FFT(buffer);
// EXP
// e^x = e^ (a+bi)= e^a * e^bi = e^a * (cos b + i sin b)
for(int i = 0; i < lWork / 2; i++)
{
float new_real;
float new_imag;
new_real = exp(buffer[i][0]) * cos(buffer[i][1]);
new_imag = exp(buffer[i][0]) * sin(buffer[i][1]);
buffer[i][0] = new_real;
buffer[i][1] = new_imag;
int conjugate = lWork - i - 1;
buffer[conjugate][0] = new_real;
buffer[conjugate][1] = new_imag;
}
// IFFT
fp->IFFT(buffer);
// Create new clean Buffer with only the result and normalization
int lOut = (lOriginal / 2) + lOriginal % 2;
std::shared_ptr<Buffer> bOut = std::shared_ptr<Buffer>(new Buffer(sizeof(float) * lOut));
float* bbOut = (float*) bOut->getBuffer();
// Copy and normalize
for(int i = 0; i < lOut; i++)
{
bbOut[i] = b_work[i] / (float) lWork;
}
fp->freeBuffer(buffer);
return bOut;
}
std::shared_ptr<Buffer> Equalizer::minimumPhaseFilterHilbert(std::shared_ptr<Buffer> original, int lOriginal, int lWork)
{
void* b_orig = original->getBuffer();
if(lWork < lOriginal || lWork < 0)
{
lWork = (int) pow(2, ceil(log2((float) (2 * (lOriginal - 1) / 0.01))));
}
std::shared_ptr<FFTPlan> fp = std::shared_ptr<FFTPlan>(new FFTPlan(lWork, 0.1));
fftwf_complex* buffer = (fftwf_complex*) fp->getBuffer();
sample_t* b_work = (sample_t*) buffer;
// Padding with 0
std::memset(b_work, 0, lWork * sizeof(sample_t));
std::memcpy(b_work, b_orig, lOriginal * sizeof(sample_t));
fp->FFT(b_work);
float mymax, mymin;
float n_half = (float) (lOriginal >> 1);
for(int i = 0; i < lWork; i++)
{
float w = ((float) i) * 2.0 * M_PI / (float) lWork * n_half;
float f1 = cos(w);
float f2 = sin(w);
float f3, f4;
complex_prod(buffer[i][0], buffer[i][1], f1, f2, &f3, &f4);
buffer[i][0] = f3;
buffer[i][1] = 0.0;
if(i == 0)
{
mymax = f3;
mymin = f3;
}
else
{
if(f3 < mymin)
mymin = f3;
if(f3 > mymax)
mymax = f3;
}
}
float dp = mymax - 1;
float ds = 0 - mymin;
float S = 4.0 / pow(2, (sqrt(1 + dp + ds) + sqrt(1 - dp + ds)));
for(int i = 0; i < lWork; i++)
{
buffer[i][0] = sqrt((buffer[i][0] + ds) * S) + 1.0E-10;
}
fftwf_complex* buffer_tmp = (fftwf_complex*) std::malloc(lWork * sizeof(fftwf_complex));
std::memcpy(buffer_tmp, buffer, lWork * sizeof(fftwf_complex));
//
// Hilbert transform
//
int midpt = lWork >> 1;
for(int i = 0; i < lWork; i++)
buffer[i][0] = log(buffer[i][0]);
fp->IFFT(buffer);
b_work[0] = 0.0;
for(int i = 1; i < midpt; i++)
{
b_work[i] /= (float) lWork;
}
b_work[midpt] = 0.0;
for(int i = midpt + 1; i < lWork; i++)
{
b_work[i] /= (-1.0 * lWork);
}
fp->FFT(b_work);
// Exp
for(int i = 0; i < lWork; i++)
{
float base = exp(buffer[i][0]);
buffer[i][0] = base * cos(buffer[i][1]);
buffer[i][1] = base * sin(buffer[i][1]);
complex_prod(buffer_tmp[i][0], buffer_tmp[i][1], buffer[i][0], buffer[i][1], &(buffer[i][0]), &(buffer[i][1]));
}
std::free(buffer_tmp);
fp->IFFT(buffer);
//
// Copy and normalization
//
int n_out = n_half + lOriginal % 2;
std::shared_ptr<Buffer> b_minimum = std::shared_ptr<Buffer>(new Buffer(n_out * sizeof(sample_t)));
std::memcpy(b_minimum->getBuffer(), buffer, n_out * sizeof(sample_t));
sample_t* b_final = (sample_t*) b_minimum->getBuffer();
for(int i = 0; i < n_out; i++)
{
b_final[i] /= (float) lWork;
}
return b_minimum;
}
AUD_NAMESPACE_END

View File

@@ -22,7 +22,7 @@
AUD_NAMESPACE_BEGIN AUD_NAMESPACE_BEGIN
FFTConvolver::FFTConvolver(std::shared_ptr<std::vector<std::complex<sample_t>>> ir, std::shared_ptr<FFTPlan> plan) : FFTConvolver::FFTConvolver(std::shared_ptr<std::vector<std::complex<sample_t>>> ir, std::shared_ptr<FFTPlan> plan) :
m_plan(plan), m_N(plan->getSize()), m_M(plan->getSize()/2), m_L(plan->getSize()/2), m_irBuffer(ir), m_tailPos(0) m_plan(plan), m_N(plan->getSize()), m_M(plan->getSize()/2), m_L(plan->getSize()/2), m_tailPos(0), m_irBuffer(ir)
{ {
m_tail = (float*)calloc(m_M - 1, sizeof(float)); m_tail = (float*)calloc(m_M - 1, sizeof(float));
m_realBufLen = ((m_N / 2) + 1) * 2; m_realBufLen = ((m_N / 2) + 1) * 2;

View File

@@ -75,7 +75,7 @@ void HRTFLoader::loadHRTFs(std::shared_ptr<HRTF> hrtfs, char ear, const std::str
if(ear == 'L') if(ear == 'L')
azim = 360 - azim; azim = 360 - azim;
} }
catch(...) catch(std::exception& e)
{ {
AUD_THROW(FileException, "The HRTF name doesn't follow the naming scheme: " + filename); AUD_THROW(FileException, "The HRTF name doesn't follow the naming scheme: " + filename);
} }
@@ -86,4 +86,4 @@ void HRTFLoader::loadHRTFs(std::shared_ptr<HRTF> hrtfs, char ear, const std::str
return; return;
} }
AUD_NAMESPACE_END AUD_NAMESPACE_END

View File

@@ -78,7 +78,7 @@ void HRTFLoader::loadHRTFs(std::shared_ptr<HRTF> hrtfs, char ear, const std::str
if(ear == 'L') if(ear == 'L')
azim = 360 - azim; azim = 360 - azim;
} }
catch(...) catch(std::exception& e)
{ {
AUD_THROW(FileException, "The HRTF name doesn't follow the naming scheme: " + filename); AUD_THROW(FileException, "The HRTF name doesn't follow the naming scheme: " + filename);
} }
@@ -90,4 +90,4 @@ void HRTFLoader::loadHRTFs(std::shared_ptr<HRTF> hrtfs, char ear, const std::str
return; return;
} }
AUD_NAMESPACE_END AUD_NAMESPACE_END

View File

@@ -13,12 +13,10 @@ endif()
# Exporting functions from the blender binary gives linker warnings on Apple arm64 systems. # Exporting functions from the blender binary gives linker warnings on Apple arm64 systems.
# Silence them here. # Silence them here.
if(APPLE) if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") string(APPEND CMAKE_C_FLAGS " -fvisibility=hidden")
string(APPEND CMAKE_C_FLAGS " -fvisibility=hidden") string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden")
string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden")
endif()
endif() endif()
endif() endif()
@@ -263,11 +261,9 @@ set(LIB
blender_add_lib(extern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") blender_add_lib(extern_mantaflow "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(WITH_OPENVDB) # The VDB libs above are only added to as INTERFACE libs by blender_add_lib,
# The VDB libs above are only added to as INTERFACE libs by blender_add_lib, # meaning extern_mantaflow itself actually does not have a dependency on the
# meaning extern_mantaflow itself actually does not have a dependency on the # openvdb libraries, and CMAKE is free to link the vdb libs before
# openvdb libraries, and CMAKE is free to link the vdb libs before # extern_mantaflow causing linker errors on linux. By explicitly declaring
# extern_mantaflow causing linker errors on linux. By explicitly declaring # a dependency here, cmake will do the right thing.
# a dependency here, cmake will do the right thing. target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})
target_link_libraries(extern_mantaflow PRIVATE ${OPENVDB_LIBRARIES})
endif()

View File

@@ -7,7 +7,6 @@ set(INC
set(INC_SYS set(INC_SYS
${VULKAN_INCLUDE_DIRS} ${VULKAN_INCLUDE_DIRS}
${MOLTENVK_INCLUDE_DIRS}
) )
set(SRC set(SRC

View File

@@ -1,15 +0,0 @@
diff --git a/extern/vulkan_memory_allocator/vk_mem_alloc.h b/extern/vulkan_memory_allocator/vk_mem_alloc.h
index 60f572038c0..63a9994ba46 100644
--- a/extern/vulkan_memory_allocator/vk_mem_alloc.h
+++ b/extern/vulkan_memory_allocator/vk_mem_alloc.h
@@ -13371,8 +13371,8 @@ bool VmaDefragmentationContext_T::IncrementCounters(VkDeviceSize bytes)
// Early return when max found
if (++m_PassStats.allocationsMoved >= m_MaxPassAllocations || m_PassStats.bytesMoved >= m_MaxPassBytes)
{
- VMA_ASSERT(m_PassStats.allocationsMoved == m_MaxPassAllocations ||
- m_PassStats.bytesMoved == m_MaxPassBytes && "Exceeded maximal pass threshold!");
+ VMA_ASSERT((m_PassStats.allocationsMoved == m_MaxPassAllocations ||
+ m_PassStats.bytesMoved == m_MaxPassBytes) && "Exceeded maximal pass threshold!");
return true;
}
return false;

File diff suppressed because it is too large Load Diff

View File

@@ -85,11 +85,15 @@ elseif(WIN32 AND MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# there is no /arch:SSE3, but intrinsics are available anyway # there is no /arch:SSE3, but intrinsics are available anyway
if(CMAKE_CL_64) if(CMAKE_CL_64)
set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}") set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
set(CYCLES_SSE3_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}") set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS}")
set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}")
set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}") set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}")
else() else()
set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}") set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
set(CYCLES_SSE41_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}") set(CYCLES_SSE41_KERNEL_FLAGS "/arch:SSE2 ${CYCLES_KERNEL_FLAGS}")
set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_AVX_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}")
set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}") set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_AVX2_ARCH_FLAGS} ${CYCLES_KERNEL_FLAGS}")
endif() endif()
@@ -122,7 +126,11 @@ elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
endif() endif()
set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS} -msse -msse2") set(CYCLES_SSE2_KERNEL_FLAGS "${CYCLES_KERNEL_FLAGS} -msse -msse2")
set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS} -msse3 -mssse3 -msse4.1") set(CYCLES_SSE3_KERNEL_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS} -msse3 -mssse3")
set(CYCLES_SSE41_KERNEL_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS} -msse4.1")
if(CXX_HAS_AVX)
set(CYCLES_AVX_KERNEL_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS} -mavx")
endif()
if(CXX_HAS_AVX2) if(CXX_HAS_AVX2)
set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS} -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mf16c") set(CYCLES_AVX2_KERNEL_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS} -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mf16c")
endif() endif()
@@ -136,8 +144,13 @@ elseif(WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Intel")
if(CXX_HAS_SSE) if(CXX_HAS_SSE)
set(CYCLES_SSE2_KERNEL_FLAGS "/QxSSE2") set(CYCLES_SSE2_KERNEL_FLAGS "/QxSSE2")
set(CYCLES_SSE3_KERNEL_FLAGS "/QxSSSE3")
set(CYCLES_SSE41_KERNEL_FLAGS "/QxSSE4.1") set(CYCLES_SSE41_KERNEL_FLAGS "/QxSSE4.1")
if(CXX_HAS_AVX)
set(CYCLES_AVX_KERNEL_FLAGS "/arch:AVX")
endif()
if(CXX_HAS_AVX2) if(CXX_HAS_AVX2)
set(CYCLES_AVX2_KERNEL_FLAGS "/QxCORE-AVX2") set(CYCLES_AVX2_KERNEL_FLAGS "/QxCORE-AVX2")
endif() endif()
@@ -161,8 +174,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(CYCLES_SSE2_KERNEL_FLAGS "-xsse2") set(CYCLES_SSE2_KERNEL_FLAGS "-xsse2")
endif() endif()
set(CYCLES_SSE3_KERNEL_FLAGS "-xssse3")
set(CYCLES_SSE41_KERNEL_FLAGS "-xsse4.1") set(CYCLES_SSE41_KERNEL_FLAGS "-xsse4.1")
if(CXX_HAS_AVX)
set(CYCLES_AVX_KERNEL_FLAGS "-xavx")
endif()
if(CXX_HAS_AVX2) if(CXX_HAS_AVX2)
set(CYCLES_AVX2_KERNEL_FLAGS "-xcore-avx2") set(CYCLES_AVX2_KERNEL_FLAGS "-xcore-avx2")
endif() endif()
@@ -172,10 +190,15 @@ endif()
if(CXX_HAS_SSE) if(CXX_HAS_SSE)
add_definitions( add_definitions(
-DWITH_KERNEL_SSE2 -DWITH_KERNEL_SSE2
-DWITH_KERNEL_SSE3
-DWITH_KERNEL_SSE41 -DWITH_KERNEL_SSE41
) )
endif() endif()
if(CXX_HAS_AVX)
add_definitions(-DWITH_KERNEL_AVX)
endif()
if(CXX_HAS_AVX2) if(CXX_HAS_AVX2)
add_definitions(-DWITH_KERNEL_AVX2) add_definitions(-DWITH_KERNEL_AVX2)
endif() endif()
@@ -275,7 +298,7 @@ if(WITH_CYCLES_DEVICE_METAL)
add_definitions(-DWITH_METAL) add_definitions(-DWITH_METAL)
endif() endif()
if(WITH_CYCLES_DEVICE_ONEAPI) if (WITH_CYCLES_DEVICE_ONEAPI)
add_definitions(-DWITH_ONEAPI) add_definitions(-DWITH_ONEAPI)
endif() endif()

View File

@@ -92,7 +92,7 @@ class AddPresetPerformance(AddPresetBase, Operator):
preset_defines = [ preset_defines = [
"render = bpy.context.scene.render", "render = bpy.context.scene.render",
"cycles = bpy.context.scene.cycles", "cycles = bpy.context.scene.cycles"
] ]
preset_values = [ preset_values = [

Some files were not shown because too many files have changed in this diff Show More