1
1

Compare commits

..

43 Commits

Author SHA1 Message Date
018c9e9da8 Merge branch 'master' into xr-dev 2022-12-12 21:33:25 +09:00
d1b2ed706c XR: Add mouse event simulation
Updated version of https://developer.blender.org/D13153.

This enables practical use of more Blender operators in VR by
converting 3D controller positions to 2D mouse positions as well as
simulating the event type (LEFTMOUSE, MOUSEMOVE...) and value
(PRESS, CLICK...) based on VR controller inputs. In this way, the
view3d.select operator can be used in VR without any modifications to
the operator logic, enabling selection of armatures, empties, etc. in
VR.

If an XR action's simulate_mouse property is set, the 3D position of
the corresponding controller aim pose will be projected to a 2D mouse
position using the perspective of the user's preferred eye
(XrSessionSettings.projection_eye) and the result stored in
wmEvent.xy/mval. In this way, operators can make use of these mouse
values as usual, without needing to know that the event is an XR event.

Along with mouse coordinate simulation, the XR event type and value
can be simulated as a different wmEvent type/value during handling,
where this mapping is configurable via the XrActionMapItem.simulate
(XrSimulateMouseParams) property of an XR action map item. The
simulated type/value can be individually set for press, hold (modal
operators only), and release VR button interactions, depending on the
operator execution mode (XrActionMapItem.op_mode).
2022-12-12 21:26:01 +09:00
786aad68b2 Fix virtual camera-related crashes due to failed assert
See comment on https://developer.blender.org/D16366.

When browsing materials, showing material properties, or changing
camera settings for the virtual camera, Blender would crash due to a
failed assert in gpu_offscreen_fb_get() (gpu_framebuffer.cc L602),
where the framebuffer list for the virtual camera offscreen would
appear to contain corrupted data.

This was likely caused by the pointer to the virtual camera offscreen
(stored as camera->runtime.virtual_monitor_offscreen) being shared
among src and dst camera data-blocks in camera_copy_data(), which is
called from depsgraph copy-on-write (when showing material properties,
changing camera settings, etc.). This should probably not be the case,
as if one data-block is freed (freeing the runtime data), then the
other will have a dangling pointer to the offscreen.

As a tentative solution, free the runtime data for the dst camera in
camera_copy_data() to prevent sharing virtual monitor offscreens across
cameras. In this way, no two virtual camera data-blocks should share
the same offscreen pointer and a new offscreen will be created for the
dst camera if necessary in view3d_virtual_camera_update().
2022-12-12 21:25:43 +09:00
3e725b55cf Merge branch 'temp-xr-virtual-camera-experiment' into xr-dev 2022-11-23 13:51:44 +09:00
0ce51c2d90 Merge branch 'master' into xr-dev 2022-11-23 12:29:19 +09:00
f7cdba506b Fix compilation error after rebase. 2022-11-15 14:20:06 +01:00
37b374d9ba Merge branch 'master' into temp-xr-virtual-camera-experiment 2022-11-15 14:06:05 +01:00
80f0d9e29d Add support for XrSession (untested). 2022-11-11 16:06:09 +01:00
3a3947bcf8 Revert incorrect change. 2022-11-11 15:07:23 +01:00
e37d254170 Rename to virtual monitor. 2022-11-11 14:53:21 +01:00
3da5748787 Fix corrupt rv3d. 2022-11-11 14:09:19 +01:00
ca134581a2 First setup of rv3d. 2022-11-09 14:32:56 +01:00
0a01bec400 Fixed using correct texture. 2022-11-09 13:18:12 +01:00
d63d2c8b9e Use Material flag to identify virtual camera. 2022-11-09 12:18:22 +01:00
027ca9b91e Add GPU debugging group. 2022-11-09 11:17:07 +01:00
935cabdb6a Initial implementation of 2 stage drawing. 2022-11-02 15:47:53 +01:00
a083b23ceb First iteration of a virtual camera node. 2022-11-02 13:17:35 +01:00
00dcfdf916 Merge branch 'master' into xr-dev 2022-09-08 13:00:12 +09:00
a39532670f Merge branch 'master' into xr-dev 2022-06-17 17:27:30 +09:00
7948150ca3 Merge branch 'master' into xr-dev 2022-06-10 06:33:32 +09:00
2e66e2c37d Merge branch 'master' into xr-dev 2022-06-09 07:06:03 +09:00
86e367028b Merge branch 'master' into xr-dev 2022-05-28 17:29:12 +09:00
c5a8372a11 Merge branch 'master' into xr-dev 2022-05-09 18:10:04 +09:00
07c35a743a Merge branch 'master' into xr-dev 2022-05-03 10:39:15 +09:00
62cabfca87 XR: Add dedicated handling/API for VR trackers
Allows for easier testing/debugging of tracker functionality by
separating trackers from session controller data. Also, this should
make it possible to use controllers and trackers during a VR session
simultaneously.
2022-05-03 09:58:15 +09:00
b0825be786 Merge branch 'master' into xr-dev 2022-04-04 16:34:36 +09:00
597b372aeb Fix build error due to merge 2022-04-03 11:47:52 +09:00
d34e2cc3be Merge branch 'master' into xr-dev 2022-04-03 11:10:23 +09:00
07b0b6e9b7 Merge branch 'master' into xr-dev 2022-03-26 09:14:01 +09:00
d834dcf1da Merge branch 'master' into xr-dev 2022-03-25 15:34:46 +09:00
ff347bf950 Merge branch 'master' into xr-dev 2022-03-15 20:06:14 +09:00
2c631849da Merge branch 'master' into xr-dev 2022-03-10 19:57:57 +09:00
23c5e05267 Merge branch 'master' into xr-dev 2022-02-27 18:56:36 +09:00
fbe89b879c XR: Fix crash on executing some action operators
Since the XR area does not have any region geometry, hud updates from
operators would cause invalid access when updating region sizes.
2022-02-27 18:56:06 +09:00
c664cc77af Merge branch 'master' into xr-dev 2022-02-23 16:48:02 +09:00
abd81d76d2 XR: Enable (selectively) Vive Tracker extension
Allows action bindings for the HTC Vive Trackers, so that their poses
can be queried and used for motion capture objects. For details on the
available tracker roles/user path identifiers, see: https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_HTCX_vive_tracker_interaction

Currently the extension is only supported by the SteamVR runtime (1.21)
and there a few issues (which could be on the Blender or SteamVR side),
such as incorrect controller poses when the extension is enabled.

For this reason, the tracker extension is added as a session option to
enable only when one wants to exclusively use trackers instead of
controllers.
2022-02-23 16:46:17 +09:00
b33aaf5a2c Merge branch 'master' into xr-dev 2022-02-22 17:47:20 +09:00
5370da566e XR: Add grab transform operator
From xr-controller-support branch.
2022-02-22 16:12:19 +09:00
b4f3d7fdb1 XR: Add raycast select operator
From xr-controller-support branch.
2022-02-22 16:08:09 +09:00
f97ba497b9 Cleanup: clang-format, warnings 2022-02-20 18:19:39 +09:00
3a78eda6db Update pipeline config 2022-02-20 15:58:17 +09:00
5781031d1c XR: Motion Capture
https://developer.blender.org/D10947
2022-02-20 15:53:51 +09:00
517dc644f1 XR: Customizable Actions
https://developer.blender.org/D13420
2022-02-20 15:00:10 +09:00
5132 changed files with 127854 additions and 2284354 deletions

8
.arcconfig Normal file
View File

@@ -0,0 +1,8 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"phabricator.uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/master",
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "master"
}

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.
@@ -130,7 +130,7 @@ PenaltyReturnTypeOnItsOwnLine: 10000
# #
PenaltyBreakAssignment: 100 PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: Empty AllowShortFunctionsOnASingleLine: None
SortIncludes: true SortIncludes: true
@@ -236,8 +236,6 @@ ForEachMacros:
- LOOP_UNSELECTED_POINTS - LOOP_UNSELECTED_POINTS
- LOOP_VISIBLE_KEYS - LOOP_VISIBLE_KEYS
- LOOP_VISIBLE_POINTS - LOOP_VISIBLE_POINTS
- LIGHT_FOREACH_BEGIN_DIRECTIONAL
- LIGHT_FOREACH_BEGIN_LOCAL
- LISTBASE_CIRCULAR_BACKWARD_BEGIN - LISTBASE_CIRCULAR_BACKWARD_BEGIN
- LISTBASE_CIRCULAR_FORWARD_BEGIN - LISTBASE_CIRCULAR_FORWARD_BEGIN
- LISTBASE_FOREACH - LISTBASE_FOREACH

View File

@@ -1,5 +0,0 @@
${CommitTitle}
${CommitBody}
Pull Request: https://projects.blender.org/blender/blender/pulls/${PullRequestIndex}

View File

@@ -1,3 +0,0 @@
${PullRequestTitle}
Pull Request: https://projects.blender.org/blender/blender/pulls/${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

@@ -1,4 +1,5 @@
This repository is only used as a mirror. Blender development happens on projects.blender.org. This repository is only used as a mirror of git.blender.org. Blender development happens on
https://developer.blender.org.
To get started with contributing code, please see: To get started with contributing code, please see:
https://wiki.blender.org/wiki/Process/Contributing_Code https://wiki.blender.org/wiki/Process/Contributing_Code

3
.github/stale.yml vendored
View File

@@ -15,7 +15,8 @@ staleLabel: stale
# Comment to post when closing a stale Issue or Pull Request. # Comment to post when closing a stale Issue or Pull Request.
closeComment: > closeComment: >
This issue has been automatically closed, because this repository is only This issue has been automatically closed, because this repository is only
used as a mirror. Blender development happens on projects.blender.org. used as a mirror of git.blender.org. Blender development happens on
developer.blender.org.
To get started contributing code, please read: To get started contributing code, please read:
https://wiki.blender.org/wiki/Process/Contributing_Code https://wiki.blender.org/wiki/Process/Contributing_Code

27
.gitignore vendored
View File

@@ -39,7 +39,7 @@ Desktop.ini
/doc/python_api/rst/bmesh.ops.rst /doc/python_api/rst/bmesh.ops.rst
# in-source lib downloads # in-source lib downloads
/build_files/build_environment/downloads/ /build_files/build_environment/downloads
# in-source buildbot signing configuration # in-source buildbot signing configuration
/build_files/buildbot/codesign/config_server.py /build_files/buildbot/codesign/config_server.py
@@ -48,27 +48,4 @@ Desktop.ini
waveletNoiseTile.bin waveletNoiseTile.bin
# testing environment # testing environment
/Testing/ /Testing
# Translations.
/locale/user-config.py
# External repositories.
/scripts/addons/
/scripts/addons_contrib/
# Ignore old submodules directories.
# Eventually need to get rid of those, but for the first time of transition
# avoid indidents when the folders exists after bisect and developers staging
# them by accident.
/release/scripts/addons/
/release/datafiles/locale/
/release/scripts/addons_contrib/
/source/tools/
# Build files for VS and VS Code.
/build/
/out/
CMakeSettings.json
CMakePresets.json
CMakeUserPresets.json

20
.gitmodules vendored Normal file
View File

@@ -0,0 +1,20 @@
[submodule "release/scripts/addons"]
path = release/scripts/addons
url = ../blender-addons.git
branch = master
ignore = all
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
branch = master
ignore = all
[submodule "release/datafiles/locale"]
path = release/datafiles/locale
url = ../blender-translations.git
branch = master
ignore = all
[submodule "source/tools"]
path = source/tools
url = ../blender-dev-tools.git
branch = master
ignore = all

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation # Copyright 2006 Blender Foundation. All rights reserved.
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Early Initialization # Early Initialization
@@ -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()
@@ -164,29 +160,17 @@ get_blender_version()
# Declare Options # Declare Options
# Blender internal features # Blender internal features
option(WITH_BLENDER "Build blender (disable to build only Cycles stand-alone)." 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
@@ -331,6 +310,7 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" ON) option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" ON)
# Image format support # Image format support
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON) option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON) option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
@@ -357,7 +337,6 @@ option(WITH_MATERIALX "Enable MaterialX Support" OFF)
# Disable opencollada when we don't have precompiled libs # Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON) option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ON)
option(WITH_IO_WAVEFRONT_OBJ "Enable Wavefront-OBJ 3D file format support (*.obj)" ON) option(WITH_IO_WAVEFRONT_OBJ "Enable Wavefront-OBJ 3D file format support (*.obj)" ON)
option(WITH_IO_PLY "Enable PLY 3D file format support (*.ply)" ON)
option(WITH_IO_STL "Enable STL 3D file format support (*.stl)" ON) option(WITH_IO_STL "Enable STL 3D file format support (*.stl)" ON)
option(WITH_IO_GPENCIL "Enable grease-pencil file format IO (*.svg, *.pdf)" ON) option(WITH_IO_GPENCIL "Enable grease-pencil file format IO (*.svg, *.pdf)" ON)
@@ -370,12 +349,11 @@ 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})
unset(_option_default)
option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF) option(WITH_JACK_DYNLOAD "Enable runtime dynamic JACK libraries loading" OFF)
else() else()
set(WITH_JACK OFF) set(WITH_JACK OFF)
@@ -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)
@@ -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()
@@ -617,31 +578,31 @@ endif()
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)
option(WITH_RENDERDOC "Use Renderdoc API to capture frames" OFF)
mark_as_advanced( mark_as_advanced(
WITH_OPENGL WITH_OPENGL
WITH_GPU_BUILDTIME_SHADER_BUILDER WITH_GPU_BUILDTIME_SHADER_BUILDER
WITH_RENDERDOC
) )
# Vulkan # Vulkan
option(WITH_VULKAN_BACKEND "Enable Vulkan as graphics backend (only for development)" OFF) option(WITH_VULKAN_BACKEND "Enable Vulkan as graphics backend (only for development)" OFF)
option(WITH_VULKAN_GUARDEDALLOC "Use guardedalloc for host allocations done inside Vulkan (development option)" OFF)
mark_as_advanced( mark_as_advanced(
WITH_VULKAN_BACKEND WITH_VULKAN_BACKEND
WITH_VULKAN_GUARDEDALLOC
) )
# 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}/${})
@@ -788,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)
@@ -869,34 +835,47 @@ 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)
# NanoVDB requires OpenVDB to convert the data structure # NanoVDB requires OpenVDB to convert the data structure
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF) set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
# OpenVDB, Alembic and Vulkan, OSL uses 'half' or 'imath' 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_ALEMBIC OFF) set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENCOLORIO OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_VULKAN_BACKEND OFF)
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_CYCLES_OSL 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)
# auto enable llvm for cycles_osl # auto enable llvm for cycles_osl
if(WITH_CYCLES_OSL) if(WITH_CYCLES_OSL)
set(WITH_LLVM ON CACHE BOOL "" FORCE) set(WITH_LLVM ON CACHE BOOL "" FORCE)
@@ -906,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)
@@ -957,6 +947,21 @@ endif()
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Check if Sub-modules are Cloned # Check if Sub-modules are Cloned
if(WITH_INTERNATIONAL)
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/datafiles/locale")
list(LENGTH RESULT DIR_LEN)
if(DIR_LEN EQUAL 0)
message(
WARNING
"Translation path '${CMAKE_SOURCE_DIR}/release/datafiles/locale' is missing, "
"This is a 'git submodule', which are known not to work with bridges to other version "
"control systems."
)
set(TRANSLATIONS_FOUND OFF)
set_and_warn_library_found("Translations" TRANSLATIONS_FOUND WITH_INTERNATIONAL)
endif()
endif()
if(WITH_PYTHON) if(WITH_PYTHON)
# While we have this as an '#error' in 'bpy_capi_utils.h', # While we have this as an '#error' in 'bpy_capi_utils.h',
# upgrading Python tends to cause confusion for users who build. # upgrading Python tends to cause confusion for users who build.
@@ -972,14 +977,14 @@ if(WITH_PYTHON)
) )
endif() endif()
file(GLOB RESULT "${CMAKE_SOURCE_DIR}/scripts/addons") file(GLOB RESULT "${CMAKE_SOURCE_DIR}/release/scripts/addons")
list(LENGTH RESULT DIR_LEN) list(LENGTH RESULT DIR_LEN)
if(DIR_LEN EQUAL 0) if(DIR_LEN EQUAL 0)
message( message(
WARNING WARNING
"Addons path '${CMAKE_SOURCE_DIR}/scripts/addons' is missing. " "Addons path '${CMAKE_SOURCE_DIR}/release/scripts/addons' is missing, "
"This is an external repository which needs to be checked out. Use `make update` to do so. " "This is a 'git submodule', which are known not to work with bridges to other version "
"* CONTINUING WITHOUT ADDONS *" "control systems: * CONTINUING WITHOUT ADDONS *"
) )
endif() endif()
endif() endif()
@@ -1016,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)
@@ -1088,6 +1091,21 @@ if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
endif() endif()
if(WITH_CYCLES) if(WITH_CYCLES)
if(NOT WITH_OPENIMAGEIO)
message(
FATAL_ERROR
"Cycles requires WITH_OPENIMAGEIO, the library may not have been found. "
"Configure OIIO or disable WITH_CYCLES"
)
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(
@@ -1224,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
@@ -1273,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 "extern_bullet") # set(BULLET_LIBRARIES "")
endif()
endif() endif()
@@ -1440,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)
@@ -1482,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)
@@ -1560,9 +1577,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
# add_check_c_compiler_flag(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros) # add_check_c_compiler_flag(C_WARNINGS C_WARN_UNUSED_MACROS -Wunused-macros)
# add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros) # add_check_cxx_compiler_flag(CXX_WARNINGS CXX_WARN_UNUSED_MACROS -Wunused-macros)
add_check_c_compiler_flag(C_WARNINGS C_WARN_ERROR_UNGUARDED_AVAILABILITY_NEW -Werror=unguarded-availability-new)
add_check_c_compiler_flag(CXX_WARNINGS CXX_WARN_ERROR_UNGUARDED_AVAILABILITY_NEW -Werror=unguarded-availability-new)
# --------------------- # ---------------------
# Suppress Strict Flags # Suppress Strict Flags
@@ -1615,7 +1629,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# warning level: # warning level:
"/W3" "/W3"
"/w34062" # switch statement contains 'default' but no 'case' labels "/w34062" # switch statement contains 'default' but no 'case' labels
"/w34100" # 'identifier' : unreferenced formal parameter
"/w34115" # 'type' : named type definition in parentheses "/w34115" # 'type' : named type definition in parentheses
"/w34189" # local variable is initialized but not referenced "/w34189" # local variable is initialized but not referenced
# see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017 # see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
@@ -1708,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)
@@ -1942,6 +1961,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_IMAGE_OPENEXR) info_cfg_option(WITH_IMAGE_OPENEXR)
info_cfg_option(WITH_IMAGE_OPENJPEG) info_cfg_option(WITH_IMAGE_OPENJPEG)
info_cfg_option(WITH_IMAGE_TIFF) info_cfg_option(WITH_IMAGE_TIFF)
info_cfg_option(WITH_OPENIMAGEIO)
info_cfg_text("Audio:") info_cfg_text("Audio:")
info_cfg_option(WITH_CODEC_AVI) info_cfg_option(WITH_CODEC_AVI)

View File

@@ -69,14 +69,7 @@ Static Source Code Checking
* check_cmake: Runs our own cmake file checker which detects errors in the cmake file list definitions. * check_cmake: Runs our own cmake file checker which detects errors in the cmake file list definitions.
* check_pep8: Checks all Python script are pep8 which are tagged to use the stricter formatting. * check_pep8: Checks all Python script are pep8 which are tagged to use the stricter formatting.
* check_mypy: Checks all Python scripts using mypy, * check_mypy: Checks all Python scripts using mypy,
see: 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.
@@ -85,7 +78,7 @@ Spell Checkers
* check_spelling_osl: Check for spelling errors (OSL only). * check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only). * check_spelling_py: Check for spelling errors (Python only).
Note: an additional word-list is maintained at: 'tools/check_source/check_spelling_c_config.py' Note: an additional word-list is maintained at: 'source/tools/check_source/check_spelling_c_config.py'
Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument, Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files. so re-running does not need to re-check unchanged files.
@@ -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})
@@ -299,11 +292,7 @@ else
ifneq ("$(wildcard $(DEPS_BUILD_DIR)/build.ninja)","") ifneq ("$(wildcard $(DEPS_BUILD_DIR)/build.ninja)","")
DEPS_BUILD_COMMAND:=ninja DEPS_BUILD_COMMAND:=ninja
else else
ifeq ($(OS), Darwin)
DEPS_BUILD_COMMAND:=make -s DEPS_BUILD_COMMAND:=make -s
else
DEPS_BUILD_COMMAND:="$(BLENDER_DIR)/build_files/build_environment/linux/make_deps_wrapper.sh" -s
endif
endif endif
endif endif
@@ -402,7 +391,7 @@ endif
deps: .FORCE deps: .FORCE
@echo @echo
@echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\", install to \"$(DEPS_INSTALL_DIR)\" @echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\"
@cmake -H"$(DEPS_SOURCE_DIR)" \ @cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \ -B"$(DEPS_BUILD_DIR)" \
@@ -490,22 +479,18 @@ check_smatch: .FORCE
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py" $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_mypy: .FORCE check_mypy: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/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)/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) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/scripts" "$(BLENDER_DIR)/release/scripts"
check_spelling_c: .FORCE check_spelling_c: .FORCE
@cd "$(BUILD_DIR)" ; \ @cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \ --cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/source" \ "$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \ "$(BLENDER_DIR)/intern/cycles" \
@@ -515,21 +500,21 @@ check_spelling_c: .FORCE
check_spelling_osl: .FORCE check_spelling_osl: .FORCE
@cd "$(BUILD_DIR)" ; \ @cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \ --cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" "$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: .FORCE check_descriptions: .FORCE
@$(BLENDER_BIN) --background -noaudio --factory-startup --python \ @$(BLENDER_BIN) --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/tools/check_source/check_descriptions.py" "$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
check_deprecated: .FORCE check_deprecated: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \ @PYTHONIOENCODING=utf_8 $(PYTHON) \
tools/check_source/check_deprecated.py source/tools/check_source/check_deprecated.py
check_licenses: .FORCE check_licenses: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \ @PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_licenses.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_licenses.py" \
"--show-headers=$(SHOW_HEADERS)" "--show-headers=$(SHOW_HEADERS)"
check_pep8: .FORCE check_pep8: .FORCE
@@ -538,7 +523,7 @@ check_pep8: .FORCE
check_cmake: .FORCE check_cmake: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \ @PYTHONIOENCODING=utf_8 $(PYTHON) \
tools/check_source/check_cmake_consistency.py source/tools/check_source/check_cmake_consistency.py
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -576,8 +561,8 @@ update_code: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py --no-libraries @$(PYTHON) ./build_files/utils/make_update.py --no-libraries
format: .FORCE format: .FORCE
@PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) tools/utils_maintenance/clang_format_paths.py $(PATHS) @PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
@$(PYTHON) tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS) @$(PYTHON) source/tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

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://projects.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

@@ -78,7 +78,12 @@ include(cmake/tbb.cmake)
include(cmake/python.cmake) include(cmake/python.cmake)
include(cmake/llvm.cmake) include(cmake/llvm.cmake)
include(cmake/osl.cmake) include(cmake/osl.cmake)
include(cmake/numpy.cmake) option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(USE_PIP_NUMPY ON)
else()
include(cmake/numpy.cmake)
endif()
include(cmake/python_site_packages.cmake) include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake) include(cmake/package_python.cmake)
include(cmake/openimageio.cmake) include(cmake/openimageio.cmake)

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,7 +24,7 @@
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})

View File

@@ -16,24 +16,23 @@ function(download_source dep)
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
@@ -43,11 +42,11 @@ function(download_source dep)
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

@@ -6,29 +6,19 @@
set(EMBREE_EXTRA_ARGS set(EMBREE_EXTRA_ARGS
-DEMBREE_ISPC_SUPPORT=OFF -DEMBREE_ISPC_SUPPORT=OFF
-DEMBREE_TUTORIALS=OFF -DEMBREE_TUTORIALS=OFF
-DEMBREE_STATIC_LIB=OFF -DEMBREE_STATIC_LIB=ON
-DEMBREE_RAY_MASK=ON -DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON -DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF -DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_BACKFACE_CULLING_CURVES=ON
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
-DEMBREE_TASKING_SYSTEM=TBB -DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb -DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb -DTBB_ROOT=${LIBDIR}/tbb
) )
if(WIN32) if (NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS} ${EMBREE_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d -DEMBREE_MAX_ISA=AVX2)
)
endif()
if(NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2
)
endif() endif()
if(TBB_STATIC_LIBRARY) if(TBB_STATIC_LIBRARY)
@@ -54,19 +44,25 @@ add_dependencies(
) )
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_embree after_install ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/include ${HARVEST_TARGET}/embree/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree ${HARVEST_TARGET}/embree
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/lib ${HARVEST_TARGET}/embree/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/share ${HARVEST_TARGET}/embree/share
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4.dll ${HARVEST_TARGET}/embree/bin/embree4.dll
DEPENDEES install DEPENDEES install
) )
else() else()
ExternalProject_Add_Step(external_embree after_install ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4_d.dll ${HARVEST_TARGET}/embree/bin/embree4_d.dll 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/embree4_d.lib ${HARVEST_TARGET}/embree/lib/embree4_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_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/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/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
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -10,7 +10,7 @@ ExternalProject_Add(external_epoxy
URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH} URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH}
PREFIX ${BUILD_DIR}/epoxy PREFIX ${BUILD_DIR}/epoxy
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${MESON} setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false ${MESON_BUILD_TYPE} CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${MESON} setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false
BUILD_COMMAND ninja BUILD_COMMAND ninja
INSTALL_COMMAND ninja install INSTALL_COMMAND ninja install
) )
@@ -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

@@ -35,7 +35,6 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
# 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

@@ -9,7 +9,7 @@ ExternalProject_Add(external_fribidi
URL_HASH ${FRIBIDI_HASH_TYPE}=${FRIBIDI_HASH} URL_HASH ${FRIBIDI_HASH_TYPE}=${FRIBIDI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/fribidi PREFIX ${BUILD_DIR}/fribidi
CONFIGURE_COMMAND ${MESON} setup --prefix ${LIBDIR}/fribidi ${MESON_BUILD_TYPE} -Ddocs=false --default-library static --libdir lib ${BUILD_DIR}/fribidi/src/external_fribidi-build ${BUILD_DIR}/fribidi/src/external_fribidi CONFIGURE_COMMAND ${MESON} setup --prefix ${LIBDIR}/fribidi -Ddocs=false --default-library static --libdir lib ${BUILD_DIR}/fribidi/src/external_fribidi-build ${BUILD_DIR}/fribidi/src/external_fribidi
BUILD_COMMAND ninja BUILD_COMMAND ninja
INSTALL_COMMAND ninja install INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/fribidi INSTALL_DIR ${LIBDIR}/fribidi
@@ -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 #103423.
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}
@@ -53,16 +45,14 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
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,10 +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
${MESON_BUILD_TYPE}
) )
ExternalProject_Add(external_harfbuzz ExternalProject_Add(external_harfbuzz
@@ -29,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
@@ -47,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
) )
@@ -61,9 +42,3 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_harfbuzz after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/harfbuzz/lib/libharfbuzz.a ${HARVEST_TARGET}/harfbuzz/lib/libharfbuzz_d.lib
DEPENDEES install
)
endif()

View File

@@ -11,25 +11,24 @@ 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 DEPENDS
) )
endif() endif()
else() else(WIN32)
function(harvest from to) function(harvest from to)
set(pattern "") set(pattern "")
foreach(f ${ARGN}) foreach(f ${ARGN})
set(pattern ${f}) set(pattern ${f})
@@ -56,23 +55,23 @@ else()
PATTERN "meson*" EXCLUDE PATTERN "meson*" EXCLUDE
) )
endif() endif()
endfunction() endfunction()
# Set rpath on shared libraries to $ORIGIN since all will be installed in the same # Set rpath on shared libraries to $ORIGIN since all will be installed in the same
# lib folder, and remove any absolute paths. # lib folder, and remove any absolute paths.
# #
# Ideally this would be done as part of the Blender build since it makes assumptions # 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 # about where the files will be installed. However it would add patchelf as a new
# dependency for building. # dependency for building.
# #
# Also removes versioned symlinks, which give errors with macOS notarization. # Also removes versioned symlinks, which give errors with macOS notarization.
if(APPLE) if(APPLE)
set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path) 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) set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
endif() endif()
function(harvest_rpath_lib from to pattern) function(harvest_rpath_lib from to pattern)
harvest(${from} ${to} ${pattern}) harvest(${from} ${to} ${pattern})
install(CODE "\ install(CODE "\
@@ -87,10 +86,10 @@ else()
execute_process(COMMAND ${set_rpath_cmd} \${f}) \n execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
endif()\n endif()\n
endforeach()") endforeach()")
endfunction() endfunction()
# Set rpath on utility binaries assuming they are run from their install location. # Set rpath on utility binaries assuming they are run from their install location.
function(harvest_rpath_bin from to pattern) function(harvest_rpath_bin from to pattern)
harvest(${from} ${to} ${pattern}) harvest(${from} ${to} ${pattern})
install(CODE "\ install(CODE "\
@@ -98,11 +97,11 @@ else()
foreach(f \${shared_libs}) \n foreach(f \${shared_libs}) \n
execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
endforeach()") endforeach()")
endfunction() endfunction()
# Set rpath on Python module to point to the shared libraries folder in the Blender # Set rpath on Python module to point to the shared libraries folder in the Blender
# installation. # installation.
function(harvest_rpath_python from to pattern) function(harvest_rpath_python from to pattern)
harvest(${from} ${to} ${pattern}) harvest(${from} ${to} ${pattern})
install(CODE "\ install(CODE "\
@@ -118,61 +117,61 @@ else()
execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
endif()\n endif()\n
endforeach()") endforeach()")
endfunction() endfunction()
harvest(alembic/include alembic/include "*.h") harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a) harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest_rpath_bin(alembic/bin alembic/bin "*") harvest_rpath_bin(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h") harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a") harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*") harvest(boost/include boost/include "*")
harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*") harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
harvest(imath/include imath/include "*.h") harvest(imath/include imath/include "*.h")
harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*") harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
harvest(ffmpeg/include ffmpeg/include "*.h") harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a") harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h") harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a") harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a") harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h") harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a) harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(fribidi/include fribidi/include "*.h") harvest(fribidi/include fribidi/include "*.h")
harvest(fribidi/lib fribidi/lib "*.a") harvest(fribidi/lib fribidi/lib "*.a")
harvest(epoxy/include epoxy/include "*.h") harvest(epoxy/include epoxy/include "*.h")
harvest(epoxy/lib epoxy/lib "*.a") harvest(epoxy/lib epoxy/lib "*.a")
harvest(gmp/include gmp/include "*.h") harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a") harvest(gmp/lib gmp/lib "*.a")
harvest(harfbuzz/include harfbuzz/include "*.h") harvest(harfbuzz/include harfbuzz/include "*.h")
harvest(harfbuzz/lib harfbuzz/lib "*.a") harvest(harfbuzz/lib harfbuzz/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h") harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a") harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpeg/include jpeg/include "*.h") harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a") harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a") harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE) if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h") harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*${SHAREDLIBEXT}*") harvest(level-zero/lib level-zero/lib "*${SHAREDLIBEXT}*")
endif() endif()
harvest(llvm/bin llvm/bin "clang-format") harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS) if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy") harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py") harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif() endif()
harvest(llvm/include llvm/include "*") harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config") harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a") harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a") harvest(llvm/lib llvm/lib "libclang*.a")
harvest(llvm/lib/clang llvm/lib/clang "*.h") harvest(llvm/lib/clang llvm/lib/clang "*.h")
if(APPLE) if(APPLE)
harvest(openmp/lib openmp/lib "libomp.dylib") harvest(openmp/lib openmp/lib "libomp.dylib")
harvest(openmp/include openmp/include "*.h") harvest(openmp/include openmp/include "*.h")
endif() endif()
if(BLENDER_PLATFORM_ARM) if(BLENDER_PLATFORM_ARM)
harvest(sse2neon sse2neon "*.h") harvest(sse2neon sse2neon "*.h")
endif() endif()
harvest(ogg/lib ffmpeg/lib "*.a") harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h") harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a") harvest(openal/lib openal/lib "*.a")
harvest(zlib/include zlib/include "*.h") harvest(zlib/include zlib/include "*.h")
@@ -181,132 +180,101 @@ else()
harvest(xml2/include xml2/include "*.h") harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a") harvest(xml2/lib xml2/lib "*.a")
harvest( harvest(wayland-protocols/share/wayland-protocols wayland-protocols/share/wayland-protocols/ "*.xml")
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(embree/lib embree/lib "*${SHAREDLIBEXT}*") harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h")
harvest(openpgl/include openpgl/include "*.h") harvest_rpath_lib(openvdb/lib openvdb/lib "*${SHAREDLIBEXT}*")
harvest(openpgl/lib openpgl/lib "*.a") harvest_rpath_python(openvdb/lib/python${PYTHON_SHORT_VERSION} python/lib/python${PYTHON_SHORT_VERSION} "*pyopenvdb*")
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake") harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h") harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest(openjpeg/lib openjpeg/lib "*.a") harvest_rpath_bin(osl/bin osl/bin "oslc")
harvest(opensubdiv/include opensubdiv/include "*.h") harvest(osl/include osl/include "*.h")
harvest_rpath_lib(opensubdiv/lib opensubdiv/lib "*${SHAREDLIBEXT}*") harvest(osl/lib osl/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h") harvest(png/include png/include "*.h")
harvest_rpath_lib(openvdb/lib openvdb/lib "*${SHAREDLIBEXT}*") harvest(png/lib png/lib "*.a")
harvest_rpath_python( harvest(pugixml/include pugixml/include "*.hpp")
openvdb/lib/python${PYTHON_SHORT_VERSION} harvest(pugixml/lib pugixml/lib "*.a")
python/lib/python${PYTHON_SHORT_VERSION} harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}")
"*pyopenvdb*" harvest(python/include python/include "*h")
) harvest(python/lib python/lib "*")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") harvest(sdl/lib sdl/lib "libSDL2.a")
harvest_rpath_bin(osl/bin osl/bin "oslc") harvest(sndfile/include sndfile/include "*.h")
harvest(osl/include osl/include "*.h") harvest(sndfile/lib sndfile/lib "*.a")
harvest(osl/lib osl/lib "*.a") harvest(spnav/include spnav/include "*.h")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h") harvest(spnav/lib spnav/lib "*.a")
harvest(png/include png/include "*.h") harvest(tbb/include tbb/include "*.h")
harvest(png/lib png/lib "*.a") harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}")
harvest(pugixml/include pugixml/include "*.hpp") harvest(theora/lib ffmpeg/lib "*.a")
harvest(pugixml/lib pugixml/lib "*.a") harvest(tiff/include tiff/include "*.h")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}") harvest(tiff/lib tiff/lib "*.a")
harvest(python/include python/include "*h") harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(python/lib python/lib "*") harvest(opus/lib ffmpeg/lib "*.a")
harvest(sdl/include/SDL2 sdl/include "*.h") harvest(vpx/lib ffmpeg/lib "*.a")
harvest(sdl/lib sdl/lib "libSDL2.a") harvest(x264/lib ffmpeg/lib "*.a")
harvest(sndfile/include sndfile/include "*.h") harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(sndfile/lib sndfile/lib "*.a") harvest(aom/lib ffmpeg/lib "*.a")
harvest(spnav/include spnav/include "*.h") harvest(webp/lib webp/lib "*.a")
harvest(spnav/lib spnav/lib "*.a") harvest(webp/include webp/include "*.h")
harvest(tbb/include tbb/include "*.h") harvest(usd/include usd/include "*.h")
harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}") harvest_rpath_lib(usd/lib usd/lib "libusd_ms${SHAREDLIBEXT}")
harvest(theora/lib ffmpeg/lib "*.a") harvest(usd/lib/usd usd/lib/usd "*")
harvest(tiff/include tiff/include "*.h") harvest_rpath_python(usd/lib/python/pxr python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr "*")
harvest(tiff/lib tiff/lib "*.a") harvest(usd/plugin usd/plugin "*")
harvest(vorbis/lib ffmpeg/lib "*.a") harvest(materialx/include materialx/include "*.h")
harvest(opus/lib ffmpeg/lib "*.a") harvest_rpath_lib(materialx/lib materialx/lib "*${SHAREDLIBEXT}*")
harvest(vpx/lib ffmpeg/lib "*.a") harvest(materialx/libraries materialx/libraries "*")
harvest(x264/lib ffmpeg/lib "*.a") harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
harvest(xvidcore/lib ffmpeg/lib "*.a") harvest_rpath_python(materialx/python/MaterialX python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX "*")
harvest(aom/lib ffmpeg/lib "*.a") # We do not need anything from the resources folder, but the MaterialX config
harvest(webp/lib webp/lib "*.a") # file will complain if the folder does not exist, so just copy the readme.md
harvest(webp/include webp/include "*.h") # files to ensure the folder will exist.
harvest(usd/include usd/include "*.h") harvest(materialx/resources materialx/resources "README.md")
harvest_rpath_lib(usd/lib usd/lib "libusd_ms${SHAREDLIBEXT}") harvest(potrace/include potrace/include "*.h")
harvest(usd/lib/usd usd/lib/usd "*") harvest(potrace/lib potrace/lib "*.a")
harvest_rpath_python( harvest(haru/include haru/include "*.h")
usd/lib/python/pxr harvest(haru/lib haru/lib "*.a")
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr harvest(zstd/include zstd/include "*.h")
"*" harvest(zstd/lib zstd/lib "*.a")
)
harvest(usd/plugin usd/plugin "*")
harvest(materialx/include materialx/include "*.h")
harvest_rpath_lib(materialx/lib materialx/lib "*${SHAREDLIBEXT}*")
harvest(materialx/libraries materialx/libraries "*")
harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
harvest_rpath_python(
materialx/python/MaterialX
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX
"*"
)
# 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) if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*") harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")
harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*") harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*")
harvest(dpcpp dpcpp "*") harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*") harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*") harvest(ocloc dpcpp/lib/ocloc "*")
endif() endif()
endif() endif()

View File

@@ -40,8 +40,7 @@ ExternalProject_Add(external_igc_llvm
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch && ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch && ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch && ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch && ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0003-Add-missing-include-limit-in-benchmark.patch
) )
add_dependencies( add_dependencies(
external_igc_llvm external_igc_llvm
@@ -56,6 +55,9 @@ ExternalProject_Add(external_igc_spirv_translator
CONFIGURE_COMMAND echo . CONFIGURE_COMMAND echo .
BUILD_COMMAND echo . BUILD_COMMAND echo .
INSTALL_COMMAND echo . INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0001-update-SPIR-V-headers-for-SPV_INTEL_split_barrier.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0003-Support-cl_bf16_conversions.patch
) )
add_dependencies( add_dependencies(
external_igc_spirv_translator external_igc_spirv_translator

View File

@@ -15,7 +15,7 @@ llvm-config = '${LIBDIR}/llvm/bin/llvm-config'"
) )
set(MESA_EXTRA_FLAGS set(MESA_EXTRA_FLAGS
${MESON_BUILD_TYPE} -Dbuildtype=release
-Dc_args=${MESA_CFLAGS} -Dc_args=${MESA_CFLAGS}
-Dcpp_args=${MESA_CXXFLAGS} -Dcpp_args=${MESA_CXXFLAGS}
-Dc_link_args=${MESA_LDFLAGS} -Dc_link_args=${MESA_LDFLAGS}
@@ -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

@@ -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

@@ -44,21 +44,13 @@ set(OPENVDB_EXTRA_ARGS
# -DLLVM_DIR=${LIBDIR}/llvm/lib/cmake/llvm # -DLLVM_DIR=${LIBDIR}/llvm/lib/cmake/llvm
) )
set(OPENVDB_PATCH ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff)
if(APPLE)
set(OPENVDB_PATCH
${OPENVDB_PATCH} &&
${PATCH_CMD} -p 0 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_metal.diff
)
endif()
ExternalProject_Add(openvdb ExternalProject_Add(openvdb
URL file://${PACKAGE_DIR}/${OPENVDB_FILE} URL file://${PACKAGE_DIR}/${OPENVDB_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH} URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR} CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/openvdb PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND ${OPENVDB_PATCH} PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openvdb INSTALL_DIR ${LIBDIR}/openvdb
) )

View File

@@ -16,10 +16,8 @@ message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug") if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug) set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
set(MESON_BUILD_TYPE -Dbuildtype=debug)
else() else()
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release) set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
set(MESON_BUILD_TYPE -Dbuildtype=release)
endif() endif()
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files") set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files")
@@ -119,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

@@ -34,4 +34,5 @@ if(WIN32)
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -88,19 +88,6 @@ else()
export LDFLAGS=${PYTHON_LDFLAGS} && export LDFLAGS=${PYTHON_LDFLAGS} &&
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig) export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
# NOTE: untested on APPLE so far.
if(NOT APPLE)
set(PYTHON_CONFIGURE_EXTRA_ARGS
${PYTHON_CONFIGURE_EXTRA_ARGS}
# Used on most release Linux builds (Fedora for e.g.),
# increases build times noticeably with the benefit of a modest speedup at runtime.
--enable-optimizations
# While LTO is OK when building on the same system, it's incompatible across GCC versions,
# making it impractical for developers to build against, so keep it disabled.
# `--with-lto`
)
endif()
ExternalProject_Add(external_python ExternalProject_Add(external_python
URL file://${PACKAGE_DIR}/${PYTHON_FILE} URL file://${PACKAGE_DIR}/${PYTHON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}

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,25 +15,20 @@ 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
# setuptools is downgraded to 63.2.0 (same as python 3.10.8) since numpy 1.23.x seemingly has # 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+ # 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} 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:
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)
# Use only wheel (and not build from source) to stop NumPy from linking against buggy
# Accelerate framework backend on macOS. Official wheels are built with OpenBLAS.
ExternalProject_Add_Step(external_python_site_packages after_install
COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir numpy==${NUMPY_VERSION} --only-binary :all:
DEPENDEES install
)
endif()
add_dependencies( add_dependencies(
external_python_site_packages external_python_site_packages
external_python external_python

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 )

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

@@ -34,8 +34,7 @@ elseif(UNIX)
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

@@ -165,9 +165,9 @@ set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${
set(OPENMP_HASH_TYPE MD5) set(OPENMP_HASH_TYPE MD5)
set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz) set(OPENMP_FILE openmp-${OPENMP_VERSION}.src.tar.xz)
set(OPENIMAGEIO_VERSION v2.4.9.0) set(OPENIMAGEIO_VERSION v2.4.6.0)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz) set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/refs/tags/${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH 7da92a7d6029921a8599a977ff1efa2a) set(OPENIMAGEIO_HASH c7acc1b9a8fda04ef48f7de1feda4dae)
set(OPENIMAGEIO_HASH_TYPE MD5) set(OPENIMAGEIO_HASH_TYPE MD5)
set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz) set(OPENIMAGEIO_FILE OpenImageIO-${OPENIMAGEIO_VERSION}.tar.gz)
@@ -195,12 +195,9 @@ 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)
@@ -232,34 +229,20 @@ 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.5)
@@ -359,7 +342,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 +352,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)
@@ -478,9 +461,9 @@ 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}:*:*:*:*:*:*:*")
set(EMBREE_VERSION 4.0.1) set(EMBREE_VERSION 3.13.4)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip) set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH dd26617719a587e126b341d1b32f7fd0) set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be)
set(EMBREE_HASH_TYPE MD5) set(EMBREE_HASH_TYPE MD5)
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip) set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
@@ -528,16 +511,16 @@ set(XR_OPENXR_SDK_HASH a2623ebab3d0b340bc16311b14f02075)
set(XR_OPENXR_SDK_HASH_TYPE MD5) set(XR_OPENXR_SDK_HASH_TYPE MD5)
set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz) set(XR_OPENXR_SDK_FILE OpenXR-SDK-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(WL_PROTOCOLS_VERSION 1.31) set(WL_PROTOCOLS_VERSION 1.21)
set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz) set(WL_PROTOCOLS_FILE wayland-protocols-${WL_PROTOCOLS_VERSION}.tar.gz)
set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE}) set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${WL_PROTOCOLS_VERSION}/${WL_PROTOCOLS_FILE})
set(WL_PROTOCOLS_HASH a28ff59a56e2ebb746048b6ef8d931d6) set(WL_PROTOCOLS_HASH af5ca07e13517cdbab33504492cef54a)
set(WL_PROTOCOLS_HASH_TYPE MD5) set(WL_PROTOCOLS_HASH_TYPE MD5)
set(WAYLAND_VERSION 1.22.0) set(WAYLAND_VERSION 1.21.0)
set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz) set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz)
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/${WAYLAND_VERSION}/downloads/wayland-${WAYLAND_VERSION}.tar.xz) set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
set(WAYLAND_HASH 7410ab549e3928fce9381455b17b0803) set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903)
set(WAYLAND_HASH_TYPE MD5) set(WAYLAND_HASH_TYPE MD5)
set(WAYLAND_LIBDECOR_VERSION 0.1.0) set(WAYLAND_LIBDECOR_VERSION 0.1.0)
@@ -668,9 +651,9 @@ set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
# compiler, the versions used are taken from the following location # compiler, the versions used are taken from the following location
# https://github.com/intel/intel-graphics-compiler/releases # https://github.com/intel/intel-graphics-compiler/releases
set(IGC_VERSION 1.0.13064.7) set(IGC_VERSION 1.0.12149.1)
set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz) set(IGC_URI https://github.com/intel/intel-graphics-compiler/archive/refs/tags/igc-${IGC_VERSION}.tar.gz)
set(IGC_HASH a929abd4cca2b293961ec0437ee4b3b2147bd3b2c8a3c423af78c0c359b2e5ae) set(IGC_HASH 44f67f24e3bc5130f9f062533abf8154782a9d0a992bc19b498639a8521ae836)
set(IGC_HASH_TYPE SHA256) set(IGC_HASH_TYPE SHA256)
set(IGC_FILE igc-${IGC_VERSION}.tar.gz) set(IGC_FILE igc-${IGC_VERSION}.tar.gz)
@@ -690,15 +673,15 @@ set(IGC_LLVM_FILE ${IGC_LLVM_VERSION}.tar.gz)
# #
# WARNING WARNING WARNING # WARNING WARNING WARNING
set(IGC_OPENCL_CLANG_VERSION ee31812ea8b89d08c2918f045d11a19bd33525c5) set(IGC_OPENCL_CLANG_VERSION 363a5262d8c7cff3fb28f3bdb5d85c8d7e91c1bb)
set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz) set(IGC_OPENCL_CLANG_URI https://github.com/intel/opencl-clang/archive/${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_OPENCL_CLANG_HASH 1db6735bbcfaa31e8a9ba39f121d6bafa806ea8919e9f56782d6aaa67771ddda) set(IGC_OPENCL_CLANG_HASH aa8cf72bb239722ce8ce44f79413c6887ecc8ca18477dd520aa5c4809756da9a)
set(IGC_OPENCL_CLANG_HASH_TYPE SHA256) set(IGC_OPENCL_CLANG_HASH_TYPE SHA256)
set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz) set(IGC_OPENCL_CLANG_FILE opencl-clang-${IGC_OPENCL_CLANG_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_VERSION v0.11.0) set(IGC_VCINTRINSICS_VERSION v0.5.0)
set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz) set(IGC_VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/refs/tags/${IGC_VCINTRINSICS_VERSION}.tar.gz)
set(IGC_VCINTRINSICS_HASH e5acd5626ce7fa6d41ce154c50ac805eda734ee66af94ef28e680ac2ad81bb9f) set(IGC_VCINTRINSICS_HASH 70bb47c5e32173cf61514941e83ae7c7eb4485e6d2fca60cfa1f50d4f42c41f2)
set(IGC_VCINTRINSICS_HASH_TYPE SHA256) set(IGC_VCINTRINSICS_HASH_TYPE SHA256)
set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz) set(IGC_VCINTRINSICS_FILE vc-intrinsics-${IGC_VCINTRINSICS_VERSION}.tar.gz)
@@ -714,9 +697,9 @@ set(IGC_SPIRV_TOOLS_HASH 6e19900e948944243024aedd0a201baf3854b377b9cc7a386553bc1
set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256) set(IGC_SPIRV_TOOLS_HASH_TYPE SHA256)
set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz) set(IGC_SPIRV_TOOLS_FILE SPIR-V-Tools-${IGC_SPIRV_TOOLS_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_VERSION d739c01d65ec00dee64dedd40deed805216a7193) set(IGC_SPIRV_TRANSLATOR_VERSION a31ffaeef77e23d500b3ea3d35e0c42ff5648ad9)
set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz) set(IGC_SPIRV_TRANSLATOR_URI https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
set(IGC_SPIRV_TRANSLATOR_HASH ddc0cc9ccbe59dadeaf291012d59de142b2e9f2b124dbb634644d39daddaa13e) set(IGC_SPIRV_TRANSLATOR_HASH 9e26c96a45341b8f8af521bacea20e752623346340addd02af95d669f6e89252)
set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256) set(IGC_SPIRV_TRANSLATOR_HASH_TYPE SHA256)
set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz) set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.tar.gz)
@@ -724,15 +707,15 @@ set(IGC_SPIRV_TRANSLATOR_FILE SPIR-V-Translator-${IGC_SPIRV_TRANSLATOR_VERSION}.
### Intel Graphics Compiler DEPS END ### ### Intel Graphics Compiler DEPS END ###
######################################## ########################################
set(GMMLIB_VERSION intel-gmmlib-22.3.0) set(GMMLIB_VERSION intel-gmmlib-22.1.8)
set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz) set(GMMLIB_URI https://github.com/intel/gmmlib/archive/refs/tags/${GMMLIB_VERSION}.tar.gz)
set(GMMLIB_HASH c1f33e1519edfc527127baeb0436b783430dfd256c643130169a3a71dc86aff9) set(GMMLIB_HASH bf23e9a3742b4fb98c7666c9e9b29f3219e4b2fb4d831aaf4eed71f5e2d17368)
set(GMMLIB_HASH_TYPE SHA256) set(GMMLIB_HASH_TYPE SHA256)
set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz) set(GMMLIB_FILE ${GMMLIB_VERSION}.tar.gz)
set(OCLOC_VERSION 22.49.25018.21) set(OCLOC_VERSION 22.38.24278)
set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz) set(OCLOC_URI https://github.com/intel/compute-runtime/archive/refs/tags/${OCLOC_VERSION}.tar.gz)
set(OCLOC_HASH 92362dae08b503a34e5d3820ed284198c452bcd5e7504d90eb69887b20492c06) set(OCLOC_HASH db0c542fccd651e6404b15a74d46027f1ce0eda8dc9e25a40cbb6c0faef257ee)
set(OCLOC_HASH_TYPE SHA256) set(OCLOC_HASH_TYPE SHA256)
set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz) set(OCLOC_FILE ocloc-${OCLOC_VERSION}.tar.gz)

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
@@ -13,7 +14,7 @@ ExternalProject_Add(external_wayland
# NOTE: `-lm` is needed for `libxml2` which is a static library that uses `libm.so`, # NOTE: `-lm` is needed for `libxml2` which is a static library that uses `libm.so`,
# without this, math symbols such as `floor` aren't found. # without this, math symbols such as `floor` aren't found.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:${LIBDIR}/ffi/lib/pkgconfig:$PKG_CONFIG_PATH CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/expat/lib/pkgconfig:${LIBDIR}/xml2/lib/pkgconfig:${LIBDIR}/ffi/lib/pkgconfig:$PKG_CONFIG_PATH
${MESON} --prefix ${LIBDIR}/wayland ${MESON_BUILD_TYPE} -Ddocumentation=false -Dtests=false -D "c_link_args=-L${LIBDIR}/ffi/lib -lm" . ../external_wayland ${MESON} --prefix ${LIBDIR}/wayland -Ddocumentation=false -Dtests=false -D "c_link_args=-L${LIBDIR}/ffi/lib -lm" . ../external_wayland
BUILD_COMMAND ninja BUILD_COMMAND ninja
INSTALL_COMMAND ninja install INSTALL_COMMAND ninja install
) )
@@ -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

@@ -7,7 +7,7 @@ ExternalProject_Add(external_wayland_protocols
PREFIX ${BUILD_DIR}/wayland-protocols PREFIX ${BUILD_DIR}/wayland-protocols
# Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own WAYLAND. # Use `-E` so the `PKG_CONFIG_PATH` can be defined to link against our own WAYLAND.
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/wayland/lib64/pkgconfig:$PKG_CONFIG_PATH CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env PKG_CONFIG_PATH=${LIBDIR}/wayland/lib64/pkgconfig:$PKG_CONFIG_PATH
${MESON} --prefix ${LIBDIR}/wayland-protocols ${MESON_BUILD_TYPE} . ../external_wayland_protocols -Dtests=false ${MESON} --prefix ${LIBDIR}/wayland-protocols . ../external_wayland_protocols -Dtests=false
BUILD_COMMAND ninja BUILD_COMMAND ninja
INSTALL_COMMAND ninja install INSTALL_COMMAND ninja install
) )
@@ -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

@@ -17,13 +17,11 @@ ExternalProject_Add(external_xvidcore
INSTALL_DIR ${LIBDIR}/xvidcore INSTALL_DIR ${LIBDIR}/xvidcore
) )
if(WIN32) ExternalProject_Add_Step(external_xvidcore after_install
ExternalProject_Add_Step(external_xvidcore after_install
COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true COMMAND ${CMAKE_COMMAND} -E rename ${LIBDIR}/xvidcore/lib/xvidcore.a ${LIBDIR}/xvidcore/lib/libxvidcore.a || true
COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a COMMAND ${CMAKE_COMMAND} -E remove ${LIBDIR}/xvidcore/lib/xvidcore.dll.a
DEPENDEES install DEPENDEES install
) )
endif()
if(MSVC) if(MSVC)
set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw) set_target_properties(external_xvidcore PROPERTIES FOLDER Mingw)

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,14 +1,11 @@
#!/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 os
import re import re
import subprocess import subprocess
import sys import sys
# Strip version numbers from dependenciesm macOS notarizatiom fails # Strip version numbers from dependenciesm macOS notarizatiom fails
# with version symlinks. # with version symlinks.
def strip_lib_version(name): def strip_lib_version(name):
@@ -17,7 +14,6 @@ def strip_lib_version(name):
name = re.sub(r'(\.[0-9]+)+.cpython', '.cpython', name) name = re.sub(r'(\.[0-9]+)+.cpython', '.cpython', name)
return name return name
rpath = sys.argv[1] rpath = sys.argv[1]
file = sys.argv[2] file = sys.argv[2]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# This script is part of the official build environment, see wiki page for details. # This script is part of the official build environment, see WIKI page for details.
# https://wiki.blender.org/wiki/Building_Blender/Other/Rocky8ReleaseEnvironment # https://wiki.blender.org/wiki/Building_Blender/Other/CentOS7ReleaseEnvironment
set -e set -e
@@ -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
# Used to set rpath on shared libraries # 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,74 +0,0 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
# This script ensures:
# - One dependency is built at a time.
# - That dependency uses all available cores.
#
# Without this, simply calling `make -j$(nproc)` from the `${CMAKE_BUILD_DIR}/deps/`
# directory will build many projects at once.
#
# This is undesirable for the following reasons:
#
# - The output from projects is mixed together,
# making it difficult to track down the cause of a build failure.
#
# - Larger dependencies such as LLVM can bottleneck the build process,
# making it necessary to cancel the build and manually run build commands in each directory.
#
# - Building many projects at once means canceling (Control-C) can lead to the build being in an undefined state.
# It's possible canceling happens as a patch is being applied or files are being copied.
# (steps that aren't part of the compilation process where it's typically safe to cancel).
if [[ -z "$MY_MAKE_CALL_LEVEL" ]]; then
export MY_MAKE_CALL_LEVEL=0
export MY_MAKEFLAGS=$MAKEFLAGS
# Extract the jobs argument (`-jN`, `-j N`, `--jobs=N`).
add_next=0
for i in "$@"; do
case $i in
-j*)
export MY_JOBS_ARG=$i
if [ "$MY_JOBS_ARG" = "-j" ]; then
add_next=1
fi
;;
--jobs=*)
shift # past argument=value
MY_JOBS_ARG=$i
;;
*)
if (( add_next == 1 )); then
MY_JOBS_ARG="$MY_JOBS_ARG $i"
add_next=0
fi
;;
esac
done
unset i add_next
if [[ -z "$MY_JOBS_ARG" ]]; then
MY_JOBS_ARG="-j$(nproc)"
fi
export MY_JOBS_ARG
# Support user defined `MAKEFLAGS`.
export MAKEFLAGS="$MY_MAKEFLAGS -j1"
else
export MY_MAKE_CALL_LEVEL=$(( MY_MAKE_CALL_LEVEL + 1 ))
if (( MY_MAKE_CALL_LEVEL == 1 )); then
# Important to set jobs to 1, otherwise user defined jobs argument is used.
export MAKEFLAGS="$MY_MAKEFLAGS -j1"
elif (( MY_MAKE_CALL_LEVEL == 2 )); then
# This is the level used by each sub-project.
export MAKEFLAGS="$MY_MAKEFLAGS $MY_JOBS_ARG"
fi
# Else leave `MY_MAKEFLAGS` flags as-is, avoids setting a high number of jobs on recursive
# calls (which may easily run out of memory). Let the job-server handle the rest.
fi
# Useful for troubleshooting the wrapper.
# echo "Call level: $MY_MAKE_CALL_LEVEL, args=$@".
# Call actual make but ensure recursive calls run via this script.
exec make MAKE="$0" "$@"

View File

@@ -1,8 +1,19 @@
diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in
--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600
+++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600
@@ -14,6 +14,7 @@
#cmakedefine01 EMBREE_MIN_WIDTH
#define RTC_MIN_WIDTH EMBREE_MIN_WIDTH
+#cmakedefine EMBREE_STATIC_LIB
#cmakedefine EMBREE_API_NAMESPACE
#if defined(EMBREE_API_NAMESPACE)
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
index 7c2f43d..106b1d5 100644 index 7c2f43d..106b1d5 100644
--- a/kernels/CMakeLists.txt --- a/kernels/CMakeLists.txt
+++ b/kernels/CMakeLists.txt +++ b/kernels/CMakeLists.txt
@@ -208,6 +208,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512}) @@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}") #message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}") #message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
@@ -15,7 +26,7 @@ index 7c2f43d..106b1d5 100644
# replaces all .cpp files with a dummy file that includes that .cpp file # replaces all .cpp files with a dummy file that includes that .cpp file
# this is to work around an ICC name mangling issue related to lambda functions under windows # this is to work around an ICC name mangling issue related to lambda functions under windows
MACRO (CreateISADummyFiles list isa) MACRO (CreateISADummyFiles list isa)
@@ -311,7 +317,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX) @@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
ENDIF() ENDIF()
ENDIF() ENDIF()
@@ -24,128 +35,3 @@ index 7c2f43d..106b1d5 100644
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2}) DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2}) ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking) TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
diff --git a/include/embree4/rtcore_device.h b/include/embree4/rtcore_device.h
index 45bf95583..62ee7787d 100644
--- a/include/embree4/rtcore_device.h
+++ b/include/embree4/rtcore_device.h
@@ -55,6 +55,7 @@ enum RTCDeviceProperty
RTC_DEVICE_PROPERTY_FILTER_FUNCTION_SUPPORTED = 66,
RTC_DEVICE_PROPERTY_IGNORE_INVALID_RAYS_ENABLED = 67,
RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED = 68,
+ RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED = 69,
RTC_DEVICE_PROPERTY_TRIANGLE_GEOMETRY_SUPPORTED = 96,
RTC_DEVICE_PROPERTY_QUAD_GEOMETRY_SUPPORTED = 97,
diff --git a/kernels/common/device.cpp b/kernels/common/device.cpp
index 3ffac7e37..215ccc961 100644
--- a/kernels/common/device.cpp
+++ b/kernels/common/device.cpp
@@ -170,6 +170,9 @@ namespace embree
#if defined (EMBREE_BACKFACE_CULLING_CURVES)
v += "backfacecullingcurves ";
#endif
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ v += "backfacecullingspheres ";
+#endif
#if defined(EMBREE_FILTER_FUNCTION)
v += "intersection_filter ";
#endif
@@ -477,6 +480,12 @@ namespace embree
case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_CURVES_ENABLED: return 0;
#endif
+#if defined(EMBREE_BACKFACE_CULLING_SPHERES)
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 1;
+#else
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 0;
+#endif
+
#if defined(EMBREE_COMPACT_POLYS)
case RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED: return 1;
#else
diff --git a/kernels/config.h.in b/kernels/config.h.in
index f02c90360..ba9acde56 100644
--- a/kernels/config.h.in
+++ b/kernels/config.h.in
@@ -5,6 +5,7 @@
#cmakedefine EMBREE_STAT_COUNTERS
#cmakedefine EMBREE_BACKFACE_CULLING
#cmakedefine EMBREE_BACKFACE_CULLING_CURVES
+#cmakedefine EMBREE_BACKFACE_CULLING_SPHERES
#cmakedefine EMBREE_FILTER_FUNCTION
#cmakedefine EMBREE_IGNORE_INVALID_RAYS
#cmakedefine EMBREE_GEOMETRY_TRIANGLE
diff --git a/kernels/geometry/sphere_intersector.h b/kernels/geometry/sphere_intersector.h
index 074f910a2..30f490818 100644
--- a/kernels/geometry/sphere_intersector.h
+++ b/kernels/geometry/sphere_intersector.h
@@ -106,8 +106,13 @@ namespace embree
const vbool<M> valid_front = valid & (ray.tnear() <= t_front) & (t_front <= ray.tfar);
const vbool<M> valid_back = valid & (ray.tnear() <= t_back ) & (t_back <= ray.tfar);
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ /* check if there is a first hit */
+ const vbool<M> valid_first = valid_front;
+#else
/* check if there is a first hit */
const vbool<M> valid_first = valid_front | valid_back;
+#endif
if (unlikely(none(valid_first)))
return false;
@@ -120,7 +125,8 @@ namespace embree
/* invoke intersection filter for first hit */
const bool is_hit_first = epilog(valid_first, hit);
-
+
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
/* check for possible second hits before potentially accepted hit */
const vfloat<M> t_second = t_back;
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar);
@@ -131,7 +137,9 @@ namespace embree
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
const bool is_hit_second = epilog(valid_second, hit);
-
+#else
+ constexpr bool is_hit_second = false;
+#endif
return is_hit_first | is_hit_second;
}
@@ -186,8 +194,13 @@ namespace embree
const vbool<M> valid_front = valid & (ray.tnear()[k] <= t_front) & (t_front <= ray.tfar[k]);
const vbool<M> valid_back = valid & (ray.tnear()[k] <= t_back ) & (t_back <= ray.tfar[k]);
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
+ /* check if there is a first hit */
+ const vbool<M> valid_first = valid_front;
+#else
/* check if there is a first hit */
const vbool<M> valid_first = valid_front | valid_back;
+#endif
if (unlikely(none(valid_first)))
return false;
@@ -200,7 +213,8 @@ namespace embree
/* invoke intersection filter for first hit */
const bool is_hit_first = epilog(valid_first, hit);
-
+
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
/* check for possible second hits before potentially accepted hit */
const vfloat<M> t_second = t_back;
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar[k]);
@@ -211,7 +225,9 @@ namespace embree
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
const bool is_hit_second = epilog(valid_second, hit);
-
+#else
+ constexpr bool is_hit_second = false;
+#endif
return is_hit_first | is_hit_second;
}
};

View File

@@ -1,7 +1,7 @@
diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt diff -Naur external_igc_opencl_clang.orig/CMakeLists.txt external_igc_opencl_clang/CMakeLists.txt
--- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600 --- external_igc_opencl_clang.orig/CMakeLists.txt 2022-03-16 05:51:10 -0600
+++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600 +++ external_igc_opencl_clang/CMakeLists.txt 2022-05-23 10:40:09 -0600
@@ -147,22 +147,24 @@ @@ -126,22 +126,24 @@
) )
endif() endif()

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()); }

File diff suppressed because it is too large Load Diff

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

View File

@@ -80,7 +80,6 @@ set(_CLANG_FIND_COMPONENTS
clangAST clangAST
clangLex clangLex
clangBasic clangBasic
clangSupport
) )
set(_CLANG_LIBRARIES) set(_CLANG_LIBRARIES)
@@ -95,9 +94,7 @@ foreach(COMPONENT ${_CLANG_FIND_COMPONENTS})
PATH_SUFFIXES PATH_SUFFIXES
lib64 lib lib64 lib
) )
if(CLANG_${UPPERCOMPONENT}_LIBRARY)
list(APPEND _CLANG_LIBRARIES "${CLANG_${UPPERCOMPONENT}_LIBRARY}") list(APPEND _CLANG_LIBRARIES "${CLANG_${UPPERCOMPONENT}_LIBRARY}")
endif()
endforeach() endforeach()

View File

@@ -23,7 +23,6 @@ SET(_embree_SEARCH_DIRS
FIND_PATH(EMBREE_INCLUDE_DIR FIND_PATH(EMBREE_INCLUDE_DIR
NAMES NAMES
embree4/rtcore.h
embree3/rtcore.h embree3/rtcore.h
HINTS HINTS
${_embree_SEARCH_DIRS} ${_embree_SEARCH_DIRS}
@@ -31,67 +30,28 @@ FIND_PATH(EMBREE_INCLUDE_DIR
include include
) )
IF(EXISTS ${EMBREE_INCLUDE_DIR}/embree4/rtcore_config.h) IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
SET(EMBREE_MAJOR_VERSION 4)
ELSE()
SET(EMBREE_MAJOR_VERSION 3)
ENDIF()
IF(EMBREE_INCLUDE_DIR)
FILE(READ ${EMBREE_INCLUDE_DIR}/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
IF(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
SET(EMBREE_STATIC_LIB TRUE)
ELSE()
SET(EMBREE_STATIC_LIB FALSE)
ENDIF()
IF(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
SET(EMBREE_SYCL_SUPPORT TRUE)
ELSE()
SET(EMBREE_SYCL_SUPPORT FALSE)
ENDIF()
UNSET(_embree_config_header)
ENDIF()
IF(EMBREE_STATIC_LIB)
IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
SET(_embree_SIMD_COMPONENTS SET(_embree_SIMD_COMPONENTS
embree_sse42 embree_sse42
embree_avx embree_avx
embree_avx2 embree_avx2
) )
ENDIF() ENDIF()
IF(EMBREE_SYCL_SUPPORT) SET(_embree_FIND_COMPONENTS
SET(_embree_GPU_COMPONENTS embree3
embree4_sycl
embree_rthwif
)
ENDIF()
SET(_embree_FIND_COMPONENTS
embree${EMBREE_MAJOR_VERSION}
${_embree_SIMD_COMPONENTS} ${_embree_SIMD_COMPONENTS}
${_embree_GPU_COMPONENTS}
lexers lexers
math math
simd simd
sys sys
tasking tasking
) )
ELSE()
SET(_embree_FIND_COMPONENTS
embree${EMBREE_MAJOR_VERSION}
)
IF(EMBREE_SYCL_SUPPORT)
LIST(APPEND _embree_FIND_COMPONENTS
embree4_sycl
)
ENDIF()
ENDIF()
SET(_embree_LIBRARIES) SET(_embree_LIBRARIES)
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS}) FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(EMBREE_${UPPERCOMPONENT}_LIBRARY FIND_LIBRARY(EMBREE_${UPPERCOMPONENT}_LIBRARY
NAMES NAMES
${COMPONENT} ${COMPONENT}
@@ -100,9 +60,18 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
PATH_SUFFIXES PATH_SUFFIXES
lib64 lib lib64 lib
) )
IF(NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
IF(EMBREE_EMBREE3_LIBRARY)
# If we can't find all the static libraries, try to fall back to the shared library if found.
# This allows building with a shared embree library
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
BREAK()
ENDIF()
ENDIF()
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}") LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH() ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
@@ -116,9 +85,6 @@ ENDIF()
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
EMBREE_INCLUDE_DIR EMBREE_INCLUDE_DIR
EMBREE_MAJOR_VERSION
EMBREE_SYCL_SUPPORT
EMBREE_STATIC_LIB
) )
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS}) FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})

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

@@ -120,8 +120,9 @@ UNSET(_openexr_libs_ver)
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0") IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
# For OpenEXR 3.x, we also need to find the now separate Imath library. # For OpenEXR 3.x, we also need to find the now separate Imath library.
# For simplicity we also add it to the OpenEXR includes and libraries, # For simplicity we add it to the OpenEXR includes and libraries, as we
# as it's simpler to support both 2.x and 3.x this way. # have no direct dependency on Imath and it's simpler to support both
# 2.x and 3.x this way.
# Find include directory # Find include directory
FIND_PATH(IMATH_INCLUDE_DIR FIND_PATH(IMATH_INCLUDE_DIR
@@ -168,12 +169,6 @@ IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
UNSET(_imath_build_specification) UNSET(_imath_build_specification)
ENDIF() ENDIF()
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
SET(IMATH_LIBRARIES ${IMATH_LIBRARY})
ELSE()
SET(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY})
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)
@@ -201,7 +196,6 @@ MARK_AS_ADVANCED(
OPENEXR_VERSION OPENEXR_VERSION
IMATH_INCLUDE_DIR IMATH_INCLUDE_DIR
IMATH_LIBRARY IMATH_LIBRARY
IMATH_LIBRARIES
) )
FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)

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

@@ -108,7 +108,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL
IF(SYCL_FOUND) IF(SYCL_FOUND)
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl) SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
SET(SYCL_LIBRARIES ${SYCL_LIBRARY})
ELSE() ELSE()
SET(SYCL_SYCL_FOUND FALSE) SET(SYCL_SYCL_FOUND FALSE)
ENDIF() ENDIF()

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

@@ -23,19 +23,19 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(MY_WC_BRANCH STREQUAL "HEAD") if(MY_WC_BRANCH STREQUAL "HEAD")
# Detached HEAD, check whether commit hash is reachable # Detached HEAD, check whether commit hash is reachable
# in the main branch # in the master branch
execute_process(COMMAND git rev-parse --short=12 HEAD execute_process(COMMAND git rev-parse --short=12 HEAD
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git branch --list main blender-v* --contains ${MY_WC_HASH} execute_process(COMMAND git branch --list master blender-v* --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_contains_check OUTPUT_VARIABLE _git_contains_check
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _git_contains_check STREQUAL "") if(NOT _git_contains_check STREQUAL "")
set(MY_WC_BRANCH "main") set(MY_WC_BRANCH "master")
else() else()
execute_process(COMMAND git show-ref --tags -d execute_process(COMMAND git show-ref --tags -d
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}
@@ -48,7 +48,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_git_tag_hashes MATCHES "${_git_head_hash}") if(_git_tag_hashes MATCHES "${_git_head_hash}")
set(MY_WC_BRANCH "main") set(MY_WC_BRANCH "master")
else() else()
execute_process(COMMAND git branch --contains ${MY_WC_HASH} execute_process(COMMAND git branch --contains ${MY_WC_HASH}
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}

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

@@ -36,7 +36,6 @@ set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE) set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE) set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE) set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_IO_PLY OFF CACHE BOOL "" FORCE)
set(WITH_IO_STL OFF CACHE BOOL "" FORCE) set(WITH_IO_STL OFF CACHE BOOL "" FORCE)
set(WITH_IO_WAVEFRONT_OBJ OFF CACHE BOOL "" FORCE) set(WITH_IO_WAVEFRONT_OBJ OFF CACHE BOOL "" FORCE)
set(WITH_IO_GPENCIL OFF CACHE BOOL "" FORCE) set(WITH_IO_GPENCIL OFF CACHE BOOL "" FORCE)
@@ -53,6 +52,7 @@ set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE) set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE) set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEDENOISE OFF CACHE BOOL "" FORCE) set(WITH_OPENIMAGEDENOISE OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE) set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE) set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)

View File

@@ -85,7 +85,7 @@ if(NOT APPLE)
set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE) set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE) set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE) set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_HIP_BINARIES OFF CACHE BOOL "" FORCE) set(WITH_CYCLES_HIP_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE) set(WITH_CYCLES_DEVICE_ONEAPI ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_ONEAPI_BINARIES ON CACHE BOOL "" FORCE) set(WITH_CYCLES_ONEAPI_BINARIES ON CACHE BOOL "" FORCE)
endif() endif()

View File

@@ -11,11 +11,11 @@
mkdir ~/blender-git mkdir ~/blender-git
cd ~/blender-git cd ~/blender-git
git clone https://projects.blender.org/blender/blender.git git clone http://git.blender.org/blender.git
cd blender cd blender
git submodule update --init --recursive git submodule update --init --recursive
git submodule foreach git checkout main git submodule foreach git checkout master
git submodule foreach git pull --rebase origin main git submodule foreach git pull --rebase origin master
# create build dir # create build dir
mkdir ~/blender-git/build-cmake mkdir ~/blender-git/build-cmake
@@ -35,7 +35,7 @@ ln -s ~/blender-git/build-cmake/bin/blender ~/blender-git/blender/blender.bin
echo "" echo ""
echo "* Useful Commands *" echo "* Useful Commands *"
echo " Run Blender: ~/blender-git/blender/blender.bin" echo " Run Blender: ~/blender-git/blender/blender.bin"
echo " Update Blender: git pull --rebase; git submodule foreach git pull --rebase origin main" echo " Update Blender: git pull --rebase; git submodule foreach git pull --rebase origin master"
echo " Reconfigure Blender: cd ~/blender-git/build-cmake ; cmake ." echo " Reconfigure Blender: cd ~/blender-git/build-cmake ; cmake ."
echo " Build Blender: cd ~/blender-git/build-cmake ; make" echo " Build Blender: cd ~/blender-git/build-cmake ; make"
echo "" echo ""

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2022 Blender Foundation # Copyright 2022 Blender Foundation. All rights reserved.
# This file is used to test the system for headers & symbols. # This file is used to test the system for headers & symbols.
# Variables should use the `HAVE_` prefix. # Variables should use the `HAVE_` prefix.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2006 Blender Foundation # Copyright 2006 Blender Foundation. All rights reserved.
macro(list_insert_after macro(list_insert_after
list_id item_check item_add list_id item_check item_add
@@ -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()
@@ -544,16 +544,14 @@ endfunction()
function(setup_platform_linker_libs function(setup_platform_linker_libs
target target
) )
# jemalloc must be early in the list, to be before pthread (see #57998). # jemalloc must be early in the list, to be before pthread (see T57998)
if(WITH_MEM_JEMALLOC) if(WITH_MEM_JEMALLOC)
target_link_libraries(${target} ${JEMALLOC_LIBRARIES}) target_link_libraries(${target} ${JEMALLOC_LIBRARIES})
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})
target_link_libraries(${target} ${PLATFORM_LINKLIBS}) target_link_libraries(${target} ${PLATFORM_LINKLIBS})
@@ -702,7 +700,6 @@ macro(remove_strict_flags)
endif() endif()
if(MSVC) if(MSVC)
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4 remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
endif() endif()
@@ -722,7 +719,7 @@ macro(remove_extra_strict_flags)
endif() endif()
if(MSVC) if(MSVC)
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4 # TODO
endif() endif()
endmacro() endmacro()
@@ -1091,7 +1088,7 @@ function(msgfmt_simple
add_custom_command( add_custom_command(
OUTPUT ${_file_to} OUTPUT ${_file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path} COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND ${CMAKE_COMMAND} -E env ${PLATFORM_ENV_BUILD} "$<TARGET_FILE:msgfmt>" ${_file_from} ${_file_to} COMMAND "$<TARGET_FILE:msgfmt>" ${_file_from} ${_file_to}
DEPENDS msgfmt ${_file_from}) DEPENDS msgfmt ${_file_from})
set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE) set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
@@ -1265,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)
@@ -1300,29 +1297,16 @@ macro(windows_install_shared_manifest)
endif() endif()
if(WINDOWS_INSTALL_DEBUG) if(WINDOWS_INSTALL_DEBUG)
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Debug") set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Debug")
endif()
if(WINDOWS_INSTALL_RELEASE)
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Release;RelWithDebInfo;MinSizeRel")
endif()
if(NOT WITH_PYTHON_MODULE)
# Blender executable with manifest.
if(WINDOWS_INSTALL_DEBUG)
list(APPEND WINDOWS_SHARED_MANIFEST_DEBUG ${WINDOWS_INSTALL_FILES}) list(APPEND WINDOWS_SHARED_MANIFEST_DEBUG ${WINDOWS_INSTALL_FILES})
endif() endif()
if(WINDOWS_INSTALL_RELEASE) if(WINDOWS_INSTALL_RELEASE)
list(APPEND WINDOWS_SHARED_MANIFEST_RELEASE ${WINDOWS_INSTALL_FILES}) list(APPEND WINDOWS_SHARED_MANIFEST_RELEASE ${WINDOWS_INSTALL_FILES})
set(WINDOWS_CONFIGURATIONS "${WINDOWS_CONFIGURATIONS};Release;RelWithDebInfo;MinSizeRel")
endif() endif()
install(FILES ${WINDOWS_INSTALL_FILES} install(FILES ${WINDOWS_INSTALL_FILES}
CONFIGURATIONS ${WINDOWS_CONFIGURATIONS} CONFIGURATIONS ${WINDOWS_CONFIGURATIONS}
DESTINATION "./blender.shared" DESTINATION "./blender.shared"
) )
else()
# Python module without manifest.
install(FILES ${WINDOWS_INSTALL_FILES}
CONFIGURATIONS ${WINDOWS_CONFIGURATIONS}
DESTINATION "./bpy"
)
endif()
endmacro() endmacro()
macro(windows_generate_manifest) macro(windows_generate_manifest)
@@ -1339,19 +1323,11 @@ macro(windows_generate_manifest)
endmacro() endmacro()
macro(windows_generate_shared_manifest) macro(windows_generate_shared_manifest)
if(WINDOWS_SHARED_MANIFEST_DEBUG)
windows_generate_manifest( windows_generate_manifest(
FILES "${WINDOWS_SHARED_MANIFEST_DEBUG}" FILES "${WINDOWS_SHARED_MANIFEST_DEBUG}"
OUTPUT "${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest" OUTPUT "${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest"
NAME "blender.shared" NAME "blender.shared"
) )
install(
FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest
DESTINATION "./blender.shared"
CONFIGURATIONS Debug
)
endif()
if(WINDOWS_SHARED_MANIFEST_RELEASE)
windows_generate_manifest( windows_generate_manifest(
FILES "${WINDOWS_SHARED_MANIFEST_RELEASE}" FILES "${WINDOWS_SHARED_MANIFEST_RELEASE}"
OUTPUT "${CMAKE_BINARY_DIR}/Release/blender.shared.manifest" OUTPUT "${CMAKE_BINARY_DIR}/Release/blender.shared.manifest"
@@ -1362,26 +1338,9 @@ macro(windows_generate_shared_manifest)
DESTINATION "./blender.shared" DESTINATION "./blender.shared"
CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
) )
endif() install(
endmacro() FILES ${CMAKE_BINARY_DIR}/Debug/blender.shared.manifest
DESTINATION "./blender.shared"
macro(windows_process_platform_bundled_libraries library_deps) CONFIGURATIONS Debug
if(NOT "${library_deps}" STREQUAL "")
set(next_library_mode "ALL")
foreach(library ${library_deps})
string(TOUPPER "${library}" library_upper)
if(("${library_upper}" STREQUAL "RELEASE") OR
("${library_upper}" STREQUAL "DEBUG") OR
("${library_upper}" STREQUAL "ALL"))
set(next_library_mode "${library_upper}")
else()
windows_install_shared_manifest(
FILES ${library}
${next_library_mode}
) )
set(next_library_mode "ALL")
endif()
endforeach()
endif()
endmacro() endmacro()

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation # Copyright 2016 Blender Foundation. All rights reserved.
# Libraries configuration for Apple. # Libraries configuration for Apple.
@@ -86,25 +86,39 @@ 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(SHADERC_LIBRARY ${VULKAN_ROOT_DIR}/lib/libshaderc_combined.a)
set(VULKAN_INCLUDE_DIRS ${VULKAN_INCLUDE_DIR} ${MOLTENVK_INCLUDE_DIRS})
set(VULKAN_LIBRARIES ${VULKAN_LIBRARY} ${SHADERC_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 +156,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)
@@ -245,7 +259,6 @@ if(WITH_BOOST)
if(WITH_USD AND USD_PYTHON_SUPPORT) if(WITH_USD AND USD_PYTHON_SUPPORT)
list(APPEND _boost_FIND_COMPONENTS python${PYTHON_VERSION_NO_DOTS}) list(APPEND _boost_FIND_COMPONENTS python${PYTHON_VERSION_NO_DOTS})
endif() endif()
set(Boost_NO_WARN_NEW_VERSIONS ON)
find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS}) find_package(Boost COMPONENTS ${_boost_FIND_COMPONENTS})
# Boost Python is separate to avoid linking Python into tests that don't need it. # Boost Python is separate to avoid linking Python into tests that don't need it.
@@ -257,11 +270,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 !
@@ -271,13 +285,25 @@ if(WITH_PUGIXML)
find_package(PugiXML REQUIRED) find_package(PugiXML REQUIRED)
endif() endif()
find_package(OpenImageIO REQUIRED) if(WITH_OPENIMAGEIO)
add_bundled_libraries(openimageio/lib) find_package(OpenImageIO)
list(APPEND OPENIMAGEIO_LIBRARIES
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${TIFF_LIBRARY}
${OPENEXR_LIBRARIES}
${OPENJPEG_LIBRARIES}
${ZLIB_LIBRARIES}
)
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
add_bundled_libraries(openimageio/lib)
endif()
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)
@@ -288,8 +314,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)
@@ -330,7 +356,6 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
endforeach() endforeach()
set(EMBREE_LIBRARIES ${_embree_libraries_force_load}) set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
endif() endif()
add_bundled_libraries(embree/lib)
if(WITH_OPENIMAGEDENOISE) if(WITH_OPENIMAGEDENOISE)
find_package(OpenImageDenoise REQUIRED) find_package(OpenImageDenoise REQUIRED)
@@ -338,8 +363,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)
@@ -357,9 +382,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)
@@ -430,7 +455,7 @@ string(APPEND PLATFORM_LINKFLAGS " -stdlib=libc++")
# Make stack size more similar to Embree, required for Embree. # Make stack size more similar to Embree, required for Embree.
string(APPEND PLATFORM_LINKFLAGS_EXECUTABLE " -Wl,-stack_size,0x100000") string(APPEND PLATFORM_LINKFLAGS_EXECUTABLE " -Wl,-stack_size,0x100000")
# Suppress ranlib "has no symbols" warnings (workaround for #48250). # Suppress ranlib "has no symbols" warnings (workaround for T48250)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
# llvm-ranlib doesn't support this flag. Xcode's libtool does. # llvm-ranlib doesn't support this flag. Xcode's libtool does.

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation # Copyright 2016 Blender Foundation. All rights reserved.
# Xcode and system configuration for Apple. # Xcode and system configuration for Apple.
@@ -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 # 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

@@ -1,28 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation # Copyright 2016 Blender Foundation. All rights reserved.
# 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)
if(NOT WITH_LIBS_PRECOMPILED)
unset(LIBDIR)
else()
if(NOT DEFINED LIBDIR)
# Path to a locally compiled libraries. # Path to a locally compiled libraries.
set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}) set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME) string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME}) set(LIBDIR_NATIVE_ABI ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
# Path to precompiled libraries with known glibc 2.28 ABI. # Path to precompiled libraries with known CentOS 7 ABI.
set(LIBDIR_GLIBC228_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_x86_64_glibc_228) set(LIBDIR_CENTOS7_ABI ${CMAKE_SOURCE_DIR}/../lib/linux_centos7_x86_64)
# Choose the best suitable libraries. # Choose the best suitable libraries.
if(EXISTS ${LIBDIR_NATIVE_ABI}) if(EXISTS ${LIBDIR_NATIVE_ABI})
set(LIBDIR ${LIBDIR_NATIVE_ABI}) set(LIBDIR ${LIBDIR_NATIVE_ABI})
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True) set(WITH_LIBC_MALLOC_HOOK_WORKAROUND True)
elseif(EXISTS ${LIBDIR_GLIBC228_ABI}) elseif(EXISTS ${LIBDIR_CENTOS7_ABI})
set(LIBDIR ${LIBDIR_GLIBC228_ABI}) set(LIBDIR ${LIBDIR_CENTOS7_ABI})
set(WITH_CXX11_ABI OFF)
if(WITH_MEM_JEMALLOC) if(WITH_MEM_JEMALLOC)
# jemalloc provides malloc hooks. # jemalloc provides malloc hooks.
set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False) set(WITH_LIBC_MALLOC_HOOK_WORKAROUND False)
@@ -33,23 +30,13 @@ else()
# Avoid namespace pollustion. # Avoid namespace pollustion.
unset(LIBDIR_NATIVE_ABI) unset(LIBDIR_NATIVE_ABI)
unset(LIBDIR_GLIBC228_ABI) unset(LIBDIR_CENTOS7_ABI)
endif()
if(NOT (EXISTS ${LIBDIR}))
message(STATUS
"Unable to find LIBDIR: ${LIBDIR}, system libraries may be used "
"(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)
@@ -317,7 +305,7 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
endif() endif()
endif() endif()
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT))) if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation") set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR) if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO}) set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
@@ -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
@@ -394,7 +391,6 @@ if(WITH_BOOST)
list(APPEND __boost_packages python${PYTHON_VERSION_NO_DOTS}) list(APPEND __boost_packages python${PYTHON_VERSION_NO_DOTS})
endif() endif()
list(APPEND __boost_packages system) list(APPEND __boost_packages system)
set(Boost_NO_WARN_NEW_VERSIONS ON)
find_package(Boost 1.48 COMPONENTS ${__boost_packages}) find_package(Boost 1.48 COMPONENTS ${__boost_packages})
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
# try to find non-multithreaded if -mt not found, this flag # try to find non-multithreaded if -mt not found, this flag
@@ -425,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)
@@ -439,21 +436,47 @@ if(WITH_IMAGE_WEBP)
set_and_warn_library_found("WebP" WEBP_FOUND WITH_IMAGE_WEBP) set_and_warn_library_found("WebP" WEBP_FOUND WITH_IMAGE_WEBP)
endif() endif()
find_package_wrapper(OpenImageIO REQUIRED) if(WITH_OPENIMAGEIO)
add_bundled_libraries(openimageio/lib) find_package_wrapper(OpenImageIO)
set(OPENIMAGEIO_LIBRARIES
${OPENIMAGEIO_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${ZLIB_LIBRARIES}
${BOOST_LIBRARIES}
)
set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_IMAGE_TIFF)
list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
endif()
if(WITH_IMAGE_OPENEXR)
list(APPEND OPENIMAGEIO_LIBRARIES "${OPENEXR_LIBRARIES}")
endif()
if(WITH_IMAGE_WEBP)
list(APPEND OPENIMAGEIO_LIBRARIES "${WEBP_LIBRARIES}")
endif()
set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO)
if(WITH_OPENIMAGEIO)
add_bundled_libraries(openimageio/lib)
endif()
endif()
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)
endif() endif()
add_bundled_libraries(embree/lib)
if(WITH_OPENIMAGEDENOISE) if(WITH_OPENIMAGEDENOISE)
find_package_wrapper(OpenImageDenoise) find_package_wrapper(OpenImageDenoise)
@@ -461,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()
@@ -475,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()
@@ -490,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)
@@ -531,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()
@@ -546,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})
@@ -575,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)
@@ -631,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)
@@ -642,29 +664,16 @@ if(WITH_GHOST_WAYLAND)
pkg_check_modules(wayland-egl wayland-egl) pkg_check_modules(wayland-egl wayland-egl)
pkg_check_modules(wayland-scanner wayland-scanner) pkg_check_modules(wayland-scanner wayland-scanner)
pkg_check_modules(wayland-cursor wayland-cursor) pkg_check_modules(wayland-cursor wayland-cursor)
pkg_check_modules(wayland-protocols wayland-protocols>=1.31) 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()
# NOTE: this file must always refer to the newest API which is used, so older # CentOS 7 packages have too old a version, a newer version exist in the
# `wayland-protocols` are never found and used which then fail to locate required protocols. # precompiled libraries.
set(_wayland_protocols_reference_file "staging/fractional-scale/fractional-scale-v1.xml")
# Reset the protocols directory the reference file from `wayland-protocols` is not found.
# This avoids developers having build failures when a cached directory is used that no
# longer contains the required file.
if(DEFINED WAYLAND_PROTOCOLS_DIR)
if(NOT EXISTS "${WAYLAND_PROTOCOLS_DIR}/${_wayland_protocols_reference_file}")
unset(WAYLAND_PROTOCOLS_DIR CACHE)
endif()
endif()
# Rocky8 packages have too old a version, a newer version exist in the pre-compiled libraries.
find_path(WAYLAND_PROTOCOLS_DIR find_path(WAYLAND_PROTOCOLS_DIR
NAMES ${_wayland_protocols_reference_file} NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
PATH_SUFFIXES share/wayland-protocols PATH_SUFFIXES share/wayland-protocols
PATHS ${LIBDIR}/wayland-protocols PATHS ${LIBDIR}/wayland-protocols
) )
unset(_wayland_protocols_reference_file)
if(EXISTS ${WAYLAND_PROTOCOLS_DIR}) if(EXISTS ${WAYLAND_PROTOCOLS_DIR})
set(wayland-protocols_FOUND ON) set(wayland-protocols_FOUND ON)
@@ -709,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)

View File

@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright 2016 Blender Foundation # Copyright 2016 Blender Foundation. All rights reserved.
# Libraries configuration for Windows. # Libraries configuration for Windows.
@@ -114,15 +114,14 @@ add_definitions(-D_WIN32_WINNT=0x603)
# First generate the manifest for tests since it will not need the dependency on the CRT. # First generate the manifest for tests since it will not need the dependency on the CRT.
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY) configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/tests.exe.manifest @ONLY)
# Always detect CRT paths, but only manually install with WITH_WINDOWS_BUNDLE_CRT.
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
include(InstallRequiredSystemLibraries)
if(WITH_WINDOWS_BUNDLE_CRT) if(WITH_WINDOWS_BUNDLE_CRT)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES ${WITH_OPENMP})
include(InstallRequiredSystemLibraries)
# ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles # ucrtbase(d).dll cannot be in the manifest, due to the way windows 10 handles
# redirects for this dll, for details see #88813. # redirects for this dll, for details see T88813.
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}) foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
string(FIND ${lib} "ucrtbase" pos) string(FIND ${lib} "ucrtbase" pos)
if(NOT pos EQUAL -1) if(NOT pos EQUAL -1)
@@ -141,8 +140,6 @@ 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>")
endif()
if(NOT WITH_PYTHON_MODULE)
set(BUNDLECRT "${BUNDLECRT}<dependency><dependentAssembly><assemblyIdentity type=\"win32\" name=\"blender.shared\" 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()
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)
@@ -298,7 +295,7 @@ unset(MATERIALX_LIB_FOLDER_EXISTS)
if(NOT MSVC_CLANG AND # Available with MSVC 15.7+ but not for CLANG. if(NOT MSVC_CLANG AND # Available with MSVC 15.7+ but not for CLANG.
NOT WITH_WINDOWS_SCCACHE AND # And not when sccache is enabled NOT WITH_WINDOWS_SCCACHE AND # And not when sccache is enabled
NOT VS_CLANG_TIDY) # Clang-tidy does not like these options NOT VS_CLANG_TIDY) # Clang-tidy does not like these options
add_compile_options(/experimental:external /external:I "${LIBDIR}" /external:W0) add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
endif() endif()
# Add each of our libraries to our cmake_prefix_path so find_package() could work # Add each of our libraries to our cmake_prefix_path so find_package() could work
@@ -525,10 +522,21 @@ if(WITH_PYTHON)
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" ) set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
endif() endif()
if(NOT WITH_WINDOWS_FIND_MODULES) if(WITH_BOOST)
# even if boost is off, we still need to install the dlls when we use our lib folder since if(WITH_CYCLES AND WITH_CYCLES_OSL)
# some of the other dependencies may need them. For this to work, BOOST_VERSION, set(boost_extra_libs wave)
# BOOST_POSTFIX, and BOOST_DEBUG_POSTFIX need to be set. endif()
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
if(WITH_WINDOWS_FIND_MODULES)
find_package(Boost COMPONENTS date_time filesystem thread regex system ${boost_extra_libs})
endif()
if(NOT Boost_FOUND)
warn_hardcoded_paths(BOOST)
set(BOOST ${LIBDIR}/boost) set(BOOST ${LIBDIR}/boost)
set(BOOST_INCLUDE_DIR ${BOOST}/include) set(BOOST_INCLUDE_DIR ${BOOST}/include)
set(BOOST_LIBPATH ${BOOST}/lib) set(BOOST_LIBPATH ${BOOST}/lib)
@@ -545,26 +553,9 @@ if(NOT WITH_WINDOWS_FIND_MODULES)
set(BOOST_POSTFIX "vc142-mt-x64-${BOOST_VERSION}") set(BOOST_POSTFIX "vc142-mt-x64-${BOOST_VERSION}")
set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}") set(BOOST_DEBUG_POSTFIX "vc142-mt-gyd-x64-${BOOST_VERSION}")
set(BOOST_PREFIX "") set(BOOST_PREFIX "")
endif()
if(WITH_BOOST)
if(WITH_CYCLES AND WITH_CYCLES_OSL)
set(boost_extra_libs wave)
endif()
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
if(WITH_WINDOWS_FIND_MODULES)
find_package(Boost COMPONENTS date_time filesystem thread regex system ${boost_extra_libs})
endif()
if(NOT Boost_FOUND)
warn_hardcoded_paths(BOOST)
# 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()
@@ -582,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
@@ -611,8 +602,9 @@ if(WITH_BOOST)
set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB") set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
endif() endif()
windows_find_package(OpenImageIO) if(WITH_OPENIMAGEIO)
if(NOT OpenImageIO_FOUND) windows_find_package(OpenImageIO)
if(NOT OpenImageIO_FOUND)
set(OPENIMAGEIO ${LIBDIR}/OpenImageIO) set(OPENIMAGEIO ${LIBDIR}/OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include) set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include)
@@ -620,9 +612,15 @@ if(NOT OpenImageIO_FOUND)
set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib) set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib) set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG}) set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
endif()
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe") set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
# If the .dll does not exist, assume it is a static OIIO
if(NOT EXISTS ${OPENIMAGEIO}/bin/OpenImageIO.dll)
add_definitions(-DOIIO_STATIC_DEFINE)
endif()
add_definitions(-DOIIO_NO_SSE=1)
endif() endif()
add_definitions(-DOIIO_NO_SSE=1)
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")
@@ -850,44 +848,9 @@ endif()
if(WITH_CYCLES AND WITH_CYCLES_EMBREE) if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
windows_find_package(Embree) windows_find_package(Embree)
if(NOT Embree_FOUND) if(NOT Embree_FOUND)
set(EMBREE_ROOT_DIR ${LIBDIR}/embree)
set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include) set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include)
if(EXISTS ${LIBDIR}/embree/include/embree4/rtcore_config.h)
set(EMBREE_MAJOR_VERSION 4)
else()
set(EMBREE_MAJOR_VERSION 3)
endif()
file(READ ${LIBDIR}/embree/include/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
if(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
set(EMBREE_STATIC_LIB TRUE)
else()
set(EMBREE_STATIC_LIB FALSE)
endif()
if(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
set(EMBREE_SYCL_SUPPORT TRUE)
else()
set(EMBREE_SYCL_SUPPORT FALSE)
endif()
set(EMBREE_LIBRARIES set(EMBREE_LIBRARIES
optimized ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}.lib optimized ${LIBDIR}/embree/lib/embree3.lib
debug ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}_d.lib
)
if(EMBREE_SYCL_SUPPORT)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree4_sycl.lib
debug ${LIBDIR}/embree/lib/embree4_sycl_d.lib
)
endif()
if(EMBREE_STATIC_LIB)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree_avx2.lib optimized ${LIBDIR}/embree/lib/embree_avx2.lib
optimized ${LIBDIR}/embree/lib/embree_avx.lib optimized ${LIBDIR}/embree/lib/embree_avx.lib
optimized ${LIBDIR}/embree/lib/embree_sse42.lib optimized ${LIBDIR}/embree/lib/embree_sse42.lib
@@ -896,6 +859,8 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
optimized ${LIBDIR}/embree/lib/simd.lib optimized ${LIBDIR}/embree/lib/simd.lib
optimized ${LIBDIR}/embree/lib/sys.lib optimized ${LIBDIR}/embree/lib/sys.lib
optimized ${LIBDIR}/embree/lib/tasking.lib optimized ${LIBDIR}/embree/lib/tasking.lib
debug ${LIBDIR}/embree/lib/embree3_d.lib
debug ${LIBDIR}/embree/lib/embree_avx2_d.lib debug ${LIBDIR}/embree/lib/embree_avx2_d.lib
debug ${LIBDIR}/embree/lib/embree_avx_d.lib debug ${LIBDIR}/embree/lib/embree_avx_d.lib
debug ${LIBDIR}/embree/lib/embree_sse42_d.lib debug ${LIBDIR}/embree/lib/embree_sse42_d.lib
@@ -905,21 +870,6 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
debug ${LIBDIR}/embree/lib/sys_d.lib debug ${LIBDIR}/embree/lib/sys_d.lib
debug ${LIBDIR}/embree/lib/tasking_d.lib debug ${LIBDIR}/embree/lib/tasking_d.lib
) )
if(EMBREE_SYCL_SUPPORT)
set(EMBREE_LIBRARIES
${EMBREE_LIBRARIES}
optimized ${LIBDIR}/embree/lib/embree_rthwif.lib
debug ${LIBDIR}/embree/lib/embree_rthwif_d.lib
)
endif()
endif()
endif()
if(NOT EMBREE_STATIC_LIB)
list(APPEND PLATFORM_BUNDLED_LIBRARIES
RELEASE ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}.dll
DEBUG ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}_d.dll
)
endif() endif()
endif() endif()
@@ -951,11 +901,11 @@ endif()
if(WINDOWS_PYTHON_DEBUG) if(WINDOWS_PYTHON_DEBUG)
# Include the system scripts in the blender_python_system_scripts project. # Include the system scripts in the blender_python_system_scripts project.
file(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/scripts/*.*" ) file(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
add_custom_target(blender_python_system_scripts SOURCES ${inFiles}) add_custom_target(blender_python_system_scripts SOURCES ${inFiles})
foreach(_source IN ITEMS ${inFiles}) foreach(_source IN ITEMS ${inFiles})
get_filename_component(_source_path "${_source}" PATH) get_filename_component(_source_path "${_source}" PATH)
string(REPLACE "${CMAKE_SOURCE_DIR}/scripts/" "" _source_path "${_source_path}") string(REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}")
string(REPLACE "/" "\\" _group_path "${_source_path}") string(REPLACE "/" "\\" _group_path "${_source_path}")
source_group("${_group_path}" FILES "${_source}") source_group("${_group_path}" FILES "${_source}")
endforeach() endforeach()
@@ -990,7 +940,7 @@ if(WINDOWS_PYTHON_DEBUG)
file(WRITE ${USER_PROPS_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?> file(WRITE ${USER_PROPS_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"> <Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">
<PropertyGroup> <PropertyGroup>
<LocalDebuggerCommandArguments>-con --env-system-scripts \"${CMAKE_SOURCE_DIR}/scripts\" </LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>-con --env-system-scripts \"${CMAKE_SOURCE_DIR}/release/scripts\" </LocalDebuggerCommandArguments>
</PropertyGroup> </PropertyGroup>
</Project>") </Project>")
endif() endif()
@@ -1044,23 +994,6 @@ if(WITH_VULKAN_BACKEND)
endif() endif()
endif() endif()
if(WITH_VULKAN_BACKEND)
if(EXISTS ${LIBDIR}/shaderc)
set(SHADERC_FOUND On)
set(SHADERC_ROOT_DIR ${LIBDIR}/shaderc)
set(SHADERC_INCLUDE_DIR ${SHADERC_ROOT_DIR}/include)
set(SHADERC_INCLUDE_DIRS ${SHADERC_INCLUDE_DIR})
set(SHADERC_LIBRARY
DEBUG ${SHADERC_ROOT_DIR}/lib/shaderc_shared_d.lib
OPTIMIZED ${SHADERC_ROOT_DIR}/lib/shaderc_shared.lib
)
set(SHADERC_LIBRARIES ${SHADERC_LIBRARY})
else()
message(WARNING "Shaderc was not found, disabling WITH_VULKAN_BACKEND")
set(WITH_VULKAN_BACKEND OFF)
endif()
endif()
if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING) if(WITH_CYCLES AND WITH_CYCLES_PATH_GUIDING)
find_package(openpgl QUIET) find_package(openpgl QUIET)
if(openpgl_FOUND) if(openpgl_FOUND)
@@ -1077,7 +1010,7 @@ endif()
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include) set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib) set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT))) if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero) set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler") set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR) if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
@@ -1088,9 +1021,8 @@ if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_
${SYCL_ROOT_DIR}/bin/sycl[0-9].dll ${SYCL_ROOT_DIR}/bin/sycl[0-9].dll
) )
foreach(sycl_runtime_library IN LISTS _sycl_runtime_libraries_glob) foreach(sycl_runtime_library IN LISTS _sycl_runtime_libraries_glob)
string(REPLACE ".dll" "_d.dll" sycl_runtime_library_debug ${sycl_runtime_library}) string(REPLACE ".dll" "$<$<CONFIG:Debug>:d>.dll" sycl_runtime_library ${sycl_runtime_library})
list(APPEND _sycl_runtime_libraries RELEASE ${sycl_runtime_library}) list(APPEND _sycl_runtime_libraries ${sycl_runtime_library})
list(APPEND _sycl_runtime_libraries DEBUG ${sycl_runtime_library_debug})
endforeach() endforeach()
unset(_sycl_runtime_libraries_glob) unset(_sycl_runtime_libraries_glob)
@@ -1098,19 +1030,17 @@ if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_
${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})
unset(_sycl_runtime_libraries) unset(_sycl_runtime_libraries)
set(SYCL_LIBRARIES optimized ${SYCL_LIBRARY} debug ${SYCL_LIBRARY_DEBUG})
endif() endif()
# Environment variables to run precompiled executables that needed libraries. # Environment variables to run precompiled executables that needed libraries.
list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ";" _library_paths) list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ";" _library_paths)
set(PLATFORM_ENV_BUILD_DIRS "${LIBDIR}/tbb/bin\;${LIBDIR}/OpenImageIO/bin\;${LIBDIR}/boost/lib\;${LIBDIR}/openexr/bin\;${LIBDIR}/imath/bin\;${PATH}") set(PLATFORM_ENV_BUILD_DIRS "${LIBDIR}/OpenImageIO/bin\;${LIBDIR}/boost/lib\;${LIBDIR}/openexr/bin\;${LIBDIR}/imath/bin\;${PATH}")
set(PLATFORM_ENV_BUILD "PATH=${PLATFORM_ENV_BUILD_DIRS}") set(PLATFORM_ENV_BUILD "PATH=${PLATFORM_ENV_BUILD_DIRS}")
# Install needs the additional folders from PLATFORM_ENV_BUILD_DIRS as well, as tools like idiff and abcls use the release mode dlls # Install needs the additional folders from PLATFORM_ENV_BUILD_DIRS as well, as tools like idiff and abcls use the release mode dlls
set(PLATFORM_ENV_INSTALL "PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/\;${PLATFORM_ENV_BUILD_DIRS}\;$ENV{PATH}") set(PLATFORM_ENV_INSTALL "PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/blender.shared/\;${PLATFORM_ENV_BUILD_DIRS}\;$ENV{PATH}")

View File

@@ -142,7 +142,7 @@ def cmake_advanced_info() -> Union[Tuple[List[str], List[Tuple[str, str]]], Tupl
make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM") make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
if make_exe is None: if make_exe is None:
print("Make command not found: CMAKE_MAKE_PROGRAM") print("Make command not found in: %r not found" % project_path)
return None, None return None, None
make_exe_basename = os.path.basename(make_exe) make_exe_basename = os.path.basename(make_exe)

View File

@@ -1,9 +1,55 @@
#
# Used by Buildbot build pipeline make_update.py script only for now
# We intended to update the make_update.py in the branches to use this file eventually
#
update-code:
git:
submodules:
- branch: xr-dev
commit_id: HEAD
path: release/scripts/addons
- branch: master
commit_id: HEAD
path: release/scripts/addons_contrib
- branch: master
commit_id: HEAD
path: release/datafiles/locale
- branch: master
commit_id: HEAD
path: source/tools
svn:
libraries:
darwin-arm64:
branch: trunk
commit_id: HEAD
path: lib/darwin_arm64
darwin-x86_64:
branch: trunk
commit_id: HEAD
path: lib/darwin
linux-x86_64:
branch: trunk
commit_id: HEAD
path: lib/linux_centos7_x86_64
windows-amd64:
branch: trunk
commit_id: HEAD
path: lib/win64_vc15
tests:
branch: trunk
commit_id: HEAD
path: lib/tests
benchmarks:
branch: trunk
commit_id: HEAD
path: lib/benchmarks
# #
# 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:
@@ -13,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 (
@@ -58,7 +58,7 @@ Each Blender release supports one Python version, and the package is only compat
## Source Code ## Source Code
* [Releases](https://download.blender.org/source/) * [Releases](https://download.blender.org/source/)
* Repository: [projects.blender.org/blender/blender.git](https://projects.blender.org/blender/blender) * Repository: [git.blender.org/blender.git](https://git.blender.org/gitweb/gitweb.cgi/blender.git)
## Credits ## Credits
@@ -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

@@ -112,7 +112,6 @@ def create_manifest(
print(f'Building manifest of files: "{outpath}"...', end="", flush=True) print(f'Building manifest of files: "{outpath}"...', end="", flush=True)
with outpath.open("w", encoding="utf-8") as outfile: with outpath.open("w", encoding="utf-8") as outfile:
main_files_to_manifest(blender_srcdir, outfile) main_files_to_manifest(blender_srcdir, outfile)
assets_to_manifest(blender_srcdir, outfile)
submodules_to_manifest(blender_srcdir, version, outfile) submodules_to_manifest(blender_srcdir, version, outfile)
if packages_dir: if packages_dir:
@@ -132,27 +131,17 @@ def submodules_to_manifest(
skip_addon_contrib = version.is_release() skip_addon_contrib = version.is_release()
assert not blender_srcdir.is_absolute() assert not blender_srcdir.is_absolute()
for submodule in ("scripts/addons", "scripts/addons_contrib"): for line in git_command("-C", blender_srcdir, "submodule"):
submodule = line.split()[1]
# Don't use native slashes as GIT for MS-Windows outputs forward slashes. # Don't use native slashes as GIT for MS-Windows outputs forward slashes.
if skip_addon_contrib and submodule == "scripts/addons_contrib": if skip_addon_contrib and submodule == "release/scripts/addons_contrib":
continue continue
for path in git_ls_files(blender_srcdir / submodule): for path in git_ls_files(blender_srcdir / submodule):
print(path, file=outfile) print(path, file=outfile)
def assets_to_manifest(blender_srcdir: Path, outfile: TextIO) -> None:
assert not blender_srcdir.is_absolute()
assets_dir = blender_srcdir.parent / "lib" / "assets"
for path in assets_dir.glob("*"):
if path.name == "working":
continue
if path.name in SKIP_NAMES:
continue
print(path, file=outfile)
def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None: def packages_to_manifest(outfile: TextIO, packages_dir: Path) -> None:
for path in packages_dir.glob("*"): for path in packages_dir.glob("*"):
if not path.is_file(): if not path.is_file():
@@ -183,9 +172,7 @@ def create_tarball(
command += [ command += [
"--transform", "--transform",
f"s,^{blender_srcdir.name}/,blender-{version}/,g", f"s,^{blender_srcdir.name}/,blender-{version}/,g",
"--transform", "--use-compress-program=xz -9",
f"s,^lib/assets/,blender-{version}/release/datafiles/assets/,g",
"--use-compress-program=xz -1",
"--create", "--create",
f"--file={tarball}", f"--file={tarball}",
f"--files-from={manifest}", f"--files-from={manifest}",

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

@@ -16,28 +16,14 @@ import shutil
import sys import sys
import make_utils import make_utils
from pathlib import Path
from make_utils import call, check_output from make_utils import call, check_output
from urllib.parse import urljoin
from typing import ( from typing import (
List, List,
Iterable,
Optional, Optional,
) )
class Submodule:
path: str
branch: str
branch_fallback: str
def __init__(self, path: str, branch: str, branch_fallback: str) -> None:
self.path = path
self.branch = branch
self.branch_fallback = branch_fallback
def print_stage(text: str) -> None: def print_stage(text: str) -> None:
print("") print("")
print(text) print(text)
@@ -55,8 +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")
parser.add_argument("--architecture", type=str, choices=("x86_64", "amd64", "arm64",))
return parser.parse_args() return parser.parse_args()
@@ -66,19 +51,6 @@ def get_blender_git_root() -> str:
# Setup for precompiled libraries and tests from svn. # Setup for precompiled libraries and tests from svn.
def get_effective_architecture(args: argparse.Namespace) -> str:
architecture = args.architecture
if architecture:
assert isinstance(architecture, str)
return architecture
# Check platform.version to detect arm64 with x86_64 python binary.
if "ARM64" in platform.version():
return "arm64"
return platform.machine().lower()
def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None: def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None:
svn_non_interactive = [args.svn_command, '--non-interactive'] svn_non_interactive = [args.svn_command, '--non-interactive']
@@ -86,11 +58,11 @@ def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None
svn_url = make_utils.svn_libraries_base_url(release_version, args.svn_branch) svn_url = make_utils.svn_libraries_base_url(release_version, args.svn_branch)
# Checkout precompiled libraries # Checkout precompiled libraries
architecture = get_effective_architecture(args)
if sys.platform == 'darwin': if sys.platform == 'darwin':
if architecture == 'arm64': # Check platform.version to detect arm64 with x86_64 python binary.
if platform.machine() == 'arm64' or ('ARM64' in platform.version()):
lib_platform = "darwin_arm64" lib_platform = "darwin_arm64"
elif architecture == 'x86_64': elif platform.machine() == 'x86_64':
lib_platform = "darwin" lib_platform = "darwin"
else: else:
lib_platform = None lib_platform = None
@@ -99,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
@@ -132,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("."):
@@ -198,7 +157,7 @@ def git_update_skip(args: argparse.Namespace, check_remote_exists: bool = True)
return "rebase or merge in progress, complete it first" return "rebase or merge in progress, complete it first"
# Abort if uncommitted changes. # Abort if uncommitted changes.
changes = check_output([args.git_command, 'status', '--porcelain', '--untracked-files=no', '--ignore-submodules']) changes = check_output([args.git_command, 'status', '--porcelain', '--untracked-files=no'])
if len(changes) != 0: if len(changes) != 0:
return "you have unstaged changes" return "you have unstaged changes"
@@ -212,226 +171,58 @@ def git_update_skip(args: argparse.Namespace, check_remote_exists: bool = True)
return "" return ""
def use_upstream_workflow(args: argparse.Namespace) -> bool:
return make_utils.git_remote_exist(args.git_command, "upstream")
def work_tree_update_upstream_workflow(args: argparse.Namespace, use_fetch: bool = True) -> str:
"""
Update the Blender repository using the Github style of fork organization
Returns true if the current local branch has been updated to the upstream state.
Otherwise false is returned.
"""
branch_name = make_utils.git_branch(args.git_command)
if use_fetch:
call((args.git_command, "fetch", "upstream"))
upstream_branch = f"upstream/{branch_name}"
if not make_utils.git_branch_exists(args.git_command, upstream_branch):
return "no_branch"
retcode = call((args.git_command, "merge", "--ff-only", upstream_branch), exit_on_error=False)
if retcode != 0:
return "Unable to fast forward\n"
return ""
def work_tree_update(args: argparse.Namespace, use_fetch: bool = True) -> str:
"""
Update the Git working tree using the best strategy
This function detects whether it is a github style of fork remote organization is used, or
is it a repository which origin is an upstream.
"""
if use_upstream_workflow(args):
message = work_tree_update_upstream_workflow(args, use_fetch)
if message != "no_branch":
return message
# If there is upstream configured but the local branch is not in the upstream, try to
# update the branch from the fork.
update_command = [args.git_command, "pull", "--rebase"]
call(update_command)
return ""
# Update blender repository. # Update blender repository.
def blender_update(args: argparse.Namespace) -> str: def blender_update(args: argparse.Namespace) -> None:
print_stage("Updating Blender Git Repository") print_stage("Updating Blender Git Repository")
call([args.git_command, "pull", "--rebase"])
return work_tree_update(args)
def resolve_external_url(blender_url: str, repo_name: str) -> str: # Update submodules.
return urljoin(blender_url + "/", "../" + repo_name) def submodules_update(
args: argparse.Namespace,
release_version: Optional[str],
branch: Optional[str],
) -> str:
print_stage("Updating Submodules")
if make_utils.command_missing(args.git_command):
sys.stderr.write("git not found, can't update code\n")
sys.exit(1)
# Update submodules to appropriate given branch,
def external_script_copy_old_submodule_over(args: argparse.Namespace, directory_name: str) -> None: # falling back to master if none is given and/or found in a sub-repository.
blender_git_root = Path(get_blender_git_root()) branch_fallback = "master"
scripts_dir = blender_git_root / "scripts"
external_dir = scripts_dir / directory_name
old_submodule_relative_dir = Path("release") / "scripts" / directory_name
print(f"Moving {old_submodule_relative_dir} to scripts/{directory_name} ...")
old_submodule_dir = blender_git_root / old_submodule_relative_dir
shutil.move(old_submodule_dir, external_dir)
# Remove old ".git" which is a file with path to a submodule bare repo inside of main
# repo .git/modules directory.
(external_dir / ".git").unlink()
bare_repo_relative_dir = Path(".git") / "modules" / "release" / "scripts" / directory_name
print(f"Copying {bare_repo_relative_dir} to scripts/{directory_name}/.git ...")
bare_repo_dir = blender_git_root / bare_repo_relative_dir
shutil.copytree(bare_repo_dir, external_dir / ".git")
git_config = external_dir / ".git" / "config"
call((args.git_command, "config", "--file", str(git_config), "--unset", "core.worktree"))
def external_script_initialize_if_needed(args: argparse.Namespace,
repo_name: str,
directory_name: str) -> None:
"""Initialize checkout of an external repository scripts directory"""
blender_git_root = Path(get_blender_git_root())
blender_dot_git = blender_git_root / ".git"
scripts_dir = blender_git_root / "scripts"
external_dir = scripts_dir / directory_name
if external_dir.exists():
return
print(f"Initializing scripts/{directory_name} ...")
old_submodule_dot_git = blender_git_root / "release" / "scripts" / directory_name / ".git"
if old_submodule_dot_git.exists() and blender_dot_git.is_dir():
external_script_copy_old_submodule_over(args, directory_name)
return
origin_name = "upstream" if use_upstream_workflow(args) else "origin"
blender_url = make_utils.git_get_remote_url(args.git_command, origin_name)
external_url = resolve_external_url(blender_url, repo_name)
# When running `make update` from a freshly cloned fork check whether the fork of the submodule is
# available, If not, switch to the submodule relative to the main blender repository.
if origin_name == "origin" and not make_utils.git_is_remote_repository(args.git_command, external_url):
external_url = resolve_external_url("https://projects.blender.org/blender/blender", repo_name)
call((args.git_command, "clone", "--origin", origin_name, external_url, str(external_dir)))
def external_script_add_origin_if_needed(args: argparse.Namespace,
repo_name: str,
directory_name: str) -> None:
"""
Add remote called 'origin' if there is a fork of the external repository available
This is only done when using Github style upstream workflow in the main repository.
"""
if not use_upstream_workflow(args):
return
cwd = os.getcwd()
blender_git_root = Path(get_blender_git_root())
scripts_dir = blender_git_root / "scripts"
external_dir = scripts_dir / directory_name
origin_blender_url = make_utils.git_get_remote_url(args.git_command, "origin")
origin_external_url = resolve_external_url(origin_blender_url, repo_name)
try:
os.chdir(external_dir)
if (make_utils.git_remote_exist(args.git_command, "origin") or
not make_utils.git_remote_exist(args.git_command, "upstream")):
return
if not make_utils.git_is_remote_repository(args.git_command, origin_external_url):
return
print(f"Adding origin remote to {directory_name} pointing to fork ...")
# Non-obvious tricks to introduce the new remote called "origin" to the existing
# submodule configuration.
#
# This is all within the content of creating a fork of a submodule after `make update`
# has been run and possibly local branches tracking upstream were added.
#
# The idea here goes as following:
#
# - Rename remote "upstream" to "origin", which takes care of changing the names of
# remotes the local branches are tracking.
#
# - Change the URL to the "origin", which so was was still pointing to upstream.
#
# - Re-introduce the "upstream" remote, with the same URL as it had prior to rename.
upstream_url = make_utils.git_get_remote_url(args.git_command, "upstream")
call((args.git_command, "remote", "rename", "upstream", "origin"))
make_utils.git_set_config(args.git_command, f"remote.origin.url", origin_external_url)
call((args.git_command, "remote", "add", "upstream", upstream_url))
finally:
os.chdir(cwd)
return
def external_scripts_update(args: argparse.Namespace,
repo_name: str,
directory_name: str,
branch: Optional[str]) -> str:
"""Update a single external checkout with the given name in the scripts folder"""
external_script_initialize_if_needed(args, repo_name, directory_name)
external_script_add_origin_if_needed(args, repo_name, directory_name)
print(f"Updating scripts/{directory_name} ...")
cwd = os.getcwd()
blender_git_root = Path(get_blender_git_root())
scripts_dir = blender_git_root / "scripts"
external_dir = scripts_dir / directory_name
# Update externals to appropriate given branch, falling back to main if none is given and/or
# found in a sub-repository.
branch_fallback = "main"
if not branch: if not branch:
branch = branch_fallback branch = branch_fallback
skip_msg = "" submodules = [
("release/scripts/addons", branch, branch_fallback),
("release/scripts/addons_contrib", branch, branch_fallback),
("release/datafiles/locale", branch, branch_fallback),
("source/tools", branch, branch_fallback),
]
# Initialize submodules only if needed.
for submodule_path, submodule_branch, submodule_branch_fallback in submodules:
if not os.path.exists(os.path.join(submodule_path, ".git")):
call([args.git_command, "submodule", "update", "--init", "--recursive"])
break
# Checkout appropriate branch and pull changes.
skip_msg = ""
for submodule_path, submodule_branch, submodule_branch_fallback in submodules:
cwd = os.getcwd()
try: try:
os.chdir(external_dir) os.chdir(submodule_path)
msg = git_update_skip(args, check_remote_exists=False) msg = git_update_skip(args, check_remote_exists=False)
if msg: if msg:
skip_msg += directory_name + " skipped: " + msg + "\n" skip_msg += submodule_path + " skipped: " + msg + "\n"
else: else:
# Find a matching branch that exists. # Find a matching branch that exists.
for remote in ("origin", "upstream"): call([args.git_command, "fetch", "origin"])
if make_utils.git_remote_exist(args.git_command, remote):
call([args.git_command, "fetch", remote])
submodule_branch = branch
if make_utils.git_branch_exists(args.git_command, submodule_branch): if make_utils.git_branch_exists(args.git_command, submodule_branch):
pass pass
elif make_utils.git_branch_exists(args.git_command, branch_fallback): elif make_utils.git_branch_exists(args.git_command, submodule_branch_fallback):
submodule_branch = branch_fallback submodule_branch = submodule_branch_fallback
else: else:
# Skip. # Skip.
submodule_branch = "" submodule_branch = ""
@@ -439,69 +230,38 @@ def external_scripts_update(args: argparse.Namespace,
# Switch to branch and pull. # Switch to branch and pull.
if submodule_branch: if submodule_branch:
if make_utils.git_branch(args.git_command) != submodule_branch: if make_utils.git_branch(args.git_command) != submodule_branch:
# If the local branch exists just check out to it.
# If there is no local branch but only remote specify an explicit remote.
# Without this explicit specification Git attempts to set-up tracking
# automatically and fails when the branch is available in multiple remotes.
if make_utils.git_local_branch_exists(args.git_command, submodule_branch):
call([args.git_command, "checkout", submodule_branch]) call([args.git_command, "checkout", submodule_branch])
elif make_utils.git_remote_exist(args.git_command, "origin"): call([args.git_command, "pull", "--rebase", "origin", submodule_branch])
call([args.git_command, "checkout", "-t", f"origin/{submodule_branch}"])
elif make_utils.git_remote_exist(args.git_command, "upstream"):
call([args.git_command, "checkout", "-t", f"upstream/{submodule_branch}"])
# Don't use extra fetch since all remotes of interest have been already fetched
# some lines above.
skip_msg += work_tree_update(args, use_fetch=False)
finally: finally:
os.chdir(cwd) os.chdir(cwd)
return skip_msg return skip_msg
def scripts_submodules_update(args: argparse.Namespace, branch: Optional[str]) -> str:
"""Update working trees of addons and addons_contrib within the scripts/ directory"""
msg = ""
msg += external_scripts_update(args, "blender-addons", "addons", branch)
msg += external_scripts_update(args, "blender-addons-contrib", "addons_contrib", branch)
return msg
def submodules_update(args: argparse.Namespace, branch: Optional[str]) -> str:
"""Update submodules or other externally tracked source trees"""
msg = ""
msg += scripts_submodules_update(args, branch)
return msg
if __name__ == "__main__": if __name__ == "__main__":
args = parse_arguments() args = parse_arguments()
blender_skip_msg = "" blender_skip_msg = ""
submodules_skip_msg = "" submodules_skip_msg = ""
blender_version = make_utils. parse_blender_version() # Test if we are building a specific release version.
if blender_version.cycle != 'alpha': branch = make_utils.git_branch(args.git_command)
major = blender_version.version // 100 if branch == 'HEAD':
minor = blender_version.version % 100 sys.stderr.write('Blender git repository is in detached HEAD state, must be in a branch\n')
branch = f"blender-v{major}.{minor}-release" sys.exit(1)
release_version: Optional[str] = f"{major}.{minor}"
else: tag = make_utils.git_tag(args.git_command)
branch = 'main' release_version = make_utils.git_branch_release_version(branch, tag)
release_version = None
if not args.no_libraries: if not args.no_libraries:
svn_update(args, release_version) svn_update(args, release_version)
if not args.no_blender: if not args.no_blender:
blender_skip_msg = git_update_skip(args) blender_skip_msg = git_update_skip(args)
if not blender_skip_msg:
blender_skip_msg = blender_update(args)
if blender_skip_msg: if blender_skip_msg:
blender_skip_msg = "Blender repository skipped: " + blender_skip_msg + "\n" blender_skip_msg = "Blender repository skipped: " + blender_skip_msg + "\n"
else:
blender_update(args)
if not args.no_submodules: if not args.no_submodules:
submodules_skip_msg = submodules_update(args, branch) submodules_skip_msg = submodules_update(args, release_version, branch)
# Report any skipped repositories at the end, so it's not as easy to miss. # Report any skipped repositories at the end, so it's not as easy to miss.
skip_msg = blender_skip_msg + submodules_skip_msg skip_msg = blender_skip_msg + submodules_skip_msg

View File

@@ -9,9 +9,7 @@ import re
import shutil import shutil
import subprocess import subprocess
import sys import sys
import os
from pathlib import Path from pathlib import Path
from urllib.parse import urljoin
from typing import ( from typing import (
Sequence, Sequence,
@@ -21,7 +19,7 @@ from typing import (
def call(cmd: Sequence[str], exit_on_error: bool = True, silent: bool = False) -> int: def call(cmd: Sequence[str], exit_on_error: bool = True, silent: bool = False) -> int:
if not silent: if not silent:
print(" ".join([str(x) for x in cmd])) print(" ".join(cmd))
# Flush to ensure correct order output on Windows. # Flush to ensure correct order output on Windows.
sys.stdout.flush() sys.stdout.flush()
@@ -54,57 +52,13 @@ def check_output(cmd: Sequence[str], exit_on_error: bool = True) -> str:
return output.strip() return output.strip()
def git_local_branch_exists(git_command: str, branch: str) -> bool:
return (
call([git_command, "rev-parse", "--verify", branch], exit_on_error=False, silent=True) == 0
)
def git_branch_exists(git_command: str, branch: str) -> bool: def git_branch_exists(git_command: str, branch: str) -> bool:
return ( return (
git_local_branch_exists(git_command, branch) or call([git_command, "rev-parse", "--verify", branch], exit_on_error=False, silent=True) == 0 or
call([git_command, "rev-parse", "--verify", "remotes/upstream/" + branch], exit_on_error=False, silent=True) == 0 or
call([git_command, "rev-parse", "--verify", "remotes/origin/" + branch], exit_on_error=False, silent=True) == 0 call([git_command, "rev-parse", "--verify", "remotes/origin/" + branch], exit_on_error=False, silent=True) == 0
) )
def git_get_remote_url(git_command: str, remote_name: str) -> str:
return check_output((git_command, "ls-remote", "--get-url", remote_name))
def git_remote_exist(git_command: str, remote_name: str) -> bool:
"""Check whether there is a remote with the given name"""
# `git ls-remote --get-url upstream` will print an URL if there is such remote configured, and
# otherwise will print "upstream".
remote_url = check_output((git_command, "ls-remote", "--get-url", remote_name))
return remote_url != remote_name
def git_get_resolved_submodule_url(git_command: str, blender_url: str, submodule_path: str) -> str:
git_root = check_output([git_command, "rev-parse", "--show-toplevel"])
dot_gitmodules = os.path.join(git_root, ".gitmodules")
submodule_key_prefix = f"submodule.{submodule_path}"
submodule_key_url = f"{submodule_key_prefix}.url"
gitmodule_url = git_get_config(
git_command, submodule_key_url, file=dot_gitmodules)
# A bit of a trickery to construct final URL.
# Only works for the relative submodule URLs.
#
# Note that unless the LHS URL ends up with a slash urljoin treats the last component as a
# file.
assert gitmodule_url.startswith('..')
return urljoin(blender_url + "/", gitmodule_url)
def git_is_remote_repository(git_command: str, repo: str) -> bool:
"""Returns true if the given repository is a valid/clonable git repo"""
exit_code = call((git_command, "ls-remote", repo, "HEAD"), exit_on_error=False, silent=True)
return exit_code == 0
def git_branch(git_command: str) -> str: def git_branch(git_command: str) -> str:
# Get current branch name. # Get current branch name.
try: try:
@@ -116,20 +70,6 @@ def git_branch(git_command: str) -> str:
return branch.strip().decode('utf8') return branch.strip().decode('utf8')
def git_get_config(git_command: str, key: str, file: Optional[str] = None) -> str:
if file:
return check_output([git_command, "config", "--file", file, "--get", key])
return check_output([git_command, "config", "--get", key])
def git_set_config(git_command: str, key: str, value: str, file: Optional[str] = None) -> str:
if file:
return check_output([git_command, "config", "--file", file, key, value])
return check_output([git_command, "config", key, value])
def git_tag(git_command: str) -> Optional[str]: def git_tag(git_command: str) -> Optional[str]:
# Get current tag name. # Get current tag name.
try: try:

View File

@@ -0,0 +1,20 @@
if NOT exist "%BLENDER_DIR%\source\tools\.git" (
echo Checking out sub-modules
if not "%GIT%" == "" (
"%GIT%" submodule update --init --recursive --progress
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git checkout master
if errorlevel 1 goto FAIL
"%GIT%" submodule foreach git pull --rebase origin master
if errorlevel 1 goto FAIL
goto EOF
) else (
echo Blender submodules not found, and git not found in path to retrieve them.
goto FAIL
)
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -14,7 +14,7 @@ if NOT EXIST %PYTHON% (
exit /b 1 exit /b 1
) )
set FORMAT_PATHS=%BLENDER_DIR%\tools\utils_maintenance\clang_format_paths.py set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
REM The formatting script expects clang-format to be in the current PATH. REM The formatting script expects clang-format to be in the current PATH.
set PATH=%CF_PATH%;%PATH% set PATH=%CF_PATH%;%PATH%

View File

@@ -4,9 +4,9 @@ if "%GIT%" == "" (
) )
cd "%BLENDER_DIR%" cd "%BLENDER_DIR%"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Branch_hash=%%i for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Branch_hash=%%i
cd "%BLENDER_DIR%/locale" cd "%BLENDER_DIR%/release/datafiles/locale"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Locale_hash=%%i for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Locale_hash=%%i
cd "%BLENDER_DIR%/scripts/addons" cd "%BLENDER_DIR%/release/scripts/addons"
for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Addons_Hash=%%i for /f "delims=" %%i in ('"%GIT%" rev-parse HEAD') do echo Addons_Hash=%%i
cd "%BLENDER_DIR%" cd "%BLENDER_DIR%"
:EOF :EOF

View File

@@ -231,7 +231,7 @@ class FileBlockHeader:
self.SDNAIndex = 0 self.SDNAIndex = 0
self.Count = 0 self.Count = 0
self.FileOffset = handle.tell() self.FileOffset = handle.tell()
# self.Code += ' ' * (4 - len(self.Code)) #self.Code += ' ' * (4 - len(self.Code))
log.debug("found blend-file-block-fileheader {0} {1}".format(self.Code, self.FileOffset)) log.debug("found blend-file-block-fileheader {0} {1}".format(self.Code, self.FileOffset))
def skip(self, handle): def skip(self, handle):

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = V3.6 PROJECT_NUMBER = V3.5
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

View File

@@ -37,7 +37,7 @@ def draw_callback_px(self, context):
# BLF drawing routine # BLF drawing routine
font_id = font_info["font_id"] font_id = font_info["font_id"]
blf.position(font_id, 2, 80, 0) blf.position(font_id, 2, 80, 0)
blf.size(font_id, 50) blf.size(font_id, 50, 72)
blf.draw(font_id, "Hello World") blf.draw(font_id, "Hello World")

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

@@ -31,7 +31,7 @@ For an overview of BMesh data types and how they reference each other see:
Example Script Example Script
-------------- --------------
.. literalinclude:: __/__/__/scripts/templates_py/bmesh_simple.py .. literalinclude:: __/__/__/release/scripts/templates_py/bmesh_simple.py
Standalone Module Standalone Module

View File

@@ -288,7 +288,7 @@ In Python, this is done by defining a class, which is a subclass of an existing
Example Operator Example Operator
---------------- ----------------
.. literalinclude:: __/__/__/scripts/templates_py/operator_simple.py .. literalinclude:: __/__/__/release/scripts/templates_py/operator_simple.py
Once this script runs, ``SimpleOperator`` is registered with Blender Once this script runs, ``SimpleOperator`` is registered with Blender
and can be called from Operator Search or added to the toolbar. and can be called from Operator Search or added to the toolbar.
@@ -320,7 +320,7 @@ Example Panel
Panels are registered as a class, like an operator. Panels are registered as a class, like an operator.
Notice the extra ``bl_`` variables used to set the context they display in. Notice the extra ``bl_`` variables used to set the context they display in.
.. literalinclude:: __/__/__/scripts/templates_py/ui_panel_simple.py .. literalinclude:: __/__/__/release/scripts/templates_py/ui_panel_simple.py
To run the script: To run the script:

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

@@ -367,13 +367,13 @@ except ImportError:
# Note that ".." is replaced by "__" in the RST files, # Note that ".." is replaced by "__" in the RST files,
# to avoid having to match Blender's source tree. # to avoid having to match Blender's source tree.
EXTRA_SOURCE_FILES = ( EXTRA_SOURCE_FILES = (
"../../../scripts/templates_py/bmesh_simple.py", "../../../release/scripts/templates_py/bmesh_simple.py",
"../../../scripts/templates_py/gizmo_operator.py", "../../../release/scripts/templates_py/gizmo_operator.py",
"../../../scripts/templates_py/gizmo_operator_target.py", "../../../release/scripts/templates_py/gizmo_operator_target.py",
"../../../scripts/templates_py/gizmo_simple.py", "../../../release/scripts/templates_py/gizmo_simple.py",
"../../../scripts/templates_py/operator_simple.py", "../../../release/scripts/templates_py/operator_simple.py",
"../../../scripts/templates_py/ui_panel_simple.py", "../../../release/scripts/templates_py/ui_panel_simple.py",
"../../../scripts/templates_py/ui_previews_custom_icon.py", "../../../release/scripts/templates_py/ui_previews_custom_icon.py",
"../examples/bmesh.ops.1.py", "../examples/bmesh.ops.1.py",
"../examples/bpy.app.translations.py", "../examples/bpy.app.translations.py",
) )
@@ -476,7 +476,7 @@ MODULE_GROUPING = {
# -------------------------------BLENDER---------------------------------------- # -------------------------------BLENDER----------------------------------------
# Converting bytes to strings, due to #30154. # converting bytes to strings, due to T30154
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8') BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
BLENDER_REVISION_TIMESTAMP = bpy.app.build_commit_timestamp BLENDER_REVISION_TIMESTAMP = bpy.app.build_commit_timestamp
@@ -487,7 +487,7 @@ BLENDER_VERSION_DOTS = "%d.%d" % (bpy.app.version[0], bpy.app.version[1])
if BLENDER_REVISION != "Unknown": if BLENDER_REVISION != "Unknown":
# SHA1 Git hash # SHA1 Git hash
BLENDER_VERSION_HASH = BLENDER_REVISION BLENDER_VERSION_HASH = BLENDER_REVISION
BLENDER_VERSION_HASH_HTML_LINK = "<a href=https://projects.blender.org/blender/blender/commit/%s>%s</a>" % ( BLENDER_VERSION_HASH_HTML_LINK = "<a href=https://developer.blender.org/rB%s>%s</a>" % (
BLENDER_VERSION_HASH, BLENDER_VERSION_HASH, BLENDER_VERSION_HASH, BLENDER_VERSION_HASH,
) )
BLENDER_VERSION_DATE = time.strftime("%d/%m/%Y", time.localtime(BLENDER_REVISION_TIMESTAMP)) BLENDER_VERSION_DATE = time.strftime("%d/%m/%Y", time.localtime(BLENDER_REVISION_TIMESTAMP))
@@ -647,7 +647,7 @@ def undocumented_message(module_name, type_name, identifier):
module_name, type_name, identifier, module_name, type_name, identifier,
) )
return "Undocumented, consider `contributing <https://developer.blender.org/>`__." return "Undocumented, consider `contributing <https://developer.blender.org/T51061>`__."
def range_str(val): def range_str(val):
@@ -1816,9 +1816,9 @@ def pyrna2sphinx(basepath):
# operators # operators
def write_ops(): def write_ops():
API_BASEURL = "https://projects.blender.org/blender/blender/src/branch/main/scripts" API_BASEURL = "https://developer.blender.org/diffusion/B/browse/master/release/scripts"
API_BASEURL_ADDON = "https://projects.blender.org/blender/blender-addons" API_BASEURL_ADDON = "https://developer.blender.org/diffusion/BA"
API_BASEURL_ADDON_CONTRIB = "https://projects.blender.org/blender/blender-addons-contrib" API_BASEURL_ADDON_CONTRIB = "https://developer.blender.org/diffusion/BAC"
op_modules = {} op_modules = {}
op = None op = None
@@ -1853,6 +1853,8 @@ def pyrna2sphinx(basepath):
fw(" %s\n\n" % operator_description) fw(" %s\n\n" % operator_description)
for prop in op.args: for prop in op.args:
write_param(" ", fw, prop) write_param(" ", fw, prop)
if op.args:
fw("\n")
location = op.get_location() location = op.get_location()
if location != (None, None): if location != (None, None):
@@ -1863,12 +1865,9 @@ def pyrna2sphinx(basepath):
else: else:
url_base = API_BASEURL url_base = API_BASEURL
fw(" :File: `%s\\:%d <%s/%s#L%d>`__\n\n" % fw(" :file: `%s\\:%d <%s/%s$%d>`_\n\n" %
(location[0], location[1], url_base, location[0], location[1])) (location[0], location[1], url_base, location[0], location[1]))
if op.args:
fw("\n")
file.close() file.close()
if "bpy.ops" not in EXCLUDE_MODULES: if "bpy.ops" not in EXCLUDE_MODULES:
@@ -2099,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")
@@ -2127,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()
@@ -2201,7 +2196,7 @@ def write_rst_enum_items(basepath, key, key_no_prefix, enum_items):
Write a single page for a static enum in RST. Write a single page for a static enum in RST.
This helps avoiding very large lists being in-lined in many places which is an issue This helps avoiding very large lists being in-lined in many places which is an issue
especially with icons in ``bpy.types.UILayout``. See #87008. especially with icons in ``bpy.types.UILayout``. See T87008.
""" """
filepath = os.path.join(basepath, "%s.rst" % key_no_prefix) filepath = os.path.join(basepath, "%s.rst" % key_no_prefix)
with open(filepath, "w", encoding="utf-8") as fh: with open(filepath, "w", encoding="utf-8") as fh:

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