Add Chromium-only Blender WebEngine parity work

This commit is contained in:
mes123456
2026-08-12 04:47:48 -04:00
commit 9fd26010f6
18225 changed files with 11622124 additions and 0 deletions

28
.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# Local toolchains and caches
.emcache/
.emscripten-web
*.log
mylog.txt
# Build and generated output
/build_*/
/release/
/web/node_modules/
/web/dist/
/web/test-results/
/web/playwright-report/
/web/blob-report/
/web/.vite/
# Downloaded source archives and duplicate upstream checkout
/blender/
/blender-*.tar.xz
/blender-*.tar.xz.*sum
/blender-with-libraries-*.tar.xz
/blender-with-libraries-*.tar.xz.*sum
# Editor and operating-system files
.DS_Store
.idea/
.vscode/
*.swp

34
README.md Normal file
View File

@@ -0,0 +1,34 @@
# Blender Web WASM
Blender 5.2-based Web editor runtime with a React/Three.js frontend, a native
Blender Main compiled to WebAssembly, versioned browser protocols, OPFS/IndexedDB
storage, and desktop/WASM round-trip tests.
The current browser baseline is Chromium only. The release browser suite covers
both the main-thread WebGL renderer and the OffscreenCanvas Worker renderer.
Firefox and WebKit are intentionally outside the current test and release scope.
## Layout
- `blender-5.2.0/`: corresponding Blender source with the WebEngine integration.
- `web/`: frontend, Worker clients, protocols, Playwright tests, and local runtime assets.
- `tools/web/`: fixture, golden, build, and offline-release tooling.
- `tests/`: `.blend` fixtures and semantic golden data.
- `docs/status/`: machine-readable and task-specific parity ledger.
## Verification
```bash
source tools/web/emscripten-env.sh
cmake --build build_web_blender6 --target web_engine -- -j8
bash tools/web/install-web-engine-assets.sh
npm --prefix web ci
npm --prefix web run typecheck
npm --prefix web run lint
npm --prefix web run build
npm --prefix web run test:browser
```
See `docs/PROJECT_STATUS_AND_NEXT_WORK.md` and
`docs/BLENDER_5_2_WEB_FEATURE_PARITY.md` for the implemented scope and remaining
structured blockers.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,613 @@
# Blender Web 化技术路线React + Three.js + WebAssembly + OPFS/IndexedDB
> **存储决策2026-08** SQLite WASM 不是项目首期必需依赖,已从当前实现和发布资源中移除。小型元数据使用 Worker 内 IndexedDB大型二进制使用 OPFS未来只有在查询/事务需求超过 IndexedDB 时,才单独评估 SQLite WASM。
## 1. 结论先行
将 Blender 的“数据模型和建模能力”搬到浏览器中是可行的;将桌面版 Blender 的全部界面、渲染后端、Python 生态和所有插件原样搬到浏览器,短期内不现实。
推荐的产品形态是:
> **React 负责应用界面Three.js 负责全部浏览器端实时渲染Blender 的 C/C++ 核心以 WASM 运行OPFS 保存二进制资源IndexedDB 保存项目元数据和轻量状态。**
这不是把 Blender 的窗口系统直接“截图搬到网页”,而是复用 Blender 的文件解析、数据块、依赖图和部分编辑算法,建立一个面向 Web 的场景协议SceneIR再由 Three.js 渲染。
### 可行性分级
| 目标 | 可行性 | 建议 |
| --- | --- | --- |
| Web 端浏览/编辑网格、材质、相机、灯光、动画 | 高 | 作为 MVP |
| Blender 风格工作区、编辑器和常用交互 | 中高 | React 复刻 Workspace/Area/Region/Editor 语义和默认布局,不移植桌面窗口后端 |
| 读写 `.blend`,支持本地离线保存 | 中高 | 使用 Blender 内存读写 API + OPFS |
| Blender 常用建模操作和部分 Modifier | 中 | 按操作逐项移植/暴露Decimate 必须复用 Blender WASM 求值 |
| Blender 三角面简化、属性保护和多级 LOD | 中高 | 以 Decimate 三模式、三角形 ratio、误差预算和原始/求值 mesh 分离为验收基准 |
| Blender 对象父子、骨骼层级、蒙皮和关节姿态 | 中高 | 保留 Object、EditBone、Bone、PoseBone、Armature modifier 和约束语义 |
| Blender 节点材质完全一致 | 中低 | 先支持 Principled BSDF 子集 |
| Eevee/Cycles 与桌面版像素级一致 | 低 | 浏览器端固定使用 Three.js服务端 Blender 渲染作为可选补充 |
| 完整 Blender 桌面 UI 后端、原生窗口、多屏和全部编辑器 | 低 | 用户可见 UI 尽量对标C++ WindowManager/GHOST 和桌面插件体系不作为首期目标 |
## 2. 目标和非目标
### 首期目标
1. 浏览器中创建、打开、修改和导出一个 3D 项目。
2. 支持 `.blend` 导入,内部使用统一的 SceneIRThree.js 实时显示。
3. 支持基础对象操作:选择、移动、旋转、缩放、复制、删除、集合管理。
4. 支持基础网格编辑:顶点/边/面数据读取、局部修改、法线重算、三角化、基础变换。
5. 支持基础材质、贴图、灯光、相机和关键帧动画。
6. 通过 OPFS 自动保存,刷新页面后恢复项目;支持导出 `.blend``.glb` 和贴图包。
7. 在没有网络的情况下继续工作,网络只用于首次加载和可选的协作/同步功能。
8. 三角面简化由 Blender WASM 的 Decimate/BMesh 求值,支持 Collapse、Un-Subdivide、Planar/Dissolve、属性保护和多级 LODThree.js 只选择和渲染 LOD。
9. 层级和关节定义对齐 Blender对象父子、Rest 骨架、PoseBone、Armature modifier、顶点组权重、逆绑定矩阵和基础约束均进入版本化 SceneIR。
10. 提供 Blender 风格默认工作区Topbar/Workspace tabs、3D Viewport、Outliner、Properties、Timeline、Editor Header、Toolbar、Sidebar、Status Bar、Operator Search 和模式/快捷键上下文。
### 首期明确不做
- 不编译 Blender 的 C++ WindowManager、GHOST、多窗口和原生桌面主题系统但 React 必须提供等价的 Workspace/Area/Region/Editor 用户界面语义。
- 不在浏览器内运行任意 `.blend` 携带的 Python 脚本。
- 不把完整 `.blend` 文件拆成大量数据库行作为唯一真相。
- 不承诺 Cycles、OSL、Embree、OpenVDB、FFmpeg 等桌面依赖在浏览器中等价可用。
## 3. 总体架构
```text
┌─────────────────────────────────────────────────────────────────┐
│ Browser │
│ │
│ React Application (main thread) │
│ ├─ Blender-style Topbar / Workspace tabs / menus │
│ ├─ Area layout / Region frame / Editor Header │
│ ├─ 3D Viewport / Outliner / Properties / Timeline │
│ ├─ Toolbar / Sidebar / Operator Search / settings │
│ └─ Viewport input proxy │
│ │ versioned commands/events │
│ ▼ │
│ EngineWorker │
│ ├─ Blender WASM core │
│ │ ├─ BLO/BKE/BMesh/Depsgraph subset │
│ │ ├─ SceneIR exporter/importer │
│ │ └─ memory-based .blend reader/writer │
│ ├─ mesh/material/animation operations │
│ └─ optional Python-disabled runtime │
│ │
│ Three.js Viewport │
│ ├─ WebGLRenderer (WebGL2) │
│ ├─ BufferGeometry / InstancedMesh / materials │
│ ├─ selection, raycast, gizmos, camera controls │
│ └─ optional OffscreenCanvas renderer worker │
│ │
│ StorageWorker │
│ ├─ IndexedDB metadata store │
│ ├─ OPFS file handles │
│ └─ project metadata / snapshots / operation summaries │
│ │
│ OPFS │
│ ├─ projects/<id>/scene.blend │
│ ├─ projects/<id>/assets/<sha256> │
│ ├─ projects/<id>/snapshots/<revision>.blend │
│ └─ projects/<id>/thumbs/*.webp │
└─────────────────────────────────────────────────────────────────┘
```
### 关键原则
- **Blender WASM 是场景操作引擎,不是 React 组件。** React 不应直接读写 WASM 堆,也不应持有完整几何数据副本。
- **Three.js 是浏览器端唯一渲染器。** 先把 Blender 数据转换为 Three.js 对象;不要在浏览器中调用 Blender 的 Eevee/Cycles也不要一开始移植 Blender GPU 后端。
- **EngineWorker 和 StorageWorker 分离。** IndexedDB 请求、OPFS 锁和大文件 I/O 不阻塞 React。
- **所有跨边界调用都有版本号和 revision。** 防止异步命令返回乱序后覆盖新状态。
- **`.blend` 是兼容性主文件IndexedDB 是应用元数据索引。** 它保存项目元数据、快照索引和轻量操作摘要,不替代 Blender 的 DNA 数据结构。
- **React UI 对标 Blender 的用户可见语义。** 采用 Window/Screen/Workspace/Area/Region/Editor 的等价 `WorkspaceIR`,保留编辑器类型、上下文、区域尺寸、活动区域和布局持久化;不把页面做成不可拆分的自定义 Dashboard。
- **三角面简化是 Blender 语义的强制 P0/P1 能力。** 简化参数、三角形计数、属性边界和 modifier stack 必须由 Blender WASM 求值Three.js 不提供第二套权威简化算法。
- **层级和关节是数据契约而不是显示效果。** Object parent、EditBone、Bone、PoseBone、Armature modifier、权重和约束必须分别建模稳定 ID 不能只依赖名称或数组下标。
## 4. Blender WASM 的实现边界
### 4.1 推荐的核心裁剪
Blender 5.2 源码已经把文件加载、BMesh、依赖图、几何节点、GPU 抽象和编辑器拆成相对清晰的模块。首期建议按下表裁剪:
| 保留 | 首期状态 |
| --- | --- |
| `blenloader` (`BLO_*`) | 必须保留,用于 `.blend` 内存读写 |
| `blenkernel` (`BKE_*`) | 保留场景、对象、材质、动画等数据块 |
| `bmesh` | 保留基础网格操作 |
| `depsgraph` | 保留对象依赖和变换求值,先关闭复杂模拟 |
| `makesdna/makesrna` | 保留数据结构和属性访问 |
| 部分 `modifiers` | 按需打开,逐个做 WASM 回归测试 |
| `draw/gpu` | 首期不编译 Blender 视口渲染路径 |
| `editors/windowmanager` | 首期不编译桌面 UI |
| `intern/ghost` | 首期不移植Three.js 处理窗口和输入 |
| Python、OSL、Embree、CUDA/OptiX、OpenVDB | 首期关闭或改为服务端能力 |
源码中已有 `BLO_read_from_memory()`,适合从 JavaScript 传入 `ArrayBuffer` 后加载 `.blend`;写回时可以使用 Blender 的内存写入流程,或增加一个导出内存缓冲区的 C API。相关接口见
- `blender-5.2.0/source/blender/blenloader/BLO_readfile.hh`
- `blender-5.2.0/source/blender/blenloader/BLO_writefile.hh`
- `blender-5.2.0/source/blender/blenkernel/BKE_blendfile.hh`
### 4.2 稳定的 C ABI
不要把 C++ 类、STL 容器或 Embind 类型直接暴露给 React。建议增加 `source/blender/web_api/`,只导出 C ABI
```cpp
extern "C" {
WebEngine *web_engine_create(const WebEngineConfig *config);
int web_engine_open_blend(WebEngine *, const uint8_t *data, size_t size);
int web_engine_apply_command(WebEngine *, const uint8_t *data, size_t size);
int web_engine_get_scene_delta(WebEngine *, uint64_t since_revision,
uint8_t **data, size_t *size);
int web_engine_save_blend(WebEngine *, uint8_t **data, size_t *size);
void web_engine_free_buffer(uint8_t *data, size_t size);
void web_engine_destroy(WebEngine *);
}
```
建议协议分两层:
- 低频命令使用版本化 JSON/CBOR例如 `object.transform`, `mesh.extrude`
- 顶点、索引、权重、贴图使用 `ArrayBuffer`/TypedArray禁止 JSON 编码大数组。
每个命令包含 `requestId``expectedRevision``operation``payload`。引擎返回新 revision、受影响对象 ID、场景增量和错误报告。
### 4.3 SceneIR 场景中间表示
SceneIR 是 Blender 和 Three.js 的解耦层。建议第一版定义为:
```ts
type SceneIR = {
version: 1;
revision: number;
coordinateSystem: "blender-z-up";
units: { scale: number; length: "meter" | "centimeter" | "unknown" };
nodes: NodeIR[];
meshes: MeshIR[];
materials: MaterialIR[];
images: ImageIR[];
cameras: CameraIR[];
lights: LightIR[];
animations: AnimationIR[];
};
```
`MeshIR` 至少包含 position、normal、tangent、uv、color、index、material slot 和 object-local bounds`NodeIR` 使用稳定 UUID而不是数组下标。Blender 的 Z-up 和 Three.js 的 Y-up 必须在适配层一次性转换,不能在各个组件中分别修正。
SceneIR 采用“完整快照 + 增量更新”:打开文件返回完整快照,变换对象只返回节点变换,编辑网格只返回受影响的 buffer range 或新 mesh ID。这样 React 和 Three.js 不需要每次操作都重建整个场景。
## 5. Three.js 视口实现
### 5.1 首期渲染路径
首期使用 Three.js `WebGLRenderer`,目标是 WebGL2。Three.js 当前的 `WebGLRenderer` 已以 WebGL2 为基础,适合把 Blender 的网格、贴图、灯光和基础 PBR 材质转换到浏览器中。浏览器端的所有实时帧、选择高亮、阴影、后处理和动画显示均由 Three.js 完成Blender WASM 不创建浏览器 GPU 上下文。
```ts
const renderer = new THREE.WebGLRenderer({
canvas,
antialias: true,
powerPreference: "high-performance",
});
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
```
### 5.2 SceneIR 到 Three.js
适配器职责:
1. `MeshIR` -> `BufferGeometry`,按属性是否存在动态设置 attribute。
2. index 使用 `Uint16Array``Uint32Array`,超过 16 位时检测 WebGL2 能力。
3. 重复对象优先使用 `InstancedMesh`,避免创建大量相同 Geometry。
4. Blender 的 Principled BSDF 子集映射到 `MeshStandardMaterial`/`MeshPhysicalMaterial`
5. 图片从 OPFS 读取为 Blob/`ImageBitmap`,交给 `TextureLoader``ImageBitmapLoader`;不把大图转成 base64。
6. 相机、灯光、雾、世界颜色和曝光在一个 `RenderSettings` 适配器中统一处理。
7. Node UUID 与 `Object3D.userData.blenderId` 一一对应,选中、撤销和增量更新都通过 UUID 定位。
复杂节点材质不应静默伪造结果。建议返回 `materialWarnings`,对不支持的节点显示近似材质。若产品需要桌面版一致的最终图像,可以把 `.blend` 或规范化场景发送到服务端 Blender 渲染,但这属于独立的离线渲染路径,不改变浏览器端由 Three.js 负责实时渲染的约束。
### 5.3 交互和编辑
- 相机:`OrbitControls`,后续增加平移、缩放、第一人称模式。
- 选择:射线拾取得到 Three.js 对象,再映射到 Blender UUID。
- 操作器Three.js `TransformControls` 只产生变换命令,最终状态由 EngineWorker 确认。
- 取消/撤销:拖动过程发送预览命令,鼠标释放发送提交命令;撤销由引擎操作栈处理。
- 多选、集合、可见性、锁定、隐藏等 UI 状态必须与引擎场景状态分开管理。
- 视口只消费 `SceneDelta`;不要在 React render 中遍历几何数组。
### 5.4 大场景优化
- 几何按对象或 collection 分块加载,视口先显示包围盒或低模。
- 只在对象 revision 变化时更新 GPU buffer。
- 使用 frustum culling、LOD、实例化和合批减少 draw call。
- 导入/导出 glTF 时可启用 Draco、Meshopt、KTX2Three.js `GLTFLoader` 已有这些扩展的加载入口。
- 贴图使用 mipmap、压缩纹理和按需解码释放对象时同时调用 Geometry、Material、Texture 的 `dispose()`
- 对动画和骨骼使用 Three.js `AnimationMixer`,复杂约束先在 WASM 中求值再传输矩阵。
### 5.5 OffscreenCanvas 的使用时机
先在主线程渲染,保证交互和调试简单;场景规模达到瓶颈后再把 Three.js 渲染移到 RenderWorker。Three.js 官方提供了 OffscreenCanvas + Worker 的模式,但 Worker 不能访问 DOM鼠标和键盘必须通过事件代理转发因此要把输入代理设计成独立模块不要让 `OrbitControls` 直接依赖 DOM。
推荐模式:
```text
React/main thread
canvas DOM + pointer/keyboard events
│ transferable OffscreenCanvas + input messages
RenderWorker
Three.js renderer + SceneIR cache
```
Blender EngineWorker 可以和 RenderWorker 合并,也可以分开。首个可交付版本建议合并为一个 Worker减少跨 Worker 的 buffer 复制;当建模操作和渲染互相阻塞时再拆开。
## 6. OPFS 和 IndexedDB 存储设计
### 6.1 存储职责
| 数据 | 存储位置 | 原因 |
| --- | --- | --- |
| 当前 `.blend` | OPFS 文件 | 保留 Blender 原生兼容性,适合大二进制 |
| 自动保存快照 | OPFS 文件 | 避免把大文件塞进 SQL BLOB |
| 贴图、HDR、缓存 | OPFS 文件,按 SHA-256 命名 | 去重和按需加载 |
| 项目列表、路径、版本、校验和 | IndexedDB | 浏览器原生、无需额外 WASM 依赖 |
| 操作日志和撤销元数据 | IndexedDB object store | 轻量命令摘要可恢复;大 payload 另存 OPFS |
| 缩略图索引 | IndexedDB图像本体在 OPFS | 快速显示项目列表 |
### 6.2 IndexedDB StorageWorker
IndexedDB 和 OPFS 都通过 StorageWorker 访问。OPFS 只用于大文件和快照IndexedDB 只保存可序列化的小对象;这避免把 Blender 数据块拆成数据库行,也避免首期引入额外数据库 WASM。
StorageWorker 对请求排队,并在升级事件中创建版本化 object store
```ts
// storage.worker.ts, 示意
const request = indexedDB.open("blender-web-metadata", 1);
request.onupgradeneeded = () => {
request.result.createObjectStore("project", { keyPath: "id" });
};
```
部署到多标签页时,增加 BroadcastChannel 锁和 project revision 检查IndexedDB 事务不替代产品层面的冲突策略。
### 6.3 推荐表结构
```sql
const project = {
id: "project-1",
name: "Untitled",
currentRevision: 0,
blendPath: "projects/project-1/scene.blend",
updatedAt: Date.now(),
};
await put("project", project);
```
不要把每个顶点作为一条记录。对于编辑操作,记录可重放的命令摘要和必要的二进制差异;每 20~100 个命令或达到大小阈值后生成一个新的 `.blend` 快照,再清理旧日志。
### 6.4 文件导入、保存和恢复
1. `<input type=file>` 得到 `File`,使用 `arrayBuffer()` 传入 EngineWorker。
2. 引擎调用 `BLO_read_from_memory()`,建立 Blender 数据块和 SceneIR。
3. SceneIR 首屏增量传给 Three.js贴图通过 asset hash 延迟加载。
4. 保存时引擎生成内存 `.blend` bufferStorageWorker 写入临时 OPFS 文件。
5. 写完并校验 SHA-256 后IndexedDB 在一个事务中更新 `currentRevision``snapshot` 元数据。
6. 写入采用 `scene.blend.tmp` -> `scene.blend` 的替换策略,页面崩溃时根据 manifest 恢复最近一个完整文件。
7. 用户显式导出时,从 OPFS 读取文件并创建 Blob 下载;浏览器没有“写任意本地路径”的权限,不能模拟桌面 Save As。
## 7. React 前端设计
### 7.1 状态分层
```text
UI state tab、面板开关、当前工具、快捷键状态
View state 相机、选择高亮、显示模式、临时拖动状态
Engine state 节点、网格、材质、动画、revision以 WASM 为准)
Persistence 保存状态、OPFS quota、快照、同步错误
Workspace 当前 Workspace、Area/Region 布局、Editor 类型、Context、活动区域
```
React store 只存可序列化的轻量对象摘要,例如 `ObjectSummary``MaterialSummary``SceneStats`。大型顶点数组和纹理永远留在 Worker、GPU 或 OPFS 中。复杂 UI 可以使用 reducer/context 或 Zustand/Redux但引擎命令必须通过同一个 `EngineClient` 发出。
### 7.2 组件建议
- `AppShell`:项目、保存、导出、设置。
- `ViewportPanel`Three.js canvas、选择和工具状态。
- `OutlinerPanel`:对象树、集合、可见性和锁定。
- `InspectorPanel`:变换、材质、对象属性。
- `TimelinePanel`:帧范围、播放、关键帧。
- `AssetPanel`OPFS 资源、缩略图、导入。
- `StatusBar`WASM 内存、GPU draw calls、保存状态和错误。
- `Topbar`文件菜单、Workspace tabs、场景/视图层、全局搜索。
- `AreaFrame`:可拆分/合并的 Blender Area 容器,负责 Header、Editor 和 Region 生命周期。
- `EditorHeader`:编辑器类型选择、模式、视图、覆盖层和操作菜单。
- `Toolbar` / `Sidebar`:工具、属性面板和 N-panel 的 Blender 风格容器。
- `OperatorSearch` / `KeymapManager`F3 操作搜索、按 Area/Editor/Mode 分发快捷键。
所有面板通过命令调用引擎,不要在组件内直接调用 C API。
### 7.3 Blender 界面对标原则
Blender 的 UI 不是一组固定面板,而是“工作区 + 区域 + 编辑器 + 区域子区”的可组合布局。Web 版采用同样的用户模型:
| Blender 概念 | Web 等价物 | 必须保留的行为 |
| --- | --- | --- |
| Window/Screen | Browser project window / `ScreenIR` | 项目级 UI 状态、布局版本、当前窗口上下文 |
| Workspace | `WorkspaceIR` + 顶部 tab | Layout/Modeling/Sculpting/Animation 等工作区切换、复制、重命名、持久化 |
| Area | `AreaFrame` | 编辑器类型、边界拖拽、split/join、最大化、上下文焦点 |
| Region | `RegionFrame` | Header、Main、Toolbar、Sidebar、Asset/Status 等区域的显示和折叠 |
| Editor/Space | `EditorHost` | 3D Viewport、Outliner、Properties、Timeline、Dope Sheet、Node Editor 等编辑器状态 |
| Context | `UIContextIR` | active object、mode、selection、active area、scene、view layer、pinned data |
| Operator/Keymap | `OperatorRegistry` + `KeymapManager` | F3 搜索、快捷键优先级、鼠标所在 Area/Editor/Mode 的上下文分发 |
实现要求:
1. 默认启动布局接近 Blender Layout顶部 Workspace tabs中央 3D Viewport右上 Outliner右侧 Properties底部 TimelineViewport 自带 Header/Toolbar/Sidebar。
2. Area 边界可以拖动调整大小;支持 split、join、最大化当前 Area、切换 Editor 类型。移动端采用可折叠抽屉,但不改变编辑器和命令语义。
3. 每个 Editor 都有独立 Header、Context 和快捷键范围。鼠标/键盘事件先由 `UIContextIR` 路由,再决定是 UI 操作、Three.js 视口预览还是 Blender WASM 命令。
4. UI 布局和用户偏好存入 IndexedDB/OPFS项目 `.blend` 中可表达的 Workspace 信息要保留Web 专属面板状态使用版本化 `WebWorkspaceState` 扩展,不能覆盖 Blender 数据块。
5. 主题、字号、DPI、图标和颜色采用 Blender 风格的密度和层级,但不复制 Blender 的版权素材;所有图标由现有图标库或项目自有资源提供。
6. 面板显示的是 Blender RNA/SceneIR 摘要,提交通过 `EngineClient`React 不直接改变对象、网格、骨骼或材质数据。
UI 对标验收不是“截图颜色相似”,而是同一操作在对应的 Editor/Mode/Context 下可完成、快捷键作用域一致、布局刷新后可恢复、命令结果与 Blender 数据一致。桌面 Blender 的 UI 组织可参考官方对 [Workspaces](https://docs.blender.org/manual/en/5.0/interface/window_system/workspaces.html)、[Areas](https://docs.blender.org/manual/en/2.82/interface/window_system/areas.html)、[Tabs & Panels](https://docs.blender.org/manual/en/5.0/interface/window_system/tabs_panels.html) 的定义。
## 8. Worker 消息协议
```ts
type EngineRequest = {
requestId: string;
projectId: string;
expectedRevision: number;
command:
| { type: "openBlend"; bytes: ArrayBuffer }
| { type: "setTransform"; objectId: string; matrix: Float32Array }
| { type: "meshEdit"; objectId: string; edit: MeshEdit }
| { type: "saveBlend" }
| { type: "exportGlb"; options: ExportOptions };
};
type EngineResponse = {
requestId: string;
ok: boolean;
revision: number;
delta?: SceneDelta;
buffer?: ArrayBuffer;
reports?: Report[];
};
```
必须处理以下情况:
- `expectedRevision` 过期时拒绝命令React 重新拉取 delta。
- Worker 发生异常时返回可显示的 report并保留最近一个 OPFS 快照。
- 大 buffer 使用 transferable list开启跨源隔离后可为高频数据使用 SharedArrayBuffer。
- 所有命令都带 schema 版本,便于以后协作同步和回放。
## 9. 编译和打包路线
### 9.1 环境
- Blender 5.2 源码作为上游基线,单独建立 `web` 分支或 patch 集合。
- Emscripten SDK + LLVM/ClangNode.js 仅用于前端构建和测试。
- CMake + Ninja使用 `emcmake`/`em++`,不要把原生 `build_blender_5.2.0` 直接改成 WASM 构建目录。
- Vite 或 Rsbuild 打包 React、Three.js、WASM glue JS 和资源 manifest。
### 9.2 需要增加的 CMake 选项
Blender 当前 CMake 主要按桌面平台选择 GHOST、OpenGL/Vulkan 和外部库,因此建议增加 Web 平台开关,而不是伪装成 Linux
```cmake
option(WITH_WEB "Build the Blender Web engine" OFF)
if(WITH_WEB)
set(WITH_GHOST_X11 OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_WAYLAND OFF CACHE BOOL "" FORCE)
set(WITH_GHOST_SDL OFF CACHE BOOL "" FORCE)
set(WITH_VULKAN_BACKEND OFF CACHE BOOL "" FORCE)
set(WITH_PYTHON OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_USD OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
add_definitions(-DWITH_WEB)
endif()
```
首期构建的是 `web_engine` 静态库或最小可执行入口,不编译桌面 Blender 的 `screen/editor/windowmanager`。后续如果确实需要原生 Blender 编辑器,再增加 `GHOST_SystemWeb``GHOST_WindowWeb` 和 WebGL context 适配层。
### 9.3 Emscripten 链接参数(示意)
以下参数需要根据最终依赖逐项验证,不能直接视为现成的 Blender CMake 配置:
```text
-O3 -flto
-sMODULARIZE=1 -sEXPORT_ES6=1
-sENVIRONMENT=web,worker
-sALLOW_MEMORY_GROWTH=1
-sINITIAL_MEMORY=536870912
-sMAXIMUM_MEMORY=4294967296
-sUSE_PTHREADS=1
-sPTHREAD_POOL_SIZE=4
-sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2
-sOFFSCREENCANVAS_SUPPORT=1
-sFILESYSTEM=1
```
说明:
- 开启 pthreads 后,生产服务器必须发送 COOP/COEP浏览器才能启用 SharedArrayBuffer不具备跨源隔离时提供单线程构建。
- `ALLOW_MEMORY_GROWTH` 方便早期验证,但要监控增长造成的暂停;正式版本应根据场景规模设置初始/上限内存。
- 启用 SIMD 时必须准备不支持 SIMD 的降级包或明确浏览器门槛。
- Emscripten 的 POSIX 文件系统是内存/虚拟文件系统,不等于 OPFS主文件仍通过显式 memory buffer 与 OPFS 交换。
### 9.4 前端资源拆分
建议拆成:
```text
app.js React shell + Three.js
engine.wasm/js Blender core + C ABI
engine-manifest.json 版本、能力和资源哈希
startup-assets/* 默认材质、图标、HDR 缩略资源
```
WASM 文件随发布包放在同源的版本化静态目录,版本号和 SHA-256 写入
manifest浏览器运行时禁止从 CDN、远程 ESM 或第三方脚本地址加载。不要把
`.blend`、字体、HDR 和所有材质预置无条件打进 WASM它们应作为发布包内的
可缓存资源或按需写入 OPFS 文件。
## 10. 分阶段实施计划
### Phase 0Web 视口和存储 Spike2~4 周)
- React + Three.js + Vite 工程。
- 直接加载一个 glTF/GLB完成相机、选择、变换和导出。
- StorageWorker + IndexedDB 元数据 + OPFS 文件表。
- 做浏览器能力探测WebGL2、OffscreenCanvas、SharedArrayBuffer、OPFS、存储配额。
- 交付:可以离线打开、编辑和保存一个 Three.js 项目。
### Phase 1Blender WASM 解析闭环4~8 周)
- 建立 Blender Web patch 和最小 CMake target。
- 关闭 Python、Cycles、桌面 GHOST 和不可移植外部依赖。
- 暴露 `open_blend``get_scene_snapshot``save_blend`
- 用官方/测试 `.blend` 覆盖 mesh、object、material、camera、light、animation。
- 交付:`.blend` -> WASM -> SceneIR -> Three.js编辑后可重新保存 `.blend`
### Phase 2基础建模和增量同步6~12 周)
- BMesh 基础命令:添加 primitive、extrude、inset、bevel、merge、delete、normals。
- 引擎 revision、SceneDelta、操作日志和撤销/重做。
- 网格按对象/属性增量更新,不重建整个场景。
- 交付:可完成简单建模任务,并在刷新页面后恢复。
### Phase 3生产可用子集3~6 个月)
- Modifier 子集、骨骼和关键帧、集合/链接、材质节点子集。
- glTF/GLB、OBJ、STL、PLY 导入导出Draco/Meshopt/KTX2。
- 大场景 LOD、实例化、Worker 渲染、崩溃恢复和配额管理。
- 可选:把渲染/模拟重任务下沉到服务器 Blender。
### Phase 4高级能力长期
- 自定义 Blender GHOST Web 后端。
- Three.js WebGPU renderer、后处理和材质节点适配不把 Blender GPU backend 纳入主路线。
- 沙箱化 Python 子集或服务器执行,不在默认浏览器上下文执行任意脚本。
- 多人协作、CRDT/操作日志同步和服务端渲染。
## 11. 主要风险和规避策略
| 风险 | 影响 | 规避 |
| --- | --- | --- |
| Blender C++ 依赖链很大 | WASM 构建失败、包过大 | 先做 `web_engine`,按模块启用;不要追求全量构建 |
| `.blend` 数据块直接暴露复杂 | ABI 不稳定 | SceneIR + 版本化 C ABI只暴露稳定命令 |
| 三角网格和贴图占用内存 | 标签页崩溃 | 流式加载、分块、压缩、LOD、及时 dispose |
| WebGL 与 Blender shader 不一致 | 材质效果偏差 | 先支持 PBR 子集;复杂材质交给服务端或离线烘焙 |
| OPFS 只在 Worker 可用 | 主线程调用失败 | 单独 StorageWorker所有数据库访问排队 |
| pthreads 需要 COOP/COEP | 部署后线程失效 | 提供单线程包;服务器配置跨源隔离和资源 CORP |
| 多标签页同时写项目 | 数据覆盖/锁冲突 | 单写者、BroadcastChannel 锁、revision 检查、临时文件替换 |
| 任意 Python/插件执行 | 安全风险和不可移植 | 默认关闭;服务器沙箱执行或白名单 API |
| 浏览器存储配额不足 | 保存失败 | `navigator.storage.estimate()`、持久化请求、导出备份、清理策略 |
| Three.js 与 Blender 坐标/色彩差异 | 视觉和动画错误 | SceneIR 适配层统一处理,并建立 golden scene 回归测试 |
## 12. 验收标准
以 Chromium、Firefox、Safari 最近稳定版各一台桌面设备作为参考环境,至少验证:
1. 空白项目、基础 `.blend` 和含贴图项目可以打开、编辑、保存、刷新恢复。
2. 保存失败、页面刷新、Worker 异常后不会破坏上一个完整快照。
3. 100,000 三角形场景中的选择和变换不会重建无关对象。
4. 变换、网格编辑、材质修改具有可重放的 operation log撤销/重做结果一致。
5. `.blend` 读写后通过 Blender 桌面版重新打开,关键对象、材质、动画数据没有丢失。
6. Three.js 视口在 WebGL2 不可用时给出明确的能力提示;未启用跨源隔离时自动降级单线程。
7. IndexedDB schema migration、OPFS quota error、损坏快照和多标签页冲突都有自动化测试。
8. 对同一组 golden `.blend` 生成 SceneIR 和截图,作为跨浏览器回归基线。
## 13. 推荐的第一批代码目录
```text
web/
app/ React + Vite
components/ Outliner/Inspector/Timeline/Viewport
engine-client/ TypeScript EngineClient + protocol types
workers/
engine.worker.ts
storage.worker.ts
render.worker.ts # Phase 3 再启用
three-adapter/ SceneIR -> Three.js
storage/ OPFS files + IndexedDB schema/migrations
protocol/ versioned commands/events
blender-5.2.0/
source/blender/web_api/
build_files/cmake/platform/web.cmake
intern/ghost/web/ # Phase 4
```
## 14. 最终建议
先实现“Web 端 Blender 数据编辑器”,不要以“浏览器里完整复刻桌面 Blender”作为第一里程碑。具体决策如下
1. **Three.js WebGL2 作为首期唯一客户端渲染路径。** WebGPU 可作为后续 Three.js renderer 增强,不阻塞 MVP浏览器端不启用 Blender Eevee/Cycles。
2. **Blender WASM 只负责 `.blend`、SceneIR 和建模命令React 负责 Blender 风格 UI。** 不移植桌面 C++ UI/GHOST/GPU 后端,但保留 Window/Screen/Workspace/Area/Region/Editor、上下文和快捷键的用户可见语义。
3. **OPFS 文件保存大对象IndexedDB 保存索引和操作摘要。** 不使用数据库行存储顶点。
4. **单线程优先交付pthreads 作为可选构建。** 生产环境需要 COOP/COEP 时再打开多线程。
5. **用 golden `.blend` 建立回归测试。** 坐标、单位、颜色管理、动画和材质映射是最容易出现隐性错误的地方。
6. **复杂最终渲染和完整 Python 采用“浏览器轻量编辑 + Blender 服务端”混合架构。** 浏览器交互仍由 Three.js 负责,不会把客户端实时渲染切回 Blender。
## 15. 连续执行计划和功能对标
详细的连续任务、原子工作包A-01~K-04、前置依赖、交付物、验证命令、回滚规则、验收标准、P0/P1/P2 功能矩阵和首个 Sprint 见:[WEB_BLENDER_MIGRATION_EXECUTION_PLAN.md](/home/mes123456/workinf_Blender_Wasm/WEB_BLENDER_MIGRATION_EXECUTION_PLAN.md)
执行顺序固定为:
```text
基线 -> Web 壳 -> Blender WASM 最小引擎 -> SceneIR
-> OPFS/IndexedDB 持久化 -> Three.js 视口
-> 核心建模 -> 材质/动画 -> 导入导出
-> 性能/安全/发布 -> P2 高级能力
```
每个阶段都必须先形成可运行版本再进入下一阶段P2 功能不能阻塞 P0/P1 的可用编辑器。
### 15.1 三角面简化、轻量化和层级专项门槛
这两个专项不能被当作“显示优化”或“Three.js 适配细节”,而是 Blender 文件可恢复性和模型可用性的核心契约:
| 专项 | Blender 权威来源 | Web 实现要求 | 发布门槛 |
| --- | --- | --- | --- |
| 三角面简化 | `MOD_decimate.cc``bmesh_decimate_*`、Decimate RNA | Blender WASM 负责 Collapse/Un-Subdivide/Planar 求值;保留 ratio、iterations、angle、vertex group、symmetry、triangulate、delimit 和属性保护Three.js 只消费 LOD | W-079 golden 对照、误差预算、1M 三角形内存/性能基准通过 |
| 轻量化 LOD | evaluated mesh、modifier stack、导出 manifest | 原始 mesh 不变;按 mesh revision/profile hash 缓存;按屏幕空间误差选择 LOD记录三角形、顶点、材质、纹理和显存预算 | P0 可预览/导出P1 多级 LOD 和 GLB manifest 可追踪 |
| 对象层级 | `DNA_object_types.h`、depsgraph | 保留 parent、parent type、parent bone、parent inverse、local/world matrix、collection 和 keep-world 重定父级语义 | W-089/W-097 父子、矩阵、循环和负缩放回归通过 |
| 关节和蒙皮 | `DNA_armature_types.h`、Armature modifier、PoseBone | 分离 EditBone、Bone、PoseBone保留 rest/pose 矩阵、约束、顶点组权重、逆绑定和 joint remap | W-098/W-099 骨架编辑、姿态、蒙皮、LOD 和 GLB 往返通过 |
详细执行顺序、SceneIR 字段、任务依赖和测试样例见 [WEB_BLENDER_MIGRATION_EXECUTION_PLAN.md](/home/mes123456/workinf_Blender_Wasm/WEB_BLENDER_MIGRATION_EXECUTION_PLAN.md) 的 W-073~W-099。
### 15.2 Blender 界面对标门槛
| UI 能力 | 首期范围 | 验收方式 |
| --- | --- | --- |
| Workspace/Area/Region/Editor | P0 | 默认 Layout、Layout/Modeling/Animation 切换、Area resize/split/join/maximize、Editor 切换和布局恢复 |
| Header/Toolbar/Sidebar/Properties/Outliner/Timeline | P0 | 面板上下文、折叠、选中同步、模式显示和操作结果与 Blender 数据一致 |
| Context 和快捷键 | P0/P1 | 鼠标所在 Area -> Editor -> Mode -> 全局的路由顺序正确Tab、模式切换、视图快捷键和面板快捷键互不抢占 |
| Operator Search 和菜单 | P0/P1 | F3 能按当前 Context 过滤操作;命令通过 `EngineClient` 提交并产生可撤销 revision |
| UI 持久化和响应式布局 | P0 | IndexedDB/OPFS 保存 WorkspaceIR 和 WebWorkspaceState桌面分栏与移动端抽屉共享同一协议 |
| UI golden 和可访问性 | P1 | Playwright 截图、键盘操作、焦点、缩放、窄屏和错误状态均有回归;颜色相似不能代替行为验收 |
详细任务为 W-018/W-019视口交互和操作注册分别由 W-050~W-058、W-069~W-070 接续完成。
## 16. 参考资料
- [Emscripten pthreads](https://emscripten.org/docs/porting/pthreads.html)
- [Emscripten File System API / WasmFS](https://emscripten.org/docs/api_reference/Filesystem-API.html)
- [Emscripten WebGL support](https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html)
- [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
- [Origin Private File System](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system)
- [Three.js WebGLRenderer](https://threejs.org/docs/pages/WebGLRenderer.html)
- [Three.js GLTFLoader](https://threejs.org/docs/pages/GLTFLoader.html)
- [Three.js OffscreenCanvas](https://threejs.org/manual/en/offscreencanvas.html)
- [React state management](https://react.dev/learn/managing-state)
- [Blender Decimate Modifier](https://docs.blender.org/manual/en/5.0/modeling/modifiers/generate/decimate.html)
- [Blender Armature Structure](https://docs.blender.org/manual/en/5.0/animation/armatures/structure.html)
- [Blender Armature Skinning Introduction](https://docs.blender.org/manual/en/3.2/animation/armatures/skinning/introduction.html)
- [Blender Workspaces](https://docs.blender.org/manual/en/5.0/interface/window_system/workspaces.html)
- [Blender Areas](https://docs.blender.org/manual/en/2.82/interface/window_system/areas.html)
- [Blender Tabs and Panels](https://docs.blender.org/manual/en/5.0/interface/window_system/tabs_panels.html)
- [Blender Outliner](https://docs.blender.org/manual/en/5.0/editors/outliner/introduction.html)

276
blender-5.2.0/.clang-format Normal file
View File

@@ -0,0 +1,276 @@
# Configuration of clang-format
# =============================
#
# Tested to work with versions: 8 to 11.
# This causes parameters on continuations to align to the opening brace.
#
# like_this_long_name(parameter_one,
# parameter_two,
# parameter_three);
#
AlignAfterOpenBracket: 'Align'
# Disallow short functions on one line; break them up.
AllowShortBlocksOnASingleLine: false
# These two settings trigger stacking of parameters in most cases; this is
# easier to read and also makes diffs easier to read (since an added or removed
# parameter is obvious). For example, function calls will look like this:
#
# like_this_long_name(parameter_one,
# parameter_two,
# parameter_three,
# parameter_four,
# parameter_five,
# parameter_six);
#
# Instead of:
#
# like_this_long_name(parameter_one, parameter_two, parameter_three, parameter_four,
# parameter_five, parameter_six);
#
BinPackArguments: false
BinPackParameters: false
# Line width (don't exceed 100).
ColumnLimit: 99
# Cause initializer lists to have one member initialized per line, in the case
# that all initializers can't fit on a single line.
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Indent the : after a constructor. For example:
#
# explicit foo_class ()
# : member1_(5)
# {
# }
#
ConstructorInitializerIndentWidth: 4
# Make access modifier slightly more visible.
AccessModifierOffset: -1
# This will unfortunately use spaces in some cases where it's not desired (like
# function calls) but the overall result is better since it will allow
# alignment to work properly with different tab width settings.
ContinuationIndentWidth: 4
# This tries to match Blender's style as much as possible. One
BreakBeforeBraces: Custom
BraceWrapping: {
AfterClass: 'false',
AfterControlStatement: 'MultiLine',
AfterEnum : 'false',
AfterFunction : 'true',
AfterNamespace : 'false',
AfterStruct : 'false',
AfterUnion : 'false',
BeforeCatch : 'true',
BeforeElse : 'true',
IndentBraces : 'false',
AfterObjCDeclaration: 'true',
}
# For switch statements, indent the cases.
IndentCaseLabels: true
# Indent after the hash inside preprocessor directives
IndentPPDirectives: AfterHash
BreakBeforeTernaryOperators: false
SpaceAfterTemplateKeyword: false
# Handy comment at the end of each C++ name space.
FixNamespaceComments: true
# Use "if (...)" instead of "if(...)", but have function calls like foo().
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
# Use two spaces before trailing comments, for example
#
# foo = bar; // comment
#
# Note that this doesn't work for C-style comments.
SpacesBeforeTrailingComments: 2
# Reflow comments, developers must disable formatting as with code to override this.
ReflowComments: true
# Never use tabs for indentation.
# Note: TabWidth and IndentWidth must be the same, or strange things happen.
UseTab: Never
TabWidth: 2
IndentWidth: 2
# Add a big penalty on breaking after the return type of functions. For example,
#
# static void foo(...)
#
# Instead of:
#
# static void
# foo(very long content here that maybe could be stacked)
#
PenaltyReturnTypeOnItsOwnLine: 10000
# Avoid having function calls broken onto a new line:
#
# int a = foo(
# long, list, of, many, params);
#
# Instead of:
#
# int a =
# foo(long, list, of, many, params);
#
PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: Empty
SortIncludes: true
# Don't right align escaped newlines to the right because we have a wide default
AlignEscapedNewlines: DontAlign
# Always break:
#
# const char *foo =
# "multi"
# "line";
#
# Instead of:
#
# const char *foo = "multi"
# "line";
#
AlwaysBreakBeforeMultilineStrings: true
# We don't want literal strings to break,
# however clang-format seems to ignore this (sigh).
PenaltyBreakString: 1000000
# There are macros in Blender for custom for loops; tell Clang to treat them
# like loops rather than an expression, and so put the { on the same line.
#
# To find these use multi-line regex search:
# "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
ForEachMacros:
- BEGIN_ANIMFILTER_SUBCHANNELS
- BLI_FOREACH_SPARSE_RANGE
- BLI_SMALLSTACK_ITER_BEGIN
- BMO_ITER
- BMO_ITER_INDEX
- BMW_ITER
- BM_FACES_OF_VERT_ITER_BEGIN
- BM_ITER_BPY_BM_SEQ
- BM_ITER_ELEM
- BM_ITER_ELEM_INDEX
- BM_ITER_MESH
- BM_ITER_MESH_INDEX
- BM_ITER_MESH_MUTABLE
- BM_LOOPS_OF_VERT_ITER_BEGIN
- BOOST_FOREACH
- CTX_DATA_BEGIN
- CTX_DATA_BEGIN_WITH_ID
- DEG_OBJECT_ITER_BEGIN
- DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
- DRW_ENABLED_ENGINE_ITER
- DRIVER_TARGETS_LOOPER_BEGIN
- DRIVER_TARGETS_USED_LOOPER_BEGIN
- FOREACH_BASE_IN_EDIT_MODE_BEGIN
- FOREACH_BASE_IN_MODE_BEGIN
- FOREACH_BEGIN
- FOREACH_COLLECTION_BEGIN
- FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN
- FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN
- FOREACH_EDIT_OBJECT_BEGIN
- FOREACH_MAIN_ID_BEGIN
- FOREACH_MAIN_LISTBASE_BEGIN
- FOREACH_MAIN_LISTBASE_ID_BEGIN
- FOREACH_MESH_BUFFER_CACHE
- FOREACH_NODETREE_BEGIN
- FOREACH_OBJECT_BEGIN
- FOREACH_OBJECT_FLAG_BEGIN
- FOREACH_OBJECT_IN_EDIT_MODE_BEGIN
- FOREACH_OBJECT_IN_MODE_BEGIN
- FOREACH_OBJECT_RENDERABLE_BEGIN
- FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN
- FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN
- FOREACH_SCENE_COLLECTION_BEGIN
- FOREACH_SCENE_OBJECT_BEGIN
- FOREACH_SELECTED_BASE_BEGIN
- FOREACH_SELECTED_BEZT_BEGIN
- FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
- FOREACH_SELECTED_OBJECT_BEGIN
- FOREACH_TRANS_DATA_CONTAINER
- FOREACH_VIEW_LAYER_TO_RENDER_BEGIN
- FOREACH_VISIBLE_BASE_BEGIN
- FOREACH_VISIBLE_OBJECT_BEGIN
- GHASH_FOREACH_BEGIN
- GHASH_ITER
- GHASH_ITER_INDEX
- GPU_SELECT_LOAD_IF_PICKSEL_LIST
- GP_EDITABLE_STROKES_BEGIN
- GP_EVALUATED_STROKES_BEGIN
- GSET_FOREACH_BEGIN
- GSET_ITER
- GSET_ITER_INDEX
- ITER_BEGIN
- ITER_PIXELS
- ITER_SLOTS
- ITER_SLOTS_BEGIN
- LOOP_EDITED_POINTS
- LOOP_KEYS
- LOOP_POINTS
- LOOP_SELECTED_KEYS
- LOOP_SELECTED_POINTS
- LOOP_TAGGED_KEYS
- LOOP_TAGGED_POINTS
- LOOP_UNSELECTED_POINTS
- LOOP_VISIBLE_KEYS
- LOOP_VISIBLE_POINTS
- LIGHT_FOREACH_BEGIN_DIRECTIONAL
- LIGHT_FOREACH_BEGIN_LOCAL
- LISTBASE_CIRCULAR_BACKWARD_BEGIN
- LISTBASE_CIRCULAR_FORWARD_BEGIN
- LISTBASE_FOREACH
- LISTBASE_FOREACH_BACKWARD
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
- NODE_SOCKET_TYPES_BEGIN
- NODE_TREE_TYPES_BEGIN
- NODE_TYPES_BEGIN
- PIXEL_LOOPER_BEGIN
- PIXEL_LOOPER_BEGIN_CHANNELS
- RENDER_PASS_ITER_BEGIN
- RNA_BEGIN
- RNA_PROP_BEGIN
- RNA_STRUCT_BEGIN
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
- SEQ_ALL_BEGIN
- SEQ_ITERATOR_FOREACH
- SURFACE_QUAD_ITER_BEGIN
- ED_screen_areas_iter
- SLOT_PROBING_BEGIN
- SET_SLOT_PROBING_BEGIN
- MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN
- WL_ARRAY_FOR_EACH
- FOREACH_SPECTRUM_CHANNEL
StatementMacros:
- PyObject_HEAD
- PyObject_VAR_HEAD
- ccl_gpu_kernel_postfix
MacroBlockBegin: "^OSL_CLOSURE_STRUCT_BEGIN$"
MacroBlockEnd: "^OSL_CLOSURE_STRUCT_END$"
# Ensure single new line at the end of source files.
InsertNewlineAtEOF: True
KeepEmptyLinesAtEOF: False

64
blender-5.2.0/.clang-tidy Normal file
View File

@@ -0,0 +1,64 @@
# The warnings below are disabled because they are too pedantic and not worth fixing.
# Some of them will be enabled as part of the Clang-Tidy task, see T78535.
# NOTE: No comments in the list below is allowed. Clang-tidy will ignore items after comments in the lists flag list.
# This is because the comment is not a valid list item and it will stop parsing flags if a list item is a comment.
Checks: >
-*,
readability-*,
-readability-uppercase-literal-suffix,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-convert-member-functions-to-static,
-readability-implicit-bool-conversion,
-readability-avoid-const-params-in-decls,
-readability-simplify-boolean-expr,
-readability-make-member-function-const,
-readability-suspicious-call-argument,
-readability-redundant-member-init,
-readability-misleading-indentation,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-enum-initial-value,
-readability-math-missing-parentheses,
-readability-avoid-nested-conditional-operator,
-readability-avoid-unconditional-preprocessor-if,
-readability-function-cognitive-complexity,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-switch-missing-default-case,
-bugprone-signed-char-misuse,
-bugprone-assignment-in-if-condition,
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-redundant-branch-condition,
-bugprone-suspicious-include,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list,
-modernize-use-designated-initializers,
objc-*
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1

View File

@@ -0,0 +1,71 @@
# C/C++
[*.{c,cc,h,hh,inl,glsl}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
# CMake & Text
[*.{cmake,txt}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
# Python
[*.py]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# Shell
[*.sh]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
# Tom's Obvious Minimal Language
[*.toml]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# reStructuredText
[*.rst]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 3
max_line_length = 120
# Makefile
[{Makefile,GNUmakefile}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120
# HTML
[*.html]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99

View File

@@ -0,0 +1,326 @@
# Definition of code owners for automatic assigment of reviewers.
#
# Blender is structured in modules, which do not always map directly to a
# specific directory or a set of files. This means that if reviewers were
# automatically assigned might not always be the ones to make the final
# decision.
#
# Developers should consider adding themselves to files and directories they
# are interested in review (or where they're often asked to do reviews).
# --------------------------------------------------
# Core module.
## Depsgraph.
source/blender/depsgraph/.* @sergey
## ID Management.
source/blender/blenkernel/BKE_lib.* @mont29
source/blender/blenkernel/intern/lib.* @mont29
source/blender/blenkernel/BKE_idtype.* @mont29
source/blender/blenkernel/intern/idtype.* @mont29
source/blender/blenkernel/BKE_main.* @mont29
source/blender/blenkernel/intern/main.* @mont29
source/blender/editors/include/ED_id_management.* @mont29
source/blender/editors/id_management.* @mont29
## UI/UX related Core components.
source/blender/blenkernel/BKE_screen.* @mont29
source/blender/blenkernel/intern/screen.* @mont29
source/blender/blenkernel/BKE_wm.* @mont29
source/blender/blenkernel/intern/wm.* @mont29
source/blender/blenkernel/BKE_workspace.* @mont29
source/blender/blenkernel/intern/workspace.* @mont29
## Scene/Collections/Objects.
source/blender/blenkernel/BKE_scene.* @mont29
source/blender/blenkernel/intern/scene.* @mont29
source/blender/blenkernel/BKE_collection.* @mont29
source/blender/blenkernel/intern/collection.* @mont29
source/blender/blenkernel/BKE_layer.* @mont29
source/blender/blenkernel/intern/layer.* @mont29
source/blender/blenkernel/BKE_object.* @mont29
source/blender/blenkernel/intern/object.* @mont29
## Blendfile & Undo.
# No proper way with go regex to exclude some `versioning` files,
# so we need to include everything else explicitely (lack of negative lookahead...).
source/blender/blenloader/intern/blend.* @mont29
source/blender/blenloader/intern/read.* @mont29
source/blender/blenloader/intern/undo.* @mont29
source/blender/blenloader/intern/write.* @mont29
source/blender/blenloader/intern/versioning_common.cc @mont29
source/blender/blenloader/intern/versioning_dna.cc @mont29
source/blender/blenloader/[^/]* @mont29
source/blender/blenloader/tests/.* @mont29
source/blender/blenloader_core/.* @mont29
source/blender/blenkernel/BKE_blendfile.* @mont29
source/blender/blenkernel/intern/blendfile.* @mont29
source/blender/blenkernel/BKE_packedfile.* @mont29
source/blender/blenkernel/intern/packedFile.* @mont29
source/blender/blenkernel/BKE_undo.* @mont29
source/blender/blenkernel/intern/undo.* @mont29
source/blender/editors/include/ED_undo.* @mont29
source/blender/editors/undo.* @mont29
## Misc core utils & components.
# NOTE: Cannot exclude `BKE_blender_version.hh` only here, hence the weird regexes.
source/blender/blenkernel/BKE_blender[^_].* @mont29
source/blender/blenkernel/BKE_blender_[^v].* @mont29
source/blender/blenkernel/intern/blender.* @mont29
source/blender/blenkernel/BKE_bpath.* @mont29
source/blender/blenkernel/intern/bpath.* @mont29
source/blender/blenkernel/BKE_idprop.* @mont29
source/blender/blenkernel/intern/idprop.* @mont29
source/blender/blenkernel/BKE_report.* @mont29
source/blender/blenkernel/intern/report.* @mont29
## DNA.
source/blender/makesdna/intern.* @mont29
source/blender/makesdna/tests.* @mont29
## RNA.
source/blender/makesrna/makesrna.* @mont29
source/blender/makesrna/rna_internal.* @mont29
## Guarded Allocator.
intern/guardedalloc.* @mont29
# --------------------------------------------------
# BPY.
source/python/[^/]+ @mont29 @ideasman42
source/python/intern/.* @mont29 @ideasman42
source/python/generic/.* @mont29 @ideasman42
# --------------------------------------------------
# BPY (Scripts).
scripts/modules/.* @ideasman42
scripts/modules/_bpy_internal/assets/remote_library.* @dr.sybren
scripts/modules/_bpy_internal/disk_file_hash_service/.* @dr.sybren
scripts/modules/_bpy_internal/http/.* @dr.sybren
tests/python/bl_disk_file_hash_service_test.py @dr.sybren
tests/python/bl_http_downloader.py @dr.sybren
# --------------------------------------------------
# Motion tracking and Libmv.
intern/libmv/.* @sergey
source/blender/blenkernel/BKE_tracking.* @sergey
source/blender/blenkernel/intern/tracking.* @sergey
# --------------------------------------------------
# Render and Cycles module.
intern/cycles/.* @sergey @brecht @weizhen @sherholz
source/blender/render/.* @sergey @brecht
# --------------------------------------------------
# Color management.
source/blender/imbuf/IMB_colormanagement.h @sergey @brecht
source/blender/imbuf/intern/colormanagement.* @sergey @brecht
source/blender/imbuf/opencolorio/.* @sergey @brecht
# --------------------------------------------------
# Grease Pencil.
source/blender/editors/grease_pencil/.* @filedescriptor
source/blender/editors/sculpt_paint/grease_pencil.* @filedescriptor
source/blender/blenkernel/BKE_grease_pencil.* @filedescriptor
source/blender/blenkernel/intern/grease_pencil.* @filedescriptor
# --------------------------------------------------
# Geometry Nodes.
source/blender/functions/.* @JacquesLucke
source/blender/nodes/NOD_geometry_nodes.* @JacquesLucke
source/blender/nodes/geometry/.* @JacquesLucke
# --------------------------------------------------
# Blenlib.
source/blender/blenlib/BLI_allocator.* @JacquesLucke
source/blender/blenlib/BLI_any.* @JacquesLucke
source/blender/blenlib/BLI_array.* @JacquesLucke
source/blender/blenlib/BLI_atomic_disjoint_set.* @JacquesLucke
source/blender/blenlib/BLI_binary_search.* @JacquesLucke
source/blender/blenlib/BLI_bit.* @JacquesLucke
source/blender/blenlib/BLI_cache_mutex.* @JacquesLucke
source/blender/blenlib/BLI_compute_context.* @JacquesLucke
source/blender/blenlib/BLI_concurrent_map.* @JacquesLucke
source/blender/blenlib/BLI_cpp_type.* @JacquesLucke
source/blender/blenlib/BLI_csv_parse.* @JacquesLucke
source/blender/blenlib/BLI_disjoint_set.* @JacquesLucke
source/blender/blenlib/BLI_dot_export.* @JacquesLucke
source/blender/blenlib/BLI_enumerable_thread_specific.* @JacquesLucke
source/blender/blenlib/BLI_fixed_width_int.* @JacquesLucke
source/blender/blenlib/BLI_function_ref.* @JacquesLucke
source/blender/blenlib/BLI_generic.* @JacquesLucke
source/blender/blenlib/BLI_hash.* @JacquesLucke
source/blender/blenlib/BLI_implicit_sharing.* @JacquesLucke
source/blender/blenlib/BLI_index_mask.* @JacquesLucke
source/blender/blenlib/BLI_index_range.* @JacquesLucke
source/blender/blenlib/BLI_linear_allocator.* @JacquesLucke
source/blender/blenlib/BLI_map.* @JacquesLucke
source/blender/blenlib/BLI_memory_cache.* @JacquesLucke
source/blender/blenlib/BLI_memory_counter.* @JacquesLucke
source/blender/blenlib/BLI_multi_value_map.* @JacquesLucke
source/blender/blenlib/BLI_mutex.* @JacquesLucke
source/blender/blenlib/BLI_offset.* @JacquesLucke
source/blender/blenlib/BLI_parameter_pack_utils.* @JacquesLucke
source/blender/blenlib/BLI_probing_strategies.* @JacquesLucke
source/blender/blenlib/BLI_random_access_iterator_mixin.* @JacquesLucke
source/blender/blenlib/BLI_resource_scope.* @JacquesLucke
source/blender/blenlib/BLI_set.* @JacquesLucke
source/blender/blenlib/BLI_span.* @JacquesLucke
source/blender/blenlib/BLI_stack.* @JacquesLucke
source/blender/blenlib/BLI_string_ref.* @JacquesLucke
source/blender/blenlib/BLI_string_search.* @JacquesLucke
source/blender/blenlib/BLI_struct_equality_utils.* @JacquesLucke
source/blender/blenlib/BLI_task.* @JacquesLucke
source/blender/blenlib/BLI_unique_sorted_indices.* @JacquesLucke
source/blender/blenlib/BLI_vector.* @JacquesLucke
source/blender/blenlib/BLI_virtual.* @JacquesLucke
source/blender/blenlib/intern/atomic_disjoint_set.* @JacquesLucke
source/blender/blenlib/intern/bit.* @JacquesLucke
source/blender/blenlib/intern/cache_mutex.* @JacquesLucke
source/blender/blenlib/intern/index_mask.* @JacquesLucke
source/blender/blenlib/intern/generic.* @JacquesLucke
source/blender/blenlib/intern/implicit_sharing.* @JacquesLucke
source/blender/blenlib/intern/memory_cache.* @JacquesLucke
source/blender/blenlib/intern/memory_counter.* @JacquesLucke
# --------------------------------------------------
# UI: Themes/Icons/Templates.
release/datafiles/userdef/.* @pablovazquez
scripts/presets/interface_theme/.* @pablovazquez
release/datafiles/icons/.* @pablovazquez
release/datafiles/icons_svg/.* @pablovazquez
release/datafiles/icons_blend/.* @pablovazquez
release/datafiles/studiolights/.* @pablovazquez
release/datafiles/cursors/.* @pablovazquez
release/freedesktop/icons/.* @pablovazquez
scripts/startup/bl_app_templates_system/.* @pablovazquez
# --------------------------------------------------
# Viewport & EEVEE Module.
extern/renderdoc/.* @Jeroen-Bakker
extern/vulkan_memory_allocator/.* @Jeroen-Bakker
intern/ghost/intern/GHOST_ContextVK.* @Jeroen-Bakker
intern/ghost/intern/GHOST_Xr.* @Jeroen-Bakker
intern/opensubdiv/internal/evaluator/gpu.* @Jeroen-Bakker
intern/opensubdiv/internal/evaluator/shaders/.* @Jeroen-Bakker
source/blender/blenkernel/intern/image_gpu.* @Jeroen-Bakker
source/blender/blenkernel/intern/image_partial_update.* @Jeroen-Bakker
source/blender/gpu/vulkan/.* @Jeroen-Bakker
source/blender/python/gpu/.* @Jeroen-Bakker
source/blender/eevee/.* @fclem
source/blender/gpu/opengl/.* @fclem
source/blender/gpu/shader_tool/.* @fclem
source/blender/gpu/shaders/.* @fclem
# --------------------------------------------------
# Editors
source/blender/editors/space_console/.* @ideasman42
source/blender/editors/space_outliner/.* @JulianEisel
source/blender/editors/space_text/.* @ideasman42
# --------------------------------------------------
# VSE.
source/blender/sequencer/.* @eliphaz
source/blender/editors/space_sequencer/.* @eliphaz
# --------------------------------------------------
# Compositor.
scripts/startup/bl_ui/node_add_menu_compositor.py @zazizizou @OmarEmaraDev
source/blender/compositor/.* @OmarEmaraDev
source/blender/nodes/composite/.* @OmarEmaraDev
source/blender/draw/engines/compositor/.* @OmarEmaraDev
source/blender/render/RE_compositor.hh @OmarEmaraDev
source/blender/render/intern/compositor.cc @OmarEmaraDev
source/blender/sequencer/intern/modifiers/MOD_compositor.cc @OmarEmaraDev
source/blender/sequencer/intern/effects/vse_effect_compositor.cc @OmarEmaraDev
# --------------------------------------------------
# Animation Player.
source/blender/windowmanager/intern/wm_playanim.cc @ideasman42
# --------------------------------------------------
# Gizmos.
source/blender/windowmanager/gizmo/.* @ideasman42
source/blender/editors/gizmo_library/.* @ideasman42
source/blender/editors/space_view3d/view3d_gizmo_.* @ideasman42
# --------------------------------------------------
# XR
source/blender/windowmanager/xr/.* @Brainzman
intern/ghost/intern/GHOST_Xr.* @Brainzman
# --------------------------------------------------
# I18N.
source/blender/blentranslation.* @mont29
# --------------------------------------------------
# Platforms & Builds
build_files/.* @ThomasDinges
release/bin/.* @ThomasDinges
release/darwin/.* @ThomasDinges
release/freedesktop/.* @ThomasDinges
release/license/.* @ThomasDinges
release/lts/.* @ThomasDinges
release/pypi/.* @ThomasDinges
release/release_notes/.* @ThomasDinges
release/text/.* @ThomasDinges
release/windows/.* @ThomasDinges
## macOS Maintenance
intern/ghost/intern/GHOST_.*Cocoa.* @Brainzman
build_files/cmake/platform/platform_apple.* @Brainzman
## macOS Objective-C code
.*\\.mm @Brainzman
## Wayland Maintenance.
intern/ghost/intern/GHOST_.*Wayland.* @ideasman42
intern/wayland_dynload/.* @ideasman42
# --------------------------------------------------
# DevOps & CI/CD
build_files/buildbot/.* @bartvdbraak
build_files/config/.* @bartvdbraak
.gitea/workflows/.* @bartvdbraak
.github/.* @bartvdbraak
# --------------------------------------------------
# glTF
scripts/addons_core/io_scene_gltf2/.* @JulienDuroure
intern/draco_bridge/.* @JulienDuroure
intern/meshoptimizer_bridge/* @JulienDuroure
# --------------------------------------------------
# Asset System
source/blender/asset_system/.* @JulianEisel
# --------------------------------------------------
# Bundled Assets
source/blender/assets/.* @zazizizou
# --------------------------------------------------
# Sculpt, Paint, Texture
source/blender/makesdna/DNA_brush_types.h @Sean-Kim
source/blender/makesdna/DNA_brush_enums.h @Sean-Kim
source/blender/makesrna/intern/rna_brush.cc @Sean-Kim
source/blender/makesrna/intern/rna_sculpt_paint.cc @Sean-Kim
source/blender/blenkernel/BKE_paint.* @Sean-Kim
source/blender/blenkernel/intern/brush.* @Sean-Kim
source/blender/blenkernel/intern/paint.* @Sean-Kim
source/blender/blenkernel/paint.* @Sean-Kim
source/blender/blenkernel/pbvh.* @Sean-Kim
source/blender/editors/sculpt_paint/paint_.* @Sean-Kim
source/blender/editors/sculpt_paint/mesh/.* @Sean-Kim
# --------------------------------------------------
# Modeling.
source/blender/bmesh/.* @ideasman42
source/blender/editors/curve/.* @ideasman42
source/blender/editors/mesh/.* @ideasman42
# --------------------------------------------------
# Documentation.
doc/.* @ideasman42 @Blendify
scripts/modules/_rna_manual_reference.py @Blendify
tools/utils_doc/.* @ideasman42 @Blendify

View File

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

View File

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

View File

@@ -0,0 +1,39 @@
name: Python API Documentation
about: File a bug report for the python API documentation
labels:
- "Type/Bug"
- "Status/Needs Triage"
- "Priority/Normal"
body:
- type: markdown
attributes:
value: |
### Instructions
Thank you for reporting an issue with Blender's Python API documentation.
If you meant to file an issue with the software please create a normal [bug report](https://projects.blender.org/blender/blender/issues/new?template=.gitea%2fissue_template%2fbug.yaml).
Please add to the description below explain the issue at hand.
Use **Report issue on this page** at the bottom of the page with an issue to autofill some information.
Including details, examples, or suggested fixes are appreated and will help resolve the issue as soon as possible.
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true
value: |
**Page Information**
Blender Version: (example: 4.0, edbf15d3c044, main)
[Permanent Link](https://docs.blender.org/api/current/) (Update me to the URL of the page with an issue)
**Short description of issue**
[Please fill out a short description of the issue here]
- 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 Python scipt** if neccesarry to reproduce the problem. You do your half of the work, then we do our half!

View File

@@ -0,0 +1,55 @@
name: Bug Report
about: Use Help > Report a Bug from the top of Blender to automatically fill out part of this form.
labels:
- "Type/Bug"
- "Status/Needs Triage"
- "Severity/Normal"
body:
- type: markdown
attributes:
value: |
### Instructions
First time reporting? See [tips](https://developer.blender.org/docs/handbook/bug_reports/making_good_bug_reports/).
* Use **Help > Report a Bug** from the top of Blender to fill system information and exact Blender version.
* If Blender isn't opening, then follow [our guide](https://developer.blender.org/docs/handbook/bug_reports/making_good_bug_reports/collect_system_information/) on how to manually collect the required information.
* 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://developer.blender.org/docs/handbook/communication/user_feedback/).
* Security vulnerabilities should be [reported privately](https://developer.blender.org/docs/handbook/bug_reports/vulnerability_reports/).
* If there are multiple bugs, make multiple bug reports.
* Any content you upload will be shared publicly. Ensure you have permission to share any files you upload, and avoid uploading age restricted content.
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true
value: |
**System Information**
Operating system:
Graphics card:
**Blender Version**
Broken: (example: 3.0.0, main, `f1cca3055776`, 2020-12-30)
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
For developers to handle reports swiftly, please provide crash logs, a clear description, exact steps, and a **simple .blend file** to reproduce the problem. You do your half of the work, then we do our half!
- type: checkboxes
id: filled_form
attributes:
label: "Confirmation"
hide_label: true
options:
- label: "I confirm that I have filled out the bug report form with all the requested information."
required: true
visible: [form]

View File

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

View File

@@ -0,0 +1,10 @@
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

@@ -0,0 +1,10 @@
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

@@ -0,0 +1,22 @@
name: Pull Request
about: Contribute code to Blender
body:
- type: markdown
attributes:
value: |
### Instructions
Guides to [contributing code](https://developer.blender.org/docs/handbook/contributing/) and effective [code review](https://developer.blender.org/docs/handbook/contributing/pull_requests/).
By submitting code here, you agree that the code is (compatible with) GNU GPL v2 or later.
By default, all contributors are added to the AUTHORS file as part of a semi-automated process.
If you do not wish to be listed there and rather transfer copyright to the Blender Foundation please mention so at the bottom of the PR.
This request only needs to be made once and applies to future PR's.
- type: textarea
id: body
attributes:
label: "Description"
hide_label: true

View File

@@ -0,0 +1,17 @@
on:
pull_request_target:
types: [opened, ready_for_review, reopened, review_requested, synchronize]
env:
COMMENTS_API_TOKEN: "${{ secrets.COMMENTS_API_TOKEN }}"
COMMENTS_URL: "${{ gitea.event.pull_request.base.repo.url}}/issues/${{ gitea.event.pull_request.number }}/comments"
CONTRIBUTOR_AGREEMENT: "${{ vars.CLA_SLUG }}"
CORPORATE_AGREEMENT_URL: "${{ vars.CORPORATE_AGREEMENT_URL }}"
USER_LOGIN: "${{ gitea.event.pull_request.user.login }}"
jobs:
clacheck:
runs-on: clacheck_runner
steps:
- shell: /clacheck
run: check

1
blender-5.2.0/.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
custom: https://fund.blender.org/

42
blender-5.2.0/.github/README.md vendored Normal file
View File

@@ -0,0 +1,42 @@
<!--
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.
-->
> [!IMPORTANT]
> Cloning from this [GitHub mirror](https://github.com/blender/blender) may cause Git LFS errors. To avoid this, use `GIT_LFS_SKIP_SMUDGE=1` when doing your initial clone.
> See [the documentation](https://developer.blender.org/docs/handbook/contributing/using_git/#github-mirror) for full instructions.
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://developer.blender.org/docs/handbook/building_blender/)
- [Code Review & Bug Tracker](https://projects.blender.org)
- [Developer Forum](https://devtalk.blender.org)
- [Developer Documentation](https://developer.blender.org/docs/)
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

@@ -0,0 +1,4 @@
This repository is only used as a mirror. Blender development happens on projects.blender.org.
To get started with contributing code, please see:
https://developer.blender.org/docs/handbook/contributing/

View File

@@ -0,0 +1 @@
https://www.blender.org/funding.json

1062
blender-5.2.0/AUTHORS Normal file

File diff suppressed because it is too large Load Diff

2658
blender-5.2.0/CMakeLists.txt Normal file

File diff suppressed because it is too large Load Diff

11
blender-5.2.0/COPYING Normal file
View File

@@ -0,0 +1,11 @@
Blender uses the GNU General Public License, which describes the rights
to distribute or change the code.
Please read this file for the full license.
doc/license/GPL-license.txt
Apart from the GNU GPL, Blender is not available under other licenses.
2010, Blender Foundation
foundation@blender.org

677
blender-5.2.0/GNUmakefile Normal file
View File

@@ -0,0 +1,677 @@
# SPDX-FileCopyrightText: 2011-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# This Makefile does an out-of-source CMake build in ../build_`OS`
# eg:
# ../build_linux_i386
# This is for users who like to configure & build blender with a single command.
define HELP_TEXT
Blender Convenience Targets
Provided for building Blender (multiple targets can be used at once).
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* release: Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly.
* developer: Enable faster builds, error checking and tests, recommended for developers.
* ninja: Use ninja build tool for faster builds.
* ccache: Use ccache for faster rebuilds.
Note: when passing in multiple targets their order is not important.
For example, for a fast build you can run 'make lite ccache ninja'.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Other Convenience Targets
Provided for other building operations.
* config: Run cmake configuration tool to set build options.
* deps: Build library dependencies (intended only for platform maintainers).
The existence of locally build dependencies overrides the pre-built dependencies from subversion.
These must be manually removed from 'lib/' to go back to using the pre-compiled libraries.
Project Files
Generate project files for development environments.
* project_qtcreator: QtCreator Project Files.
* project_eclipse: Eclipse CDT4 Project Files.
Package Targets
* package_archive: Build an archive package.
Testing Targets
Not associated with building Blender.
* test:
Run automated tests with ctest.
Static Source Code Checking
Not associated with building Blender.
* check_cppcheck:
Run blender source through cppcheck (C & C++).
To write log files into a user defined location append 'OUTPUT_DIR',
e.g. 'OUTPUT_DIR=/example/path'
* check_clang_array: Run blender source through clang array checking script (C & C++).
* check_struct_comments: Check struct member comments are correct (C & C++).
* check_size_comments: Check array size comments match defines/enums (C & C++).
* check_deprecated: Check if there is any deprecated code to remove.
* check_descriptions: Check for duplicate/invalid descriptions.
* check_licenses: Check license headers follow the SPDX license specification,
using one of the accepted licenses in 'doc/license/SPDX-license-identifiers.txt'
Append with 'SHOW_HEADERS=1' to show all unique headers
which can be useful for spotting license irregularities.
* 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_mypy: Checks all Python scripts using mypy,
see: tools/check_source/check_mypy_config.py scripts which are included.
Documentation Checking
* check_docs_file_structure:
Check the documentation for the source-tree's file structure
matches Blender's source-code.
See: https://developer.blender.org/docs/features/code_layout/
Spell Checkers
This runs the spell checker from the developer tools repository.
* check_spelling_c: Check for spelling errors (C/C++ only),
* check_spelling_py: Check for spelling errors (Python only).
* check_spelling_shaders: Check for spelling errors (GLSL,OSL & MSL only).
* check_spelling_cmake: Check for spelling errors (CMake only).
Note: an additional word-list is maintained at: 'tools/check_source/check_spelling_c_config.py'
Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files.
Example:
make check_spelling_c CHECK_SPELLING_CACHE=../spelling_cache.data
Note: additional arguments can be passed in via: 'CHECK_SPELLING_EXTRA_ARGS'.
See the output of './tools/check_source/check_spelling.py --help' for details.
Utilities
Not associated with building Blender.
* icons_geom:
Updates Geometry icons from BLEND file.
Optionally pass in variable: 'BLENDER_BIN'
otherwise default paths are used.
Example
make icons_geom BLENDER_BIN=/path/to/blender
* source_archive:
Create a compressed archive of the source code.
* source_archive_complete:
Create a compressed archive of the source code and all the libraries of dependencies.
* update:
Update blender repository and libraries.
* update_code:
Updates blender repository only, without updating libraries.
* format:
Format source code using clang-format & autopep8 (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
* license:
Create a combined file with all the license information relative to the libraries and other
code dependencies.
Environment Variables
* BUILD_CMAKE_ARGS: Arguments passed to CMake.
* BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted).
* AUTOPEP8: Command used for Python code-formatting (used for the format target).
Documentation Targets
Not associated with building Blender.
* doc_py:
Generate sphinx Python API docs.
Set the environment variable BLENDER_DOC_OFFLINE=1
to prevent download data at build time.
Set the environment variable BLENDER_DOC_SPHINX=0
to only generate RST files (skip the sphinx HTML build).
* python_stubs:
Generate Python API stubs (.pyi) from RST documentation.
* doc_doxy:
Generate doxygen C/C++ docs.
* doc_dna:
Generate blender file format reference.
* doc_man:
Generate manpage.
Information
* help: This help message.
* help_features: Show a list of optional features when building.
endef
# HELP_TEXT (end)
# This makefile is not meant for Windows,
# Note that a TAB indent prevents the message from showing, no indentation is intended.
ifeq ($(OS),Windows_NT)
$(error On Windows, use "cmd //c make.bat" instead of "make")
endif
# System Vars
OS:=$(shell uname -s)
OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
CPU:=$(shell uname -m)
# Use our OS and CPU architecture naming conventions.
ifeq ($(CPU),x86_64)
CPU:=x64
endif
ifeq ($(CPU),aarch64)
CPU:=arm64
endif
ifeq ($(OS_NCASE),darwin)
OS_LIBDIR:=macos
else
OS_LIBDIR:=$(OS_NCASE)
endif
# Source and Build DIR's
BLENDER_DIR:=$(shell pwd -P)
BUILD_TYPE:=Release
BLENDER_IS_PYTHON_MODULE:=
# CMake arguments, assigned to local variable to make it mutable.
CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS)
ifndef BUILD_DIR
BUILD_DIR:=$(shell dirname "$(BLENDER_DIR)")/build_$(OS_NCASE)
endif
# Dependencies DIR's
DEPS_SOURCE_DIR:=$(BLENDER_DIR)/build_files/build_environment
ifndef DEPS_BUILD_DIR
DEPS_BUILD_DIR:=$(BUILD_DIR)/deps_$(CPU)
endif
ifndef DEPS_INSTALL_DIR
DEPS_INSTALL_DIR:=$(BLENDER_DIR)/lib/$(OS_LIBDIR)_$(CPU)
endif
# Set the LIBDIR, an empty string when not found.
LIBDIR:=$(wildcard $(BLENDER_DIR)/lib/${OS_LIBDIR}_${CPU})
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard $(BLENDER_DIR)/lib/${OS_LIBDIR})
endif
# Find the newest Python version bundled in `LIBDIR`.
PY_LIB_VERSION:=3.15
ifeq (, $(wildcard $(LIBDIR)/python/bin/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.14
ifeq (, $(wildcard $(LIBDIR)/python/bin/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.13
ifeq (, $(wildcard $(LIBDIR)/python/bin/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.12
ifeq (, $(wildcard $(LIBDIR)/python/bin/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.11
ifeq (, $(wildcard $(LIBDIR)/python/bin/python$(PY_LIB_VERSION)))
PY_LIB_VERSION:=3.10
endif
endif
endif
endif
endif
# Allow to use alternative binary (pypy3, etc)
ifndef PYTHON
# If not overridden, first try using Python from LIBDIR.
PYTHON:=$(LIBDIR)/python/bin/python$(PY_LIB_VERSION)
ifeq (, $(wildcard $(PYTHON)))
# If not available, use system python3 or python command.
PYTHON:=python3
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
else
# Don't generate __pycache__ files in lib folder, they
# can interfere with updates.
PYTHON:=$(PYTHON) -B
endif
endif
# Use the autopep8 module in ../lib/ (which can be executed via Python directly).
# Otherwise the "autopep8" command can be used.
ifndef AUTOPEP8
ifneq (, $(LIBDIR))
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python$(PY_LIB_VERSION)/site-packages/autopep8.py)
endif
ifeq (, $(AUTOPEP8))
AUTOPEP8:=autopep8
endif
endif
# -----------------------------------------------------------------------------
# Additional targets for the build configuration
# NOTE: These targets can be combined and are applied in reverse order listed here.
# So it's important that `bpy` comes before `release` (for example)
# `make bpy release` first loads `release` configuration, then `bpy`.
# This is important as `bpy` will turn off some settings enabled by release.
ifneq "$(filter bpy, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
BLENDER_IS_PYTHON_MODULE:=1
endif
ifneq "$(filter debug, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_debug
BUILD_TYPE:=Debug
endif
ifneq "$(filter full, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_full
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter release, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_release
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_release.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter cycles, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_cycles
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_headless
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter developer, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(filter ccache, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-DWITH_COMPILER_CCACHE=YES $(CMAKE_CONFIG_ARGS)
endif
# -----------------------------------------------------------------------------
# build tool
ifneq "$(filter ninja, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=$(CMAKE_CONFIG_ARGS) -G Ninja
BUILD_COMMAND:=ninja
DEPS_BUILD_COMMAND:=ninja
else
ifneq ("$(wildcard $(BUILD_DIR)/build.ninja)","")
BUILD_COMMAND:=ninja
else
BUILD_COMMAND:=make -s
endif
ifneq ("$(wildcard $(DEPS_BUILD_DIR)/build.ninja)","")
DEPS_BUILD_COMMAND:=ninja
else
DEPS_BUILD_COMMAND:="$(BLENDER_DIR)/build_files/build_environment/linux/make_deps_wrapper.sh" -s
endif
endif
# -----------------------------------------------------------------------------
# Blender binary path
# Allow passing in own BLENDER_BIN so developers who don't
# use the default build path can still use utility helpers.
ifeq ($(OS), Darwin)
BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
else
BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin"
endif
# -----------------------------------------------------------------------------
# Get the number of cores for threaded build
ifndef NPROCS
NPROCS:=1
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), NetBSD)
NPROCS:=$(shell getconf NPROCESSORS_ONLN)
endif
ifneq (,$(filter $(OS),Darwin FreeBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif
# -----------------------------------------------------------------------------
# Macro for configuring cmake
CMAKE_CONFIG = cmake $(CMAKE_CONFIG_ARGS) \
-H"$(BLENDER_DIR)" \
-B"$(BUILD_DIR)" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE)
# -----------------------------------------------------------------------------
# Tool for 'make config'
# X11 specific.
ifdef DISPLAY
CMAKE_CONFIG_TOOL = cmake-gui
else
CMAKE_CONFIG_TOOL = ccmake
endif
# -----------------------------------------------------------------------------
# Build Blender
all: .FORCE
@echo
@echo Configuring Blender in \"$(BUILD_DIR)\" ...
# # if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
# # $(CMAKE_CONFIG); \
# # fi
# # do this always in case of failed initial build, could be smarter here...
@$(CMAKE_CONFIG)
@echo
@echo Building Blender ...
$(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install
@echo
@echo Edit build configuration with: \"$(BUILD_DIR)/CMakeCache.txt\" run make again to rebuild.
@if test -z "$(BLENDER_IS_PYTHON_MODULE)"; then \
echo Blender successfully built, run from: $(BLENDER_BIN); \
else \
echo Blender successfully built as a Python module, \"bpy\" can be imported from: $(BLENDER_BIN_DIR); \
fi
@echo
debug: all
full: all
lite: all
release: all
cycles: all
headless: all
bpy: all
developer: all
ninja: all
ccache: all
# -----------------------------------------------------------------------------
# Build dependencies
DEPS_TARGET = install
ifneq "$(filter clean, $(MAKECMDGOALS))" ""
DEPS_TARGET = clean
endif
# Set the SOURCE_DATE_EPOCH to make builds reproducible (locks timestamps to the specified date).
deps: export SOURCE_DATE_EPOCH = 1745584760
deps: .FORCE
@echo
@echo Configuring dependencies in \"$(DEPS_BUILD_DIR)\", install to \"$(DEPS_INSTALL_DIR)\"
@cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
@echo
@echo Building dependencies ...
$(DEPS_BUILD_COMMAND) -C "$(DEPS_BUILD_DIR)" -j $(NPROCS) $(DEPS_TARGET)
@echo
@echo Dependencies successfully built and installed to $(DEPS_INSTALL_DIR).
@echo
# -----------------------------------------------------------------------------
# Configuration (save some cd'ing around)
config: .FORCE
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Help for build targets
export HELP_TEXT
help: .FORCE
@echo "$$HELP_TEXT"
# -----------------------------------------------------------------------------
# Packages
#
package_archive: .FORCE
make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release"
# -----------------------------------------------------------------------------
# Tests
#
test: .FORCE
@$(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)"
benchmark: .FORCE
@$(PYTHON) ./build_files/utils/make_benchmark.py "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Project Files
#
project_qtcreator: .FORCE
$(PYTHON) tools/utils_ide/cmake_qtcreator_project.py --build-dir "$(BUILD_DIR)"
project_eclipse: .FORCE
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Static Checking
#
check_cppcheck: .FORCE
@$(CMAKE_CONFIG)
$(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/static_check_cppcheck.py" \
--build-dir=$(BUILD_DIR) \
--output-dir=$(OUTPUT_DIR)
check_struct_comments: .FORCE
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/static_check_clang.py" \
--checks=struct_comments --match=".*" --jobs=$(NPROCS)
check_size_comments: .FORCE
$(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/static_check_size_comments.py"
check_clang_array: .FORCE
@$(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/tools/check_source/static_check_clang_array.py"
check_mypy: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/tools/check_source/check_mypy.py"
check_docs_file_structure: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_docs/check_docs_code_layout.py"
check_spelling_py: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
--match=".*\.(py)$$" \
$(CHECK_SPELLING_EXTRA_ARGS) \
"$(BLENDER_DIR)/release" \
"$(BLENDER_DIR)/scripts" \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/tools" \
"$(BLENDER_DIR)/doc" \
"$(BLENDER_DIR)/build_files"
check_spelling_c: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
--match=".*\.(c|cc|cpp|cxx|h|hh|hpp|hxx|inl|m|mm)$$" \
$(CHECK_SPELLING_EXTRA_ARGS) \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost"
check_spelling_shaders: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
--match=".*\.(osl|metal|msl|glsl)$$" \
$(CHECK_SPELLING_EXTRA_ARGS) \
"$(BLENDER_DIR)/intern/" \
"$(BLENDER_DIR)/source/"
check_spelling_cmake: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \
--match=".*\.(cmake)$$" \
--match=".*\bCMakeLists\.(txt)$$" \
$(CHECK_SPELLING_EXTRA_ARGS) \
"$(BLENDER_DIR)/build_files/" \
"$(BLENDER_DIR)/intern/" \
"$(BLENDER_DIR)/source/" \
"$(BLENDER_DIR)/CMakeLists.txt" \
"$(BLENDER_DIR)/tests/CMakeLists.txt"
check_descriptions: .FORCE
@$(BLENDER_BIN) --background --factory-startup --python \
"$(BLENDER_DIR)/tools/check_source/check_descriptions.py"
check_deprecated: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
tools/check_source/check_deprecated.py
check_licenses: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/tools/check_source/check_licenses.py" \
"--show-headers=$(SHOW_HEADERS)"
check_pep8: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
tests/python/pep8.py
check_cmake: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
tools/check_source/check_cmake_consistency.py
# -----------------------------------------------------------------------------
# Utilities
#
source_archive: .FORCE
@$(PYTHON) ./build_files/utils/make_source_archive.py
source_archive_complete: .FORCE
@cmake \
-S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
@$(PYTHON) ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
# We assume that the tests will not change for minor releases so only package them for major versions
@$(PYTHON) ./build_files/utils/make_source_archive.py --package-test-data
icons_geom: .FORCE
@BLENDER_BIN=$(BLENDER_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py
update_code: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py --no-libraries
format: .FORCE
@PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) tools/utils_maintenance/clang_format_paths.py $(PATHS)
@$(PYTHON) tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS)
license: .FORCE
@$(PYTHON) tools/utils_maintenance/make_license.py
# -----------------------------------------------------------------------------
# Documentation
#
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE
@ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
$(BLENDER_BIN) \
--background --factory-startup \
--python doc/python_api/sphinx_doc_gen.py
ifneq ($(BLENDER_DOC_SPHINX), 0)
@sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
endif
python_stubs: .FORCE
@rm -rf "$(BLENDER_DIR)/doc/python_api/stubs"
@ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \
$(BLENDER_BIN) \
--background --factory-startup --quiet \
--python-exit-code 1 \
--python doc/python_api/sphinx_doc_gen.py
@$(PYTHON) doc/python_api/sphinx_stub_gen.py
doc_doxy: .FORCE
@cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE
@$(BLENDER_BIN) \
--background --factory-startup \
--python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE
@$(PYTHON) doc/manpage/blender.1.py --blender="$(BLENDER_BIN)" --output=blender.1 --verbose
help_features: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"
clean: .FORCE
@if [ -d "$(BUILD_DIR)" ] ; then \
$(BUILD_COMMAND) -C "$(BUILD_DIR)" clean ; \
fi
.PHONY: all
.FORCE:

38
blender-5.2.0/README.md Normal file
View File

@@ -0,0 +1,38 @@
<!--
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](https://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://developer.blender.org/docs/handbook/building_blender/)
- [Code Review & Bug Tracker](https://projects.blender.org)
- [Developer Forum](https://devtalk.blender.org)
- [Developer Documentation](https://developer.blender.org/docs/)
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

@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

View File

@@ -0,0 +1,71 @@
# This is an Asset Catalog Definition file for Blender.
#
# Empty lines and lines starting with `#` will be ignored.
# The first non-ignored line should be the version indicator.
# Other lines are of the format "UUID:catalog/path/for/assets:simple catalog name"
VERSION 1
753df37f-2da1-4c8e-bf3e-3cbf24387e66:Brushes:Brushes
8c4f15ab-755e-4929-9fd2-609157d8067f:Brushes/Curve Sculpt:Brushes-Curve Sculpt
851d0192-113d-4737-b5d7-ab054198bdaa:Brushes/Curve Sculpt/Deform:Brushes-Curve Sculpt-Deform
754a6925-6a06-476e-a714-25db953c80ea:Brushes/Curve Sculpt/Density:Brushes-Curve Sculpt-Density
2c511e86-866e-4379-93db-7d25ac850a02:Brushes/Curve Sculpt/General:Brushes-Curve Sculpt-General
00c402c1-8f55-45ab-bb26-b4c57c9e87ad:Brushes/Grease Pencil Draw:Brushes-Grease Pencil Draw
f14d7a24-428a-4753-bf88-ef136a66be73:Brushes/Grease Pencil Draw/Draw:Brushes-Grease Pencil Draw-Draw
db855991-aff2-45d1-9ba5-cd0dccea5fe0:Brushes/Grease Pencil Draw/Erase:Brushes-Grease Pencil Draw-Erase
bef62e73-63d2-43e6-89fd-e72245350bc7:Brushes/Grease Pencil Draw/Utilities:Brushes-Grease Pencil Draw-Utilities
98c3c158-b363-48d3-80cd-ce4846f5aed1:Brushes/Grease Pencil Paint:Brushes-Grease Pencil Paint
eb75aff6-7006-4ecf-a41d-48c14e09c32c:Brushes/Grease Pencil Sculpt:Brushes-Grease Pencil Sculpt
2afe28e4-1769-4262-ae62-7e8c17e64246:Brushes/Grease Pencil Sculpt/Contrast:Brushes-Grease Pencil Sculpt-Contrast
2cfbd59a-9b11-48f1-b35d-665b70c112cf:Brushes/Grease Pencil Sculpt/Transform:Brushes-Grease Pencil Sculpt-Transform
ca10d93d-0283-480d-b868-b4275f8bc79a:Brushes/Grease Pencil Sculpt/Utilities:Brushes-Grease Pencil Sculpt-Utilities
9601079f-86e9-4a6f-ba04-56ba1bef3a9f:Brushes/Grease Pencil Weight Paint:Brushes-Grease Pencil Weight Paint
19f885c8-9bd7-43f7-98c1-104118c06f60:Brushes/Mesh Sculpt:Brushes-Mesh Sculpt
194fda97-6d88-41b1-b26d-f41cd8426518:Brushes/Mesh Sculpt/General:Brushes-Mesh Sculpt-General
45d61c81-d318-4835-a37f-54af720391e6:Brushes/Mesh Sculpt/General/Add & Subtract:Brushes-Mesh Sculpt-General-Add & Subtract
650ad315-0880-451e-8f49-7339af60808a:Brushes/Mesh Sculpt/General/Contrast:Brushes-Mesh Sculpt-General-Contrast
a1131a99-c34b-4a28-b6d7-ce61fdbf2573:Brushes/Mesh Sculpt/General/Transform:Brushes-Mesh Sculpt-General-Transform
4900134b-ead6-413d-b6bf-3fb6ff43bbe4:Brushes/Mesh Sculpt/General/Utilities:Brushes-Mesh Sculpt-General-Utilities
eb98fe9e-0baa-417f-8ff1-d56dd79d2ce2:Brushes/Mesh Sculpt/General/Utilities:Brushes-Mesh Sculpt-General-Utilities
722259b1-4abf-4d15-8b17-7875c8efb248:Brushes/Mesh Sculpt/Paint:Brushes-Mesh Sculpt-Paint
abea2557-f13e-4e21-b4d8-11a1fffd7d57:Brushes/Mesh Sculpt/Simulation:Brushes-Mesh Sculpt-Simulation
a82f0b44-1d89-4ca7-ae21-86296257be99:Brushes/Mesh Texture Paint:Brushes-Mesh Texture Paint
d3581edf-cc21-4fb6-85e1-7c682a584517:Brushes/Mesh Texture Paint/Basic:Brushes-Mesh Texture Paint-Basic
63415de5-6391-412a-8cc5-419a11180480:Brushes/Mesh Texture Paint/Erase:Brushes-Mesh Texture Paint-Erase
5e82266d-6884-4d6c-b463-b3385ecb0244:Brushes/Mesh Texture Paint/Pixel Art:Brushes-Mesh Texture Paint-Pixel Art
f57862b2-0845-4ce7-a860-ce343dee67b9:Brushes/Mesh Texture Paint/Utilities:Brushes-Mesh Texture Paint-Utilities
27cbc8dc-80c8-45d5-863c-7ecc48bccf20:Brushes/Mesh Vertex Paint:Brushes-Mesh Vertex Paint
77635e98-1a5a-482e-9cb1-ba9ec4bc5b74:Brushes/Mesh Weight Paint:Brushes-Mesh Weight Paint
a9683cf8-6e3d-4d54-9621-689ef9ecc214:Compositing:Compositing
81249800-1dfd-4eec-9257-20019aa3ef5d:Compositing/Camera & Lens Effects:Compositing-Camera & Lens Effects
679c9c61-2227-41c9-b483-0112dcd65b71:Compositing/Creative:Compositing-Creative
daa42d0b-0cfc-4e0e-87ea-a826249b5830:Compositing/Mask:Compositing-Mask
d45c1e49-afbc-446f-a4c8-b07c95404d1f:Compositing/Utilities:Compositing-Utilities
3156a429-ac53-4dd7-a7df-40a6908536f9:Compositing/Utilities/Vector:Compositing-Utilities-Vector
c1a2055a-af33-418c-87a5-63a239d915b8:Geometry Nodes:Geometry Nodes
007a2c8d-f113-421b-a39c-8fbc76c4f7fe:Geometry Nodes/Generate:Geometry Nodes-Generate
6ecdfe44-a0d7-40b9-8518-b92c97a1b4f2:Geometry Nodes/Generate:Geometry Nodes-Generate
a7b80fd1-5de6-4c15-9049-52f25f4376de:Geometry Nodes/Geometry:Geometry Nodes-Geometry
463e71f0-6db1-41af-bc96-6f875196aac7:Geometry Nodes/Geometry/Operations:Geometry Nodes-Geometry-Operations
9cff2dd6-c78b-41b3-a00e-32f116e1d95a:Geometry Nodes/Geometry/Sample:Geometry Nodes-Geometry-Sample
5fa1e91c-e798-4051-8e4d-5d47f76f789b:Geometry Nodes/Geometry/Selection:Geometry Nodes-Geometry-Selection
1599ecb4-d5ef-4dac-bde9-357d938c1bee:Geometry Nodes/Geometry/Write:Geometry Nodes-Geometry-Write
a01301f0-5ae0-4627-91a4-b7fde91e5c5a:Geometry Nodes/Instances:Geometry Nodes-Instances
b9d488d7-441e-4f1a-905a-64ab84c31706:Geometry Nodes/Mesh:Geometry Nodes-Mesh
b6bb38bb-bfe1-4a12-b2bc-fc87d060864f:Geometry Nodes/Mesh/Read:Geometry Nodes-Mesh-Read
9e98eca8-e987-44d3-88a1-6633d0a8ad82:Geometry Nodes/Normals:Geometry Nodes-Normals
b8945cf7-3045-4675-aae3-0b0eba853415:Geometry Nodes/Utilities:Geometry Nodes-Utilities
373286bf-39ea-4988-bbb0-cf334c19cf6b:Geometry Nodes/Utilities/Field:Geometry Nodes-Utilities-Field
8c0273f0-3645-449f-9d95-c4f17fb910db:Geometry Nodes/Utilities/Vector:Geometry Nodes-Utilities-Vector
f14d3c5d-8223-4e8c-b3b3-cbce81e4b3ee:Hair:Hair
87cbaad7-ae4e-404c-9b6b-4fe60ecc39dc:Hair/Deformation:Hair-Deformation
40aedbf9-be4b-4ddb-8eec-8a9cd37d0921:Hair/Generation:Hair-Generation
09af8c50-8c07-4039-821c-be801761d7cf:Hair/Guides:Hair-Guides
c676fe02-8d25-49a1-b672-11aee0918221:Hair/Read:Hair-Read
9dedc75a-afe5-472a-9e3f-a555a8df3dff:Hair/Utility:Hair-Utility
63a83f9c-5a95-476a-9bd5-fcb72414ea0b:Hair/Write:Hair-Write
689f4607-3a1d-4e2a-a49b-8166dad896ca:Geometry Nodes/Simulation:Geometry Nodes-Simulation
f8291c19-ec70-4a53-82d5-40b68a0c3a86:Shading:Shading
2571be08-e20a-48a8-80c8-26171509f863:Shading/Utilities:Shading-Utilities
9cd554d5-1d8f-43dd-a2ab-41635557769b:Shading/Utilities/Vector:Shading-Utilities-Vector

Binary file not shown.

View File

@@ -0,0 +1,196 @@
# SPDX-FileCopyrightText: 2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
##################################################################################################
#
# This is a build system used by platform maintainers to build library dependencies.
# For users building Blender, we recommend using the pre-compiled libraries from `lib/`
# on all platforms.
#
# This CMake project is usually built through wrappers:
# * Windows: `build_files/build_environment/windows/build_deps.cmd`.
# * macOS and Linux: `make deps` from the blender directory.
#
##################################################################################################
cmake_minimum_required(VERSION 3.10)
project("BlenderDependencies")
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW) # CMake 3.24+ Set the date/time for extracted files to time of extraction
endif()
include(ExternalProject)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/Modules")
include(cmake/check_software.cmake)
include(cmake/options.cmake)
# `versions.cmake` needs to be included after `options.cmake`
# due to the `BLENDER_PLATFORM_ARM` variable being needed.
include(cmake/versions.cmake)
include(cmake/download.cmake)
include(cmake/macros.cmake)
# `setup_msys2.cmake` to install `perl`,
# which HIP needs to function for the compiler detection to work properly,
# hence needs to be included before `check_compilers.cmake`.
if(ENABLE_MSYS2)
include(cmake/setup_msys2.cmake)
else()
set(mingw_LIBDIR ${LIBDIR})
endif()
include(cmake/check_compilers.cmake)
include(cmake/harvest.cmake)
include(cmake/ssl.cmake)
include(cmake/zlib.cmake)
include(cmake/zstd.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
include(cmake/blosc.cmake)
include(cmake/pthreads.cmake)
include(cmake/deflate.cmake)
include(cmake/imath.cmake)
include(cmake/openexr.cmake)
include(cmake/brotli.cmake)
include(cmake/freetype.cmake)
include(cmake/epoxy.cmake)
include(cmake/alembic.cmake)
include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake)
if(UNIX)
include(cmake/nasm.cmake)
endif()
include(cmake/tiff.cmake)
if(WIN32)
include(cmake/flexbison.cmake)
elseif(UNIX AND NOT APPLE)
include(cmake/flex.cmake)
endif()
include(cmake/tbb.cmake)
include(cmake/python.cmake)
include(cmake/llvm.cmake)
include(cmake/osl.cmake)
include(cmake/cython.cmake)
include(cmake/numpy.cmake)
include(cmake/zstandard.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake)
include(cmake/openimageio.cmake)
include(cmake/usd.cmake)
include(cmake/materialx.cmake)
include(cmake/openvdb.cmake)
include(cmake/potrace.cmake)
include(cmake/haru.cmake)
include(cmake/pugixml.cmake)
include(cmake/fribidi.cmake)
include(cmake/harfbuzz.cmake)
include(cmake/xr_openxr.cmake)
if(NOT APPLE)
if(NOT BLENDER_PLATFORM_ARM)
include(cmake/hiprt.cmake)
include(cmake/dpcpp.cmake)
include(cmake/dpcpp_deps.cmake)
include(cmake/emhash.cmake)
include(cmake/parallelhashmap.cmake)
if(NOT WIN32)
include(cmake/igc.cmake)
include(cmake/gmmlib.cmake)
include(cmake/ocloc.cmake)
endif()
endif()
endif()
include(cmake/ispc.cmake)
include(cmake/openpgl.cmake)
# EMBREE needs to be included after `dpcpp` as it uses it for compiling with GPU support
if(BLENDER_PLATFORM_WINDOWS_ARM)
# WoA needs EMBREE to be built with the VS Generator + LLVM,
# put it in its own file to avoid clutter.
include(cmake/embree_windows_arm.cmake)
else()
include(cmake/embree.cmake)
endif()
include(cmake/fmt.cmake)
include(cmake/robinmap.cmake)
include(cmake/xml2.cmake)
# OpenColorIO and dependencies.
include(cmake/expat.cmake)
include(cmake/pystring.cmake)
include(cmake/yamlcpp.cmake)
include(cmake/minizipng.cmake)
include(cmake/opencolorio.cmake)
include(cmake/openjph.cmake)
include(cmake/thorvg.cmake)
include(cmake/libheif.cmake)
include(cmake/ffi.cmake)
if(BLENDER_PLATFORM_ARM)
include(cmake/sse2neon.cmake)
endif()
include(cmake/webp.cmake)
if(NOT APPLE)
include(cmake/level-zero.cmake)
endif()
if(NOT WIN32 OR ENABLE_MSYS2)
include(cmake/gmp.cmake)
include(cmake/openjpeg.cmake)
include(cmake/sqlite.cmake)
include(cmake/fftw.cmake)
include(cmake/aom.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
include(cmake/openimagedenoise.cmake)
include(cmake/lame.cmake)
include(cmake/ogg.cmake)
include(cmake/vorbis.cmake)
include(cmake/theora.cmake)
include(cmake/opus.cmake)
include(cmake/vpx.cmake)
include(cmake/x264.cmake)
include(cmake/x265.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/flac.cmake)
include(cmake/sndfile.cmake)
if(UNIX)
if(NOT APPLE)
include(cmake/spnav.cmake)
endif()
endif()
endif()
endif()
if(UNIX)
include(cmake/bzip2.cmake)
include(cmake/lzma.cmake)
endif()
if(UNIX AND NOT APPLE)
include(cmake/wayland_protocols.cmake)
# Can be removed when the build-bot upgrades to v1.20.x or newer.
include(cmake/wayland.cmake)
include(cmake/wayland_weston.cmake)
endif()
include(cmake/shaderc_deps.cmake)
include(cmake/shaderc.cmake)
include(cmake/vulkan.cmake)
include(cmake/vulkan-memory-allocator.cmake)
include(cmake/spirv-reflect.cmake)
include(cmake/pybind11.cmake)
include(cmake/nanobind.cmake)
include(cmake/manifold.cmake)
include(cmake/rubberband.cmake)
include(cmake/abseil.cmake)
include(cmake/eigen.cmake)
include(cmake/ceres.cmake)
include(cmake/draco.cmake)
include(cmake/meshoptimizer.cmake)
include(cmake/tracy.cmake)
# Keep these last.
include(cmake/deps_md.cmake)
include(cmake/cve_check.cmake)
if(UNIX)
# Strip all installed libraries.
harvest_strip_all_libraries()
endif()

View File

@@ -0,0 +1,478 @@
# Blender Library Dependencies
This file contains a table with all the libraries Blender uses to build its library dependencies.
Some of the libraries might not be shipped in the library directory as some of them are only used at build time.
NOTE: Some libraries listed here might not be relevant for your platform.
## Library List
| Library Name | Version | Homepage |
|--------------|---------|----------|
| `ABSEIL` | `20250814.1` | <https://abseil.io/> |
| `ALEMBIC` | `1.8.3` | <https://www.alembic.io/> |
| `AOM` | `3.13.1` | <https://aomedia.googlesource.com/aom/> |
| `BLOSC` | `1.21.1` | <https://www.blosc.org/> |
| `BROTLI` | `1.0.9` | <https://github.com/google/brotli> |
| `BZIP2` | `1.0.8` | <https://sourceware.org/bzip2/> |
| `CERES` | `0c70ed3a1a2d6ba47c06c7e8b3b040880bc474db` | <http://ceres-solver.org/> |
| `CYTHON` | `3.0.11` | <https://cython.org/> |
| `DEFLATE` | `1.18` | <https://github.com/ebiggers/libdeflate> |
| `DPCPP_SPIRV_HEADERS` | `c9aad99f9276817f18f72a4696239237c83cb775` | <https://github.com/KhronosGroup/SPIRV-Headers> |
| `DPCPP` | `v6.3.0` | <https://github.com/intel/llvm#oneapi-dpc-compiler> |
| `DRACO` | `1.5.7` | <https://google.github.io/draco/> |
| `EIGEN` | `8a1083e9bf41b91fdea6546681f806154efdc25a` | <http://eigen.tuxfamily.org> |
| `EMBREE` | `4.4.1` | <https://github.com/RenderKit/embree> |
| `EMHASH` | `3ba9abdfdc2e0430fcc2fd8993cad31945b6a02b` | <https://github.com/ktprime/emhash> |
| `EPOXY` | `1.5.10` | <https://github.com/anholt/libepoxy> |
| `EXPAT` | `2_7_5` | <https://github.com/libexpat/libexpat/> |
| `FFI` | `3.5.2` | <https://github.com/libffi/libffi/> |
| `FFMPEG` | `8.1` | <https://ffmpeg.org/> |
| `FFTW` | `3.3.10` | <https://www.fftw.org/> |
| `FLAC` | `1.4.2` | <https://xiph.org/flac/> |
| `FLEXBISON` | `2.5.24` | <https://github.com/lexxmark/winflexbison> |
| `FLEX` | `2.6.4` | <https://www.github.com/westes/flex> |
| `FMT` | `12.1.0` | <https://github.com/fmtlib/fmt> |
| `FREETYPE` | `2.13.3` | <https://freetype.org/> |
| `FRIBIDI` | `v1.0.12` | <https://github.com/fribidi/fribidi> |
| `GMMLIB` | `intel-gmmlib-22.8.1` | <https://github.com/intel/gmmlib> |
| `GMP` | `6.3.0` | <https://gmplib.org/> |
| `HARFBUZZ` | `10.0.1` | <https://github.com/harfbuzz/harfbuzz> |
| `HARU` | `2.4.5` | <http://libharu.org/> |
| `HIPRT` | `606b4886efabce918dd0634ef71c06615a47c83b` | <https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT> |
| `ICDLOADER` | `ddf6c70230a79cdb8fcccfd3c775b09e6820f42e` | <https://github.com/KhronosGroup/OpenCL-ICD-Loader> |
| `ICONV` | `1.16` | <https://www.gnu.org/software/libiconv/> |
| `IGC_LLVM` | `llvmorg-16.0.6` | <https://github.com/llvm/llvm-project/> |
| `IGC_OPENCL_CLANG` | `v16.0.10` | <https://github.com/intel/opencl-clang/> |
| `IGC_SPIRV_HEADERS` | `9268f3057354a2cb65991ba5f38b16d81e803692` | <https://github.com/KhronosGroup/SPIRV-Headers> |
| `IGC_SPIRV_TOOLS` | `28a883ba4c67f58a9540fb0651c647bb02883622` | <https://github.com/KhronosGroup/SPIRV-Tools/> |
| `IGC_SPIRV_TRANSLATOR` | `v16.0.10` | <https://github.com/KhronosGroup/SPIRV-LLVM-Translator> |
| `IGC` | `2.30.1` | <https://github.com/intel/intel-graphics-compiler> |
| `IGC_VCINTRINSICS` | `0.25.0` | <https://github.com/intel/vc-intrinsics> |
| `IMATH` | `3.2.2` | <https://github.com/AcademySoftwareFoundation/Imath> |
| `ISPC` | `v1.30.0` | <https://www.github.com/ispc/ispc> |
| `JPEG` | `2.1.3` | <https://github.com/libjpeg-turbo/libjpeg-turbo/> |
| `LAME` | `3.100` | <https://lame.sourceforge.io/> |
| `LEVEL_ZERO` | `35c037cdf4aa9a2e6df34b6f1ce1bdc86ac5422f` | <https://github.com/oneapi-src/level-zero> |
| `LIBHEIF` | `1.20.2` | <https://github.com/strukturag/libheif> |
| `LLVM` | `20.1.8` | <https://github.com/llvm/llvm-project/> |
| `LZMA` | `5.2.5` | <https://tukaani.org/lzma/> |
| `MANIFOLD` | `v3.5.2` | <https://github.com/elalish/manifold> |
| `MATERIALX` | `1.39.4` | <https://github.com/AcademySoftwareFoundation/MaterialX> |
| `MESHOPTIMIZER` | `1.1` | <https://meshoptimizer.org> |
| `MINIZIPNG` | `4.0.10` | <https://github.com/zlib-ng/minizip-ng> |
| `NANOBIND` | `v2.1.0` | <https://github.com/wjakob/nanobind> |
| `NASM` | `2.15.02` | <https://www.github.com/netwide-assembler/nasm> |
| `NUMPY` | `2.3.4` | <https://numpy.org/> |
| `OCLOC` | `25.31.34666.3` | <https://github.com/intel/compute-runtime> |
| `OGG` | `1.3.5` | <https://xiph.org/ogg/> |
| `OIDN` | `2.5.0` | <https://www.openimagedenoise.org/> |
| `OPENAL` | `1.23.1` | <https://openal-soft.org/> |
| `OPENCLHEADERS` | `6eabe90aa7b6cff9c67800a2fe25a0cd88d8b749` | <https://github.com/KhronosGroup/OpenCL-Headers> |
| `OPENCOLORIO` | `2.5.0` | <https://github.com/AcademySoftwareFoundation/OpenColorIO> |
| `OPENEXR` | `3.4.10` | <https://github.com/AcademySoftwareFoundation/openexr> |
| `OPENIMAGEIO` | `v3.1.13.1` | <https://github.com/AcademySoftwareFoundation/OpenImageIO> |
| `OPENJPEG` | `2.5.3` | <https://github.com/uclouvain/openjpeg> |
| `OPENJPH` | `0.25.2` | <https://github.com/aous72/OpenJPH> |
| `OPENPGL` | `v0.7.1` | <http://www.openpgl.org/> |
| `OPENSUBDIV` | `v3_7_0` | <https://graphics.pixar.com/opensubdiv/docs/intro.html> |
| `OPENVDB` | `13.0.0` | <http://www.openvdb.org/> |
| `OPUS` | `1.3.1` | <https://opus-codec.org/> |
| `OSL` | `1.15.3.0` | <https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/> |
| `PARALLEL_HASHMAP` | `8a889d3699b3c09ade435641fb034427f3fd12b6` | <https://github.com/greg7mdp/parallel-hashmap> |
| `PNG` | `1.6.58` | <http://www.libpng.org/pub/png/libpng.html> |
| `POTRACE` | `1.16` | <https://potrace.sourceforge.net/> |
| `PTHREADS` | `3.0.0` | <https://github.com/fwbuilder/pthreads4w> |
| `PUGIXML` | `1.10` | <https://pugixml.org/> |
| `PYBIND11` | `3.0.1` | <https://github.com/pybind/pybind11> |
| `PYSTRING` | `v1.1.3` | <https://github.com/imageworks/pystring> |
| `PYTHON` | `3.13.13` | <https://www.python.org/> |
| `ROBINMAP` | `v1.3.0` | <https://github.com/Tessil/robin-map> |
| `RUBBERBAND` | `4.0.0` | <https://breakfastquay.com/rubberband/> |
| `SDL` | `3.4.2` | <https://www.libsdl.org> |
| `SHADERC_GLSLANG` | `d213562e35573012b6348b2d584457c3704ac09b` | <https://github.com/KhronosGroup/glslang> |
| `SHADERC` | `v2025.4` | <https://github.com/google/shaderc> |
| `SNDFILE` | `1.2.2` | <http://libsndfile.github.io/libsndfile/> |
| `SPIRV_HEADERS` | `1.4.341` | <https://github.com/KhronosGroup/SPIRV-Headers/> |
| `SPIRV_REFLECT` | `1.4.341` | <https://github.com/KhronosGroup/SPIRV-Reflect> |
| `SPIRV_TOOLS` | `v2026.1` | <https://github.com/KhronosGroup/SPIRV-Tools/> |
| `SPNAV` | `1.1` | <https://github.com/FreeSpacenav/libspnav> |
| `SQLITE` | `3.51.3` | <https://www.sqlite.org> |
| `SSE2NEON` | `227cc413fb2d50b2a10073087be96b59d5364aea` | <https://github.com/DLTcollab/sse2neon> |
| `SSL` | `3.5.6` | <https://www.openssl.org> |
| `TBB` | `v2022.3.0` | <https://software.intel.com/en-us/oneapi/onetbb> |
| `THEORA` | `1.1.1` | <https://xiph.org/theora/> |
| `THORVG` | `v1.0.3` | <https://www.thorvg.org/> |
| `TIFF` | `4.7.1` | <http://www.simplesystems.org/libtiff/> |
| `TRACY` | `a64b9a20294d59421a2f57aeca3c6383d8c48169` | <https://github.com/wolfpld/tracy> |
| `UNIFIED_MEMORY_FRAMEWORK` | `v1.0.0-rc2` | <https://github.com/oneapi-src/unified-memory-framework> |
| `USD` | `26.03` | <https://openusd.org/> |
| `VCINTRINSICS` | `60cea7590bd022d95f5cf336ee765033bd114d69` | <https://github.com/intel/vc-intrinsics> |
| `VORBIS` | `1.3.7` | <https://xiph.org/vorbis/> |
| `VPX` | `1.15.2` | <https://github.com/webmproject/libvpx> |
| `VULKAN_HEADERS` | `1.4.341` | <https://github.com/KhronosGroup/Vulkan-Headers> |
| `VULKAN_LOADER` | `1.4.341` | <https://github.com/KhronosGroup/Vulkan-Loader> |
| `VULKAN_MEMORY_ALLOCATOR` | `3.2.1` | <https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator> |
| `VULKAN_UTILITY_LIBRARIES` | `1.4.341` | <https://github.com/KhronosGroup/Vulkan-Utility-Libraries> |
| `WAYLAND` | `1.24.0` | <https://gitlab.freedesktop.org/wayland/wayland> |
| `WAYLAND_WESTON` | `14.0.2` | <https://gitlab.freedesktop.org/wayland/weston> |
| `WEBP` | `1.6.0` | <https://developers.google.com/speed/webp> |
| `WL_PROTOCOLS` | `1.44` | <https://gitlab.freedesktop.org/wayland/wayland-protocols> |
| `X264` | `35fe20d1ba49918ec739a5b068c208ca82f977f7` | <https://www.videolan.org/developers/x264.html> |
| `X265` | `4.1` | <https://www.videolan.org/developers/x265.html> |
| `XML2` | `2.14.6` | <https://gitlab.gnome.org/GNOME/libxml2> |
| `XR_OPENXR_SDK` | `1.1.53` | <https://khronos.org/openxr/> |
| `YAMLCPP` | `0.8.0` | <https://www.github.com/jbeder/yaml-cpp> |
| `ZLIB` | `1.3.1` | <https://zlib.net> |
| `ZSTANDARD` | `0.25.0` | <https://github.com/indygreg/python-zstandard/> |
| `ZSTD` | `1.5.7` | <https://github.com/facebook/zstd> |
## Basic Dependency Lists
These are auto generated basic dependency lists for each library.
```
└── png
└── zlib
```
```
└── openexr
├── deflate
├── imath
└── openjph
```
```
└── freetype
├── brotli
└── zlib
```
```
└── epoxy
└── python_site_packages
```
```
└── alembic
└── imath
```
```
└── opensubdiv
└── tbb
```
```
└── tiff
├── jpeg
└── zlib
```
```
└── python
├── bzip2
├── ffi
├── lzma
├── sqlite
├── ssl
└── zlib
```
```
└── llvm
├── python
└── xml2
```
```
└── osl
├── flex
├── llvm
├── openexr
├── openimageio
├── pugixml
├── pybind11
├── python
└── zlib
```
```
└── cython
├── python
└── python_site_packages
```
```
└── numpy
├── cython
├── python
└── python_site_packages
```
```
└── zstandard
├── python
└── zstd
```
```
└── python_site_packages
└── python
```
```
└── openimageio
├── fmt
├── imath
├── jpeg
├── libheif
├── opencolorio
├── openexr
├── openjpeg
├── png
├── pugixml
├── pybind11
├── python
├── robinmap
├── tbb
├── tiff
├── webp
└── zlib
```
```
└── usd
├── materialx
├── openimageio
├── opensubdiv
├── openvdb
├── python
├── shaderc
├── spirv_reflect
├── tbb
├── vulkan_headers
├── vulkan_loader
├── vulkan_memory_allocator
└── vulkan_utility_libraries
```
```
└── materialx
├── pybind11
└── python
```
```
└── openvdb
├── blosc
├── tbb
└── zlib
```
```
└── fribidi
├── python
└── python_site_packages
```
```
└── harfbuzz
├── freetype
├── python
└── python_site_packages
```
```
└── dpcpp
├── dpcpp_spirvheaders
├── emhash
├── icdloader
├── level-zero
├── openclheaders
├── parallelhashmap
├── python
├── python_site_packages
├── unifiedmemoryframework
├── vcintrinsics
└── zstd
```
```
└── igc_llvm
└── igc_opencl_clang
```
```
└── igc_spirv_translator
└── igc_opencl_clang
```
```
└── igc
├── flex
├── igc_llvm
├── igc_opencl_clang
├── igc_spirv_headers
├── igc_spirv_tools
├── igc_spirv_translator
└── igc_vcintrinsics
```
```
└── ocloc
├── gmmlib
└── igc
```
```
└── ispc
├── flex
├── llvm
└── python
```
```
└── openpgl
└── tbb
```
```
└── embree
├── dpcpp
└── tbb
```
```
└── minizipng
└── zlib
```
```
└── opencolorio
├── expat
├── imath
├── minizipng
├── pybind11
├── pystring
├── python
├── yamlcpp
└── zlib
```
```
└── thorvg
├── python
└── python_site_packages
```
```
└── libheif
└── aom
```
```
└── fftw
├── fftw3_double
└── fftw3_float
```
```
└── openimagedenoise
├── dpcpp
├── ispc
├── level-zero
├── ocloc
├── python
└── tbb
```
```
└── vorbis
└── ogg
```
```
└── theora
├── ogg
└── vorbis
```
```
└── x264
└── nasm
```
```
└── x265
├── x265_10
└── x265_12
```
```
└── ffmpeg
├── aom
├── flac
├── lame
├── nasm
├── ogg
├── openjpeg
├── opus
├── sndfile
├── theora
├── vorbis
├── vpx
├── x264
├── x265
└── zlib
```
```
└── sndfile
├── flac
├── lame
├── ogg
├── opus
└── vorbis
```
```
└── wayland_protocols
├── python_site_packages
└── wayland
```
```
└── wayland
├── expat
├── ffi
├── python_site_packages
└── xml2
```
```
└── wayland_weston
├── python_site_packages
├── wayland
└── wayland_protocols
```
```
└── shaderc
├── python
├── shaderc_glslang
├── spirv_headers
└── spirv_tools
```
```
└── vulkan_utility_libraries
└── vulkan_headers
```
```
└── spirv_tools
└── spirv_headers
```
```
└── vulkan_loader
├── vulkan_headers
└── wayland
```
```
└── spirv_reflect
└── spirv_headers
```
```
└── pybind11
└── python
```
```
└── nanobind
└── robinmap
```
```
└── manifold
└── tbb
```
```
└── rubberband
├── fftw
└── python_site_packages
```
```
└── ceres
├── abseil
└── eigen
```
Libraries without any dependencies and not used by any other library:
```
openal
sdl
potrace
haru
xr_openxr_sdk
gmp
spnav
draco
meshoptimizer
tracy
```

View File

@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(ABSEIL_EXTRA_ARGS
)
if(WIN32)
set(ABSEIL_EXTRA_ARGS
${ABSEIL_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
endif()
ExternalProject_Add(external_abseil
URL file://${PACKAGE_DIR}/${ABSEIL_FILE}
URL_HASH ${ABSEIL_HASH_TYPE}=${ABSEIL_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/abseil
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/abseil
${DEFAULT_CMAKE_FLAGS}
${ABSEIL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/abseil
)
if(WIN32)
ExternalProject_Add_Step(external_abseil after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/abseil/
${HARVEST_TARGET}/abseil
COMMAND ${CMAKE_COMMAND} -E remove_directory
${HARVEST_TARGET}/abseil/lib/pkgconfig
DEPENDEES install
)
else()
harvest(external_abseil abseil/include abseil/include "*.h")
harvest(external_abseil abseil/lib/cmake/absl abseil/lib/cmake/absl "*.cmake")
harvest(external_abseil abseil/lib abseil/lib "*.a")
endif()

View File

@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: 2017-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(ALEMBIC_EXTRA_ARGS
-DImath_ROOT=${LIBDIR}/imath
-DUSE_PYALEMBIC=OFF
-DUSE_ARNOLD=OFF
-DUSE_MAYA=OFF
-DUSE_PRMAN=OFF
-DUSE_HDF5=OFF
-DUSE_TESTS=OFF
-DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=OFF
-DALEMBIC_SHARED_LIBS=OFF
)
ExternalProject_Add(external_alembic
URL file://${PACKAGE_DIR}/${ALEMBIC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ALEMBIC_HASH_TYPE}=${ALEMBIC_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic
-Wno-dev
${DEFAULT_CMAKE_FLAGS}
${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_alembic after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/alembic
${HARVEST_TARGET}/alembic
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_alembic after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/alembic/lib/alembic.lib
${HARVEST_TARGET}/alembic/lib/alembic_d.lib
DEPENDEES install
)
endif()
else()
harvest(external_alembic alembic/include alembic/include "*.h")
harvest(external_alembic alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest_rpath_bin(external_alembic alembic/bin alembic/bin "*")
endif()
add_dependencies(
external_alembic
external_imath
)

View File

@@ -0,0 +1,98 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(BLENDER_PLATFORM_WINDOWS_ARM)
set(AOM_EXTRA_ARGS_WIN32 ${DEFAULT_CMAKE_FLAGS} -DAOM_TARGET_CPU=generic)
else()
set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
endif()
set(AOM_EXTRA_ARGS
-DENABLE_TESTDATA=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOOLS=OFF
-DENABLE_EXAMPLES=OFF
-DBUILD_SHARED_LIBS=ON
${AOM_EXTRA_ARGS_WIN32}
)
if(WIN32 AND NOT BLENDER_PLATFORM_WINDOWS_ARM)
set(AOM_EXTRA_ARGS ${AOM_EXTRA_ARGS}-DCMAKE_ASM_NASM_COMPILER=)
endif()
if(WIN32)
# This is slightly different from all other deps in the way that
# aom uses cmake as a build system, but still needs the environment setup
# to include perl so we manually setup the environment and call
# cmake directly for the configure, build and install commands.
ExternalProject_Add(external_aom
URL file://${PACKAGE_DIR}/${AOM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
PREFIX ${BUILD_DIR}/aom
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d
${BUILD_DIR}/aom/src/external_aom <
${PATCH_DIR}/aom_6d2b7f71b98bfa28e372b1f2d85f137280bdb3de.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom
-G "${PLATFORM_ALT_GENERATOR}"
${AOM_CMAKE_FLAGS}
${AOM_EXTRA_ARGS}
${BUILD_DIR}/aom/src/external_aom/
BUILD_COMMAND ${CMAKE_COMMAND} --build .
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
INSTALL_DIR ${LIBDIR}/aom
)
else()
ExternalProject_Add(external_aom
URL file://${PACKAGE_DIR}/${AOM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/aom
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d
${BUILD_DIR}/aom/src/external_aom <
${PATCH_DIR}/aom_6d2b7f71b98bfa28e372b1f2d85f137280bdb3de.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom
${AOM_CMAKE_FLAGS}
${AOM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/aom
)
endif()
if(NOT WIN32)
harvest(external_aom aom/lib ffmpeg/lib "*.a")
else()
if(BUILD_MODE STREQUAL Release)
# aom insists on building a static version even if you
# do not want it, get rid of it by copying the import lib
# on top of it, so other projects don't accidentally link
# the static library.
ExternalProject_Add_Step(external_aom after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/aom/lib/aom_dll.lib
${LIBDIR}/aom/lib/aom.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/aom/
${HARVEST_TARGET}/aom/
DEPENDEES install
)
else()
ExternalProject_Add_Step(external_aom after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/aom/lib/aom_dll.lib
${LIBDIR}/aom/lib/aom.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: 2012-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(BLOSC_EXTRA_ARGS
-DBUILD_TESTS=OFF
-DBUILD_BENCHMARKS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DThreads_FOUND=1
-DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC3.lib
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
-DDEACTIVATE_SNAPPY=ON
-DDEACTIVATE_ZLIB=ON
-DDEACTIVATE_ZSTD=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
# Fix for building with GCC 15, which defaults to C23. Fixed in main in the c-blosc repo, remove on upgrade.
# See commit: https://github.com/Blosc/c-blosc/commit/774f6a0ebaa0c617f7f13ccf6bc89d17eba04654
-DCMAKE_C_STANDARD=17
)
ExternalProject_Add(external_blosc
URL file://${PACKAGE_DIR}/${BLOSC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BLOSC_HASH_TYPE}=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc
${DEFAULT_CMAKE_FLAGS}
${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc
)
if(WIN32)
add_dependencies(
external_blosc
external_pthreads
)
endif()
if(APPLE)
harvest(external_blosc blosc/lib openvdb/lib "*.a")
endif()

View File

@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(BROTLI_EXTRA_ARGS
)
ExternalProject_Add(external_brotli
URL file://${PACKAGE_DIR}/${BROTLI_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH}
PREFIX ${BUILD_DIR}/brotli
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli
${DEFAULT_CMAKE_FLAGS}
${BROTLI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/brotli
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_brotli after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/brotli/include
${HARVEST_TARGET}/brotli/include
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT}
${HARVEST_TARGET}/brotli/lib/brotlidec-static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT}
${HARVEST_TARGET}/brotli/lib/brotlicommon-static${LIBEXT}
DEPENDEES install
)
endif()
else()
harvest(external_brotli brotli/include brotli/include "*.h")
harvest(external_brotli brotli/lib brotli/lib "*.a")
endif()

View File

@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(BZIP2_PREFIX "${LIBDIR}/bzip2")
set(BZIP2_CONFIGURE_ENV echo .)
set(BZIP2_CONFIGURATION_ARGS "")
if(UNIX AND NOT APPLE)
set(BZIP2_LDFLAGS "-Wl,--as-needed")
set(BZIP2_CFLAGS "-fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64")
set(BZIP2_CONFIGURE_ENV
${BZIP2_CONFIGURE_ENV} &&
export LDFLAGS=${BZIP2_LDFLAGS} &&
export CFLAGS=${BZIP2_CFLAGS} &&
export PREFIX=${BZIP2_PREFIX}
)
else()
set(BZIP2_CONFIGURE_ENV ${CONFIGURE_ENV})
endif()
ExternalProject_Add(external_bzip2
URL file://${PACKAGE_DIR}/${BZIP2_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BZIP2_HASH_TYPE}=${BZIP2_HASH}
PREFIX ${BUILD_DIR}/bzip2
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${BZIP2_CONFIGURE_ENV} &&
cd ${BUILD_DIR}/bzip2/src/external_bzip2/ &&
make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} -j${MAKE_THREADS}
INSTALL_COMMAND ${BZIP2_CONFIGURE_ENV} &&
cd ${BUILD_DIR}/bzip2/src/external_bzip2/ &&
make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} PREFIX=${BZIP2_PREFIX} install
INSTALL_DIR ${LIBDIR}/bzip2
)

View File

@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(CERES_EXTRA_ARGS
-Dabsl_DIR=${LIBDIR}/abseil/lib/cmake/absl/
-DEigen3_DIR=${LIBDIR}/eigen/share/eigen3/cmake/
-DTBB_DIR=${LIBDIR}/tbb/lib/cmake/TBB
-DBUILD_TESTING=OFF
-DBUILD_BENCHMARKS=OFF
-DUSE_CUDA=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_SHARED_LIBS=ON
)
ExternalProject_Add(external_ceres
URL file://${PACKAGE_DIR}/${CERES_FILE}
URL_HASH ${CERES_HASH_TYPE}=${CERES_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ceres
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/ceres
${DEFAULT_CMAKE_FLAGS}
${CERES_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/ceres
)
add_dependencies(
external_ceres
external_abseil
external_eigen
)
if(WIN32)
ExternalProject_Add_Step(external_ceres after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/ceres
${HARVEST_TARGET}/ceres
DEPENDEES install
)
else()
harvest(external_ceres ceres/include ceres/include "*.h")
harvest(external_ceres ceres/lib/cmake/Ceres ceres/lib/cmake/Ceres "*.cmake")
harvest_rpath_lib(external_ceres ceres/lib ceres/lib "*${SHAREDLIBEXT}*")
endif()

View File

@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2019-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Check against installed versions.
message(STATUS "Found C Compiler: ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
if(UNIX AND NOT APPLE)
if(NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION MATCHES "${RELEASE_GCC_VERSION}.*"))
message(STATUS " NOTE: Official releases use GCC ${RELEASE_GCC_VERSION}")
endif()
endif()
message(STATUS "Found C++ Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
if(UNIX AND NOT APPLE)
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION MATCHES "${RELEASE_GCC_VERSION}.*"))
message(STATUS " NOTE: Official releases use GCC ${RELEASE_GCC_VERSION}")
endif()
endif()
if(NOT APPLE)
find_package(CUDAToolkit)
if(NOT CUDAToolkit_NVCC_EXECUTABLE)
message(STATUS "Missing CUDA compiler")
else()
message(STATUS "Found CUDA Compiler: ${CUDAToolkit_NVCC_EXECUTABLE} ${CUDAToolkit_VERSION}")
if(NOT CUDAToolkit_VERSION MATCHES "${RELEASE_CUDA_VERSION}.*")
message(STATUS " NOTE: Official releases use CUDA ${RELEASE_CUDA_VERSION}")
endif()
get_filename_component(CUDAToolkit_ROOT ${CUDAToolkit_BIN_DIR} DIRECTORY ABSOLUTE)
endif()
unset(HIP_VERSION)
find_package(HIP QUIET)
if(NOT HIP_FOUND)
message(STATUS "Missing HIP compiler")
else()
message(STATUS "Found HIP Compiler: ${HIP_HIPCC_EXECUTABLE} ${HIP_VERSION}")
if(WIN32)
if(NOT HIP_VERSION MATCHES "${RELEASE_HIP_WINDOWS_VERSION}.*")
message(STATUS " NOTE: Official releases use HIP ${RELEASE_HIP_WINDOWS_VERSION}")
endif()
else()
if(NOT HIP_VERSION MATCHES "${RELEASE_HIP_UNIX_VERSION}.*")
message(STATUS " NOTE: Official releases use HIP ${RELEASE_HIP_UNIX_VERSION}")
endif()
endif()
endif()
endif()

View File

@@ -0,0 +1,69 @@
# SPDX-FileCopyrightText: 2019-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(UNIX)
if(APPLE)
set(_libtoolize_name glibtoolize)
else()
set(_libtoolize_name libtoolize)
endif()
set(_required_software
autoconf
automake
bison
${_libtoolize_name}
flex
ninja
pkg-config
tclsh
yasm
)
if(APPLE)
list(APPEND _required_software dos2unix)
else()
list(APPEND _required_software autopoint)
list(APPEND _required_software patchelf)
list(APPEND _required_software help2man)
list(APPEND _required_software makeinfo)
endif()
foreach(_software ${_required_software})
find_program(_software_find NAMES ${_software})
if(NOT _software_find)
set(_software_missing "${_software_missing}${_software} ")
endif()
unset(_software_find CACHE)
endforeach()
if(APPLE)
# Homebrew has different default locations for ARM and Intel macOS.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set(HOMEBREW_LOCATION "/opt/homebrew")
else()
set(HOMEBREW_LOCATION "/usr/local")
endif()
if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
string(APPEND _software_missing " bison")
endif()
endif()
if(_software_missing)
message(WARNING
"\n"
"Missing software for building Blender dependencies:\n"
" ${_software_missing}\n"
"\n"
"On Debian and Ubuntu:\n"
" apt install autoconf automake autopoint flex help2man gettext texinfo bison libtool yasm tcl ninja-build meson python3-mako patchelf pkg-config\n"
"\n"
"On macOS (with homebrew):\n"
" brew install autoconf automake bison dos2unix flex libtool meson ninja pkg-config yasm\n"
"\n"
"Other platforms:\n"
" Install equivalent packages.\n")
message(FATAL_ERROR "Install missing software before continuing")
endif()
endif()

View File

@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: 2026 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Grype requirements
#
# - A working installation grype [1] has to be available in your path
#
# Bill of Materials construction
#
# This constructs a json cyclone-dx sbom grype can read and process.
#
# [1] https://github.com/anchore/grype
# Because not all deps are downloaded (ie python packages) but can still have a
# xxx_CPE declared loop over all variables and look for variables ending in CPE.
set(SBOMCONTENTS "")
set(SBOM_FIRST_ENTRY TRUE)
get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames})
if(_variableName MATCHES "CPE$")
string(REPLACE ":" ";" CPE_LIST ${${_variableName}})
list(GET CPE_LIST 3 CPE_VENDOR)
list(GET CPE_LIST 4 CPE_NAME)
list(GET CPE_LIST 5 CPE_VERSION)
if(SBOM_FIRST_ENTRY)
set(SBOM_SEPARATOR "")
set(SBOM_FIRST_ENTRY FALSE)
else()
set(SBOM_SEPARATOR ",\n")
endif()
set(SBOM_ENTRY " {\n")
string(APPEND SBOM_ENTRY " \"type\": \"library\",\n")
string(APPEND SBOM_ENTRY " \"name\": \"${CPE_NAME}\",\n")
string(APPEND SBOM_ENTRY " \"version\": \"${CPE_VERSION}\",\n")
string(APPEND SBOM_ENTRY " \"cpe\": \"${${_variableName}}\"\n")
string(APPEND SBOM_ENTRY " }")
string(APPEND SBOMCONTENTS "${SBOM_SEPARATOR}${SBOM_ENTRY}")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/sbom.json.in ${CMAKE_CURRENT_BINARY_DIR}/sbom.json @ONLY)
# This will just report to the console
add_custom_target(cve_check
COMMAND grype
sbom:${CMAKE_CURRENT_BINARY_DIR}/sbom.json
-o table
-v
--sort-by package
--config ${CMAKE_SOURCE_DIR}/cmake/grype.yaml
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/sbom.json
)
# This will write out grype_results.txt
add_custom_target(cve_check_txt
COMMAND grype
sbom:${CMAKE_CURRENT_BINARY_DIR}/sbom.json
-o table
--sort-by package
--file ${CMAKE_CURRENT_BINARY_DIR}/grype_results.txt
--config ${CMAKE_SOURCE_DIR}/cmake/grype.yaml
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/sbom.json
)

View File

@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: 2017-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(MSVC)
if(BUILD_MODE STREQUAL Debug)
set(CYTHON_DIR_POSTFIX -pydebug)
set(CYTHON_ARCHIVE_POSTFIX d)
set(CYTHON_BUILD_OPTION --debug)
else()
set(CYTHON_DIR_POSTFIX "")
set(CYTHON_ARCHIVE_POSTFIX "")
set(CYTHON_BUILD_OPTION "")
endif()
endif()
set(CYTHON_POSTFIX "")
ExternalProject_Add(external_cython
URL file://${PACKAGE_DIR}/${CYTHON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${CYTHON_HASH_TYPE}=${CYTHON_HASH}
PREFIX ${BUILD_DIR}/cython
PATCH_COMMAND ${CYTHON_PATCH}
CONFIGURE_COMMAND ""
LOG_BUILD 1
BUILD_IN_SOURCE 1
BUILD_COMMAND
${PYTHON_BINARY} setup.py
build ${CYTHON_BUILD_OPTION} -j${PYTHON_MAKE_THREADS}
install
--old-and-unmanageable
INSTALL_COMMAND ""
)
add_dependencies(
external_cython
external_python
external_python_site_packages
)

View File

@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(DEFLATE_EXTRA_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DLIBDEFLATE_BUILD_STATIC_LIB=ON
-DLIBDEFLATE_BUILD_SHARED_LIB=OFF
)
ExternalProject_Add(external_deflate
URL file://${PACKAGE_DIR}/${DEFLATE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${DEFLATE_HASH_TYPE}=${DEFLATE_HASH}
PREFIX ${BUILD_DIR}/deflate
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/deflate
${DEFAULT_CMAKE_FLAGS}
${DEFLATE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/deflate
)

View File

@@ -0,0 +1,18 @@
# Blender Library Dependencies
This file contains a table with all the libraries Blender uses to build its library dependencies.
Some of the libraries might not be shipped in the library directory as some of them are only used at build time.
NOTE: Some libraries listed here might not be relevant for your platform.
## Library List
| Library Name | Version | Homepage |
|--------------|---------|----------|
@TABLE_CONTENTS@
## Basic Dependency Lists
These are auto generated basic dependency lists for each library.
@DEPS_CONTENTS@

View File

@@ -0,0 +1,70 @@
# SPDX-FileCopyrightText: 2026 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This outputs an markdown file with the name, version and homepage for
# every dependency we have, this is used by the release manager to
# update the licensing document.
# Create a table with name, version and url for each library.
set(TABLE_CONTENTS "")
get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames})
if(_variableName MATCHES "_URI$")
string(REPLACE "_URI" "" DEP_NAME ${_variableName})
set(DEP_VERSION "${${DEP_NAME}_VERSION}")
# First see if DEP_HOMEPAGE is set, if it is use that.
set(DEP_HOMEPAGE ${${DEP_NAME}_HOMEPAGE})
if(NOT DEP_HOMEPAGE)
# If the xxx_HOMEPAGE is not set but the URI for the archive is a known github format
# extract the repository/project from the URI.
string(REGEX MATCH "https:\/\/(.*)github\.com\/(.+)\/(archive|releases|release|tar.gz)\/(.*)" DEP_PROJECT "${${_variableName}}")
if(CMAKE_MATCH_2)
set(DEP_HOMEPAGE "https://www.github.com/${CMAKE_MATCH_2}")
else() # If that is also not set, error out to ensure this information is supplied
message(FATAL_ERROR "${DEP_NAME} No homepage set, please set ${DEP_NAME}_HOMEPAGE in versions.cmake")
endif()
endif()
set(TABLE_CONTENTS "${TABLE_CONTENTS}| `${DEP_NAME}` | `${DEP_VERSION}` | <${DEP_HOMEPAGE}> |\n")
endif()
endforeach()
# Create a list of dependencies for each library
set(DEPS_CONTENTS "")
get_property(targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
foreach(target ${targets})
string(REPLACE "external_" "" target_name ${target})
get_target_property(deps ${target} MANUALLY_ADDED_DEPENDENCIES)
if(NOT deps)
list(APPEND NO_DEP_LIBS ${target_name})
continue()
endif()
set(DEPS_CONTENTS "${DEPS_CONTENTS}```\n")
set(DEPS_CONTENTS "${DEPS_CONTENTS}└── ${target_name}\n")
list(LENGTH deps nr_of_deps)
foreach(dep ${deps})
string(REPLACE "external_" "" dep_name ${dep})
math(EXPR nr_of_deps "${nr_of_deps} - 1")
if(nr_of_deps)
set(DEPS_CONTENTS "${DEPS_CONTENTS} ├── ${dep_name}\n")
else()
set(DEPS_CONTENTS "${DEPS_CONTENTS} └── ${dep_name}\n")
endif()
list(APPEND USED_DEPS ${dep_name})
endforeach()
set(DEPS_CONTENTS "${DEPS_CONTENTS}```\n")
endforeach()
set(DEPS_CONTENTS "${DEPS_CONTENTS}Libraries without any dependencies and not used by any other library:\n```\n")
list(REMOVE_DUPLICATES USED_DEPS)
foreach(no_dep_target ${NO_DEP_LIBS})
if(NOT ${no_dep_target} IN_LIST USED_DEPS)
set(DEPS_CONTENTS "${DEPS_CONTENTS}${no_dep_target}\n")
endif()
endforeach()
set(DEPS_CONTENTS "${DEPS_CONTENTS}```\n")
configure_file(${CMAKE_SOURCE_DIR}/cmake/deps.md.in ${HARVEST_TARGET}/deps.md @ONLY)

View File

@@ -0,0 +1,196 @@
# SPDX-FileCopyrightText: 2021-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
## Update and uncomment this in the release branch
set(BLENDER_VERSION 5.2)
function(download_source dep)
set(TARGET_FILE ${${dep}_FILE})
set(TARGET_HASH_TYPE ${${dep}_HASH_TYPE})
set(TARGET_HASH ${${dep}_HASH})
if(PACKAGE_USE_UPSTREAM_SOURCES)
set(TARGET_URI ${${dep}_URI})
elseif(BLENDER_VERSION)
set(TARGET_URI https://projects.blender.org/blender/lib-source/media/branch/blender-v${BLENDER_VERSION}-release/${TARGET_FILE})
else()
set(TARGET_URI https://projects.blender.org/blender/lib-source/media/branch/main/${TARGET_FILE})
endif()
# Validate all required variables are set and give an explicit error message
# rather than CMake erroring out later on with a more ambiguous error.
if(NOT DEFINED TARGET_FILE)
message(FATAL_ERROR "${dep}_FILE variable not set")
endif()
if(NOT DEFINED TARGET_HASH)
message(FATAL_ERROR "${dep}_HASH variable not set")
endif()
if(NOT DEFINED TARGET_HASH_TYPE)
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
endif()
if(NOT DEFINED TARGET_URI)
message(FATAL_ERROR "${dep}_URI variable not set")
endif()
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
message(STATUS "Checking source : ${dep} (${TARGET_FILE})")
if(NOT EXISTS ${TARGET_FILE})
message(STATUS "Checking source : ${dep} - source not found downloading from ${TARGET_URI}")
file(
DOWNLOAD ${TARGET_URI} ${TARGET_FILE}
TIMEOUT 1800 # seconds
EXPECTED_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
TLS_VERIFY ON
SHOW_PROGRESS
)
endif()
if(EXISTS ${TARGET_FILE})
# Sometimes the download fails, but that is not a
# fail condition for "file(DOWNLOAD" it will warn about
# a CRC mismatch and just carry on, we need to explicitly
# catch this and remove the bogus 0 byte file so we can
# retry without having to go find the file and manually
# delete it.
file(SIZE ${TARGET_FILE} TARGET_SIZE)
if(${TARGET_SIZE} EQUAL 0)
file(REMOVE ${TARGET_FILE})
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")
endif()
# If we are using sources from the blender repo also
# validate that the hashes match, this takes a
# little more time, but protects us when we are
# building a release package and one of the packages
# is missing or incorrect.
#
# For regular platform maintenance this is not needed
# since the actual build of the dep will notify the
# platform maintainer if there is a problem with the
# source package and refuse to build.
if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH)
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
message(FATAL_ERROR
"${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\n"
"Expected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}"
)
endif()
endif()
endif()
endfunction(download_source)
download_source(ZLIB)
download_source(OPENAL)
download_source(PNG)
download_source(JPEG)
download_source(BLOSC)
download_source(PTHREADS)
download_source(OPENEXR)
download_source(FREETYPE)
download_source(EPOXY)
download_source(ALEMBIC)
download_source(OPENSUBDIV)
download_source(SDL)
download_source(OPENCOLORIO)
download_source(MINIZIPNG)
download_source(LLVM)
download_source(OPENIMAGEIO)
download_source(TIFF)
download_source(OSL)
download_source(PYTHON)
download_source(TBB)
download_source(OPENVDB)
download_source(CYTHON)
download_source(ZSTANDARD)
download_source(NUMPY)
download_source(LAME)
download_source(OGG)
download_source(VORBIS)
download_source(THEORA)
download_source(FLAC)
download_source(VPX)
download_source(OPUS)
download_source(X264)
download_source(X265)
download_source(OPENJPEG)
download_source(FFMPEG)
download_source(FFTW)
download_source(ICONV)
download_source(SNDFILE)
download_source(WEBP)
download_source(SPNAV)
download_source(XML2)
download_source(YAMLCPP)
download_source(EXPAT)
download_source(PUGIXML)
download_source(FLEXBISON)
download_source(BZIP2)
download_source(FFI)
download_source(LZMA)
download_source(SSL)
download_source(SQLITE)
download_source(EMBREE)
download_source(USD)
download_source(MATERIALX)
download_source(OIDN)
download_source(NASM)
download_source(XR_OPENXR_SDK)
download_source(WL_PROTOCOLS)
download_source(WAYLAND)
download_source(WAYLAND_WESTON)
download_source(ISPC)
download_source(GMP)
download_source(POTRACE)
download_source(HARU)
download_source(ZSTD)
download_source(SSE2NEON)
download_source(FLEX)
download_source(BROTLI)
download_source(FMT)
download_source(ROBINMAP)
download_source(IMATH)
download_source(PYSTRING)
download_source(OPENPGL)
download_source(LEVEL_ZERO)
download_source(DPCPP)
download_source(VCINTRINSICS)
download_source(OPENCLHEADERS)
download_source(ICDLOADER)
download_source(EMHASH)
download_source(DPCPP_SPIRV_HEADERS)
download_source(UNIFIED_MEMORY_FRAMEWORK)
download_source(PARALLEL_HASHMAP)
download_source(IGC)
download_source(IGC_LLVM)
download_source(IGC_OPENCL_CLANG)
download_source(IGC_VCINTRINSICS)
download_source(IGC_SPIRV_HEADERS)
download_source(IGC_SPIRV_TOOLS)
download_source(IGC_SPIRV_TRANSLATOR)
download_source(GMMLIB)
download_source(OCLOC)
download_source(AOM)
download_source(FRIBIDI)
download_source(HARFBUZZ)
download_source(SHADERC)
download_source(SHADERC_GLSLANG)
download_source(VULKAN_HEADERS)
download_source(VULKAN_LOADER)
download_source(VULKAN_UTILITY_LIBRARIES)
download_source(SPIRV_HEADERS)
download_source(SPIRV_REFLECT)
download_source(SPIRV_TOOLS)
download_source(VULKAN_MEMORY_ALLOCATOR)
download_source(PYBIND11)
download_source(DEFLATE)
download_source(HIPRT)
download_source(NANOBIND)
download_source(MANIFOLD)
download_source(RUBBERBAND)
download_source(OPENJPH)
download_source(THORVG)
download_source(LIBHEIF)
download_source(ABSEIL)
download_source(EIGEN)
download_source(CERES)
download_source(DRACO)
download_source(MESHOPTIMIZER)
download_source(TRACY)

View File

@@ -0,0 +1,253 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
string(REPLACE "-DCMAKE_CXX_STANDARD=20" " " DPCPP_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
# DPCPP already generates debug libs, there isn't much point in compiling it in debug mode itself.
string(REPLACE "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_BUILD_TYPE=Release" DPCPP_CMAKE_FLAGS "${DPCPP_CMAKE_FLAGS}")
if(WIN32)
set(LLVM_GENERATOR "Ninja")
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
set(DPCPP_CONFIGURE_ARGS
# When external deps dpcpp needs are not found it will automatically
# download them during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build error beats a compliance
# violation
--cmake-opt FETCHCONTENT_FULLY_DISCONNECTED=ON
)
set(DPCPP_SOURCE_ROOT ${BUILD_DIR}/dpcpp/src/external_dpcpp/)
set(DPCPP_EXTRA_ARGS
# When external deps dpcpp needs are not found it will automatically
# download them during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build or configure error
# beats a compliance violation
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
# Pre-built dependency paths (project-specific, not from configure.py)
# In addition to this, we are setting some additional parameters,
# which are not covered by configure.py, but which we plan to use
# in order to meet some Blender needs, for example, disabling
# HWLOC dependency/library from being used. Some of these variables
# are even connected to our dpcpp.patch changes and require them
# to work properly.
-DLLVMGenXIntrinsics_SOURCE_DIR=${BUILD_DIR}/vcintrinsics/src/external_vcintrinsics/
-DOpenCL_HEADERS=file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
-DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE}
-DSYCL_EMHASH_DIR=${LIBDIR}/emhash/include
-DEMHASH_SYS_LOC=${LIBDIR}/emhash/include/emhash
-DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT}
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include/level_zero
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/dpcpp_spirvheaders/src/external_dpcpp_spirvheaders/
# See an explanation above about compliance for the two following cmake arguments
-DSYCL_UR_USE_FETCH_CONTENT=OFF
-DUR_COMPUTE_RUNTIME_FETCH_REPO=OFF
-DFETCHCONTENT_SOURCE_DIR_UNIFIED-MEMORY-FRAMEWORK=${BUILD_DIR}/unifiedmemoryframework/src/external_unifiedmemoryframework/
-DSYCL_UMF_DISABLE_HWLOC=ON
-DUMF_DISABLE_HWLOC=ON
-DUMF_BUILD_SHARED_LIBRARY=OFF
# These two options are from configure.py, but they are left here for now for the better
# readability of the changes - they would be moved downward in the future refactoring.
-DSYCL_ENABLE_XPTI_TRACING=ON
# [CHANGED] We do not need to build tests for our purposes
-DSYCL_INCLUDE_TESTS=OFF
-DUR_ENABLE_TRACING=ON
-DXPTIFW_PARALLEL_HASHMAP_HEADERS=${LIBDIR}/parallelhashmap/include
# Below here is copied from an invocation of buildbot/configure.py with
# arguments "--use-zstd --disable-preview-lib --host-target=x86"
# Note: --print-cmake-variables is not a real cmake flag, it was just used
# to cause all parameters to be printed and then cause exit prematurely.
#
# The original generated arguments were this:
# >"C:\db\build\output\Win64_vc15\python\313\bin\python.exe" buildbot\configure.py --use-zstd --disable-preview-lib --disable-jit --host-target=x86 --print-cmake-variables
# args:Namespace(build_number=None, branch=None, base_branch=None, pr_number=None, builder_dir=None, src_dir=None, obj_dir=None, l0_headers=None, l0_loader=None, build_type='Release', cuda=False, native_cpu=False, hip=False, hip_platform='AMD', level_zero_adapter_version='ALL', host_target='x86', enable_all_llvm_targets=False, no_assertions=False, docs=False, werror=False, shared_libs=False, cmake_opt=None, cmake_gen='Ninja', use_libcxx=False, libcxx_include=None, libcxx_library=None, use_lld=False, llvm_external_projects=None, ci_defaults=False, enable_backends=None, disable_preview_lib=True, disable_jit=True, add_security_flags=None, native_cpu_libclc_targets=None, use_zstd=True)
# [Cmake Command]:
# cmake
# -G Ninja
# -DCMAKE_BUILD_TYPE=Release
# -DLLVM_ENABLE_ASSERTIONS=ON
# -DLLVM_TARGETS_TO_BUILD=x86
# '-DLLVM_EXTERNAL_PROJECTS=sycl;llvm-spirv;opencl;xpti;xptifw;libdevice'
# '-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=C:\Repos\llvm-6.3.0\sycl'
# '-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=C:\Repos\llvm-6.3.0\llvm-spirv'
# '-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=C:\Repos\llvm-6.3.0\xpti'
# '-DXPTI_SOURCE_DIR=C:\Repos\llvm-6.3.0\xpti'
# '-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=C:\Repos\llvm-6.3.0\xptifw'
# '-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=C:\Repos\llvm-6.3.0\libdevice'
# '-DLLVM_EXTERNAL_SYCL_JIT_SOURCE_DIR=C:\Repos\llvm-6.3.0\sycl-jit'
# '-DLLVM_ENABLE_PROJECTS=clang;sycl;llvm-spirv;opencl;xpti;xptifw;libdevice;lld'
# -DSYCL_BUILD_PI_HIP_PLATFORM=AMD
# -DLLVM_BUILD_TOOLS=ON
# -DLLVM_ENABLE_ZSTD=FORCE_ON
# -DLLVM_USE_STATIC_ZSTD=ON
# -DSYCL_ENABLE_WERROR=OFF
# '-DCMAKE_INSTALL_PREFIX=C:\Repos\llvm-6.3.0\build\install'
# -DSYCL_INCLUDE_TESTS=ON
# -DLLVM_ENABLE_DOXYGEN=OFF
# -DLLVM_ENABLE_SPHINX=OFF
# -DBUILD_SHARED_LIBS=OFF
# -DSYCL_ENABLE_XPTI_TRACING=ON
# -DLLVM_ENABLE_LLD=OFF
# -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=OFF
# -DXPTI_ENABLE_WERROR=OFF
# -DSYCL_CLANG_EXTRA_FLAGS=
# '-DSYCL_ENABLE_BACKENDS=level_zero_v2;level_zero;opencl'
# -DSYCL_ENABLE_EXTENSION_JIT=OFF
# -DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB=OFF
# -DBUG_REPORT_URL=https://github.com/intel/llvm/issues
# 'C:\Repos\llvm-6.3.0\llvm'
# --print-cmake-variables
# CMake Error: Unknown argument --print-cmake-variables
# CMake Error: Run 'cmake --help' for all supported options.
# >
#
# All cmake parameters from the list above, which we set with
# non-default options are marked as [CHANGED]. Other parameters,
# not from the list above do not have this mark regardless of
# their values.
# -DCMAKE_BUILD_TYPE=Release # set by ExternalProject_Add
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_TARGETS_TO_BUILD=X86
# Note: lld/clang are in-tree LLVM projects, only listed in ENABLE_PROJECTS.
-DLLVM_EXTERNAL_PROJECTS=sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/sycl
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/llvm-spirv
-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DXPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xptifw
-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/libdevice
-DLLVM_ENABLE_PROJECTS=clang^^sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw^^lld
# [ADDED] Not from configure.py. These arguments disable libclc (not needed for Level Zero)
# and will be moved downward in future refactoring.
-DLIBCLC_TARGETS_TO_BUILD=
-DLIBCLC_GENERATE_REMANGLED_VARIANTS=OFF
-DSYCL_BUILD_PI_HIP_PLATFORM=AMD
-DLLVM_BUILD_TOOLS=ON
-DSYCL_ENABLE_WERROR=OFF
# -DCMAKE_INSTALL_PREFIX=... # set by ExternalProject_Add
# [CHANGED] Tests disabled (configure.py default: ON)
-DLLVM_ENABLE_DOXYGEN=OFF
-DLLVM_ENABLE_SPHINX=OFF
-DBUILD_SHARED_LIBS=OFF
-DLLVM_ENABLE_LLD=OFF
-DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=OFF
-DXPTI_ENABLE_WERROR=OFF
-DSYCL_CLANG_EXTRA_FLAGS=
# [CHANGED] Removed opencl backend; we only target Level Zero.
# configure.py default: level_zero;opencl;level_zero_v2
# Previously this option was called SYCL_ENABLE_PLUGINS
-DSYCL_ENABLE_BACKENDS=level_zero_v2^^level_zero
-DSYCL_ENABLE_EXTENSION_JIT=OFF
-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB=OFF
# -DBUG_REPORT_URL=... # omitted, cosmetic
# Additional project-specific flags (not from configure.py)
-DCMAKE_INSTALL_RPATH=\$ORIGIN
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DLLDB_ENABLE_CURSES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_ENABLE_ZLIB=OFF
# The following two are from configure.py, but left here for now for better
# readability of the changes - they will be moved upward in future refactoring.
-DLLVM_ENABLE_ZSTD=FORCE_ON
-DLLVM_USE_STATIC_ZSTD=ON
-Dzstd_INCLUDE_DIR=${LIBDIR}/zstd/include
)
if(WIN32)
list(APPEND DPCPP_EXTRA_ARGS
-DPython3_FIND_REGISTRY=NEVER
-Dzstd_LIBRARY=${LIBDIR}/zstd/lib/zstd_static.lib
)
else()
list(APPEND DPCPP_EXTRA_ARGS
-Dzstd_LIBRARY=${LIBDIR}/zstd/lib/libzstd.a
)
endif()
ExternalProject_Add(external_dpcpp
URL file://${PACKAGE_DIR}/${DPCPP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${DPCPP_HASH_TYPE}=${DPCPP_HASH}
PREFIX ${BUILD_DIR}/dpcpp
CMAKE_GENERATOR ${LLVM_GENERATOR}
SOURCE_SUBDIR llvm
LIST_SEPARATOR ^^
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp
${DPCPP_CMAKE_FLAGS}
${DPCPP_EXTRA_ARGS}
# CONFIGURE_COMMAND
# ${PYTHON_BINARY}
# ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
# BUILD_COMMAND
# echo "." # ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/dpcpp/src/external_dpcpp <
${PATCH_DIR}/dpcpp.diff &&
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/dpcpp/src/external_dpcpp <
${PATCH_DIR}/dpcpp_backport_21050.diff &&
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/dpcpp/src/external_dpcpp <
${PATCH_DIR}/dpcpp_backport_21490.diff
INSTALL_DIR ${LIBDIR}/dpcpp
)
add_dependencies(
external_dpcpp
external_python
external_python_site_packages
external_vcintrinsics
external_openclheaders
external_icdloader
external_emhash
external_level-zero
external_dpcpp_spirvheaders
external_unifiedmemoryframework
external_zstd
external_parallelhashmap
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_dpcpp after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/dpcpp ${HARVEST_TARGET}/dpcpp
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/clang-cl.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/clang-cpp.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/ld.lld.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/ld64.lld.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/lld.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/lld-link.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/wasm-ld.exe
DEPENDEES install
)
endif()
else()
harvest(external_dpcpp dpcpp/bin dpcpp/bin "*")
harvest(external_dpcpp dpcpp/include dpcpp/include "*")
harvest(external_dpcpp dpcpp/lib dpcpp/lib "libsycl*")
harvest(external_dpcpp dpcpp/lib dpcpp/lib "libxpti*")
harvest(external_dpcpp dpcpp/lib dpcpp/lib "libur*")
harvest(external_dpcpp dpcpp/lib/clang dpcpp/lib/clang "*")
endif()

View File

@@ -0,0 +1,66 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# These are build time requirements for dpcpp
# We only have to unpack these dpcpp will build
# them.
ExternalProject_Add(external_vcintrinsics
URL file://${PACKAGE_DIR}/${VCINTRINSICS_FILE}
URL_HASH ${VCINTRINSICS_HASH_TYPE}=${VCINTRINSICS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/vcintrinsics
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# opencl headers do not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opportunity to validate
# the hash is correct.
ExternalProject_Add(external_openclheaders
URL file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
URL_HASH ${OPENCLHEADERS_HASH_TYPE}=${OPENCLHEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/openclheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# icdloader does not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opportunity to validate
# the hash is correct.
ExternalProject_Add(external_icdloader
URL file://${PACKAGE_DIR}/${ICDLOADER_FILE}
URL_HASH ${ICDLOADER_HASH_TYPE}=${ICDLOADER_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/icdloader
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_dpcpp_spirvheaders
URL file://${PACKAGE_DIR}/${DPCPP_SPIRV_HEADERS_FILE}
URL_HASH ${DPCPP_SPIRV_HEADERS_HASH_TYPE}=${DPCPP_SPIRV_HEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/dpcpp_spirvheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_unifiedmemoryframework
URL file://${PACKAGE_DIR}/${UNIFIED_MEMORY_FRAMEWORK_FILE}
URL_HASH ${UNIFIED_MEMORY_FRAMEWORK_HASH_TYPE}=${UNIFIED_MEMORY_FRAMEWORK_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/unifiedmemoryframework
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/unifiedmemoryframework/src/external_unifiedmemoryframework <
${PATCH_DIR}/unifiedmemoryframework.diff
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)

View File

@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: 2026 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(DRACO_EXTRA_ARGS
-DBUILD_SHARED_LIBS=ON
)
if(WIN32)
set(DRACO_EXTRA_ARGS
${DRACO_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
endif()
ExternalProject_Add(external_draco
URL file://${PACKAGE_DIR}/${DRACO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${DRACO_HASH_TYPE}=${DRACO_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/draco
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/draco
${DEFAULT_CMAKE_FLAGS}
${DRACO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/draco
)
if(WIN32)
ExternalProject_Add_Step(external_draco after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/draco/
${HARVEST_TARGET}/draco
DEPENDEES install
)
else()
harvest(external_draco draco/include draco/include "*.h")
# CMake files first because harvest_rpath_lib edits them. Move from share/cmake to lib/cmake for set_rpath.py to find them.
harvest(external_draco draco/share/cmake/draco draco/lib/cmake/draco "*.cmake")
harvest_rpath_lib(external_draco draco/lib draco/lib "*${SHAREDLIBEXT}*")
# Draco unconditionally builds as a static library, harvest it to satisfy the CMake config target.
harvest(external_draco draco/lib draco/lib "*.a")
endif()

View File

@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: 2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(EIGEN_EXTRA_ARGS
-DBUILD_TESTING=OFF
-DEIGEN_BUILD_DOC=OFF
-DTBB_DIR=${LIBDIR}/tbb/lib/cmake/TBB
)
ExternalProject_Add(external_eigen
URL file://${PACKAGE_DIR}/${EIGEN_FILE}
URL_HASH ${EIGEN_HASH_TYPE}=${EIGEN_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/eigen
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/eigen/src/external_eigen <
${PATCH_DIR}/eigen_tbb_support.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/eigen
${DEFAULT_CMAKE_FLAGS}
${EIGEN_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/eigen
)
if(WIN32)
# While C++ eigen is a header only library
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_eigen after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/eigen
${HARVEST_TARGET}/eigen
DEPENDEES install
)
endif()
else()
# Eigen has files without extensions in the include directory that it needs so no *.h wildcard
harvest(external_eigen eigen/include eigen/include "*")
# Extra / at the end to ensure that harvest doesn't ignore the cmake directory
harvest(external_eigen eigen/share/eigen3/cmake/ eigen/share/eigen3/cmake/ "*.cmake")
endif()

View File

@@ -0,0 +1,154 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(EMBREE_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
set(EMBREE_EXTRA_ARGS
-DEMBREE_ISPC_SUPPORT=OFF
-DEMBREE_TUTORIALS=OFF
-DEMBREE_STATIC_LIB=OFF
-DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_BACKFACE_CULLING_CURVES=ON
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
)
if(WIN32)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
endif()
if(NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2
)
endif()
if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM)
if(WIN32)
# Levels below -O2 don't work well for Embree+SYCL.
string(REGEX REPLACE "-O[A-Za-z0-9]" "" EMBREE_CLANG_CMAKE_CXX_FLAGS_DEBUG ${BLENDER_CLANG_CMAKE_CXX_FLAGS_DEBUG})
string(APPEND EMBREE_CLANG_CMAKE_CXX_FLAGS_DEBUG " -O2")
string(REGEX REPLACE "-O[A-Za-z0-9]" "" EMBREE_CLANG_CMAKE_C_FLAGS_DEBUG ${BLENDER_CLANG_CMAKE_C_FLAGS_DEBUG})
string(APPEND EMBREE_CLANG_CMAKE_C_FLAGS_DEBUG " -O2")
set(EMBREE_CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=${BUILD_MODE}
-DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CLANG_CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CLANG_CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${BLENDER_CLANG_CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_FLAGS_DEBUG=${EMBREE_CLANG_CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_RELEASE=${BLENDER_CLANG_CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_MINSIZEREL=${BLENDER_CLANG_CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${BLENDER_CLANG_CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_C_FLAGS_DEBUG=${EMBREE_CLANG_CMAKE_C_FLAGS_DEBUG}
-DCMAKE_CXX_STANDARD=17
)
set(EMBREE_EXTRA_ARGS
-DCMAKE_CXX_COMPILER=${LIBDIR}/dpcpp/bin/clang++.exe
-DCMAKE_C_COMPILER=${LIBDIR}/dpcpp/bin/clang.exe
-DCMAKE_SHARED_LINKER_FLAGS=-L"${LIBDIR}/dpcpp/lib"
-DEMBREE_SYCL_SUPPORT=ON
${EMBREE_EXTRA_ARGS}
)
else()
string(REPLACE "-DCMAKE_CXX_STANDARD=20" " " EMBREE_CMAKE_FLAGS "${EMBREE_CMAKE_FLAGS}")
set(EMBREE_EXTRA_ARGS
-DCMAKE_CXX_COMPILER=${LIBDIR}/dpcpp/bin/clang++
-DCMAKE_C_COMPILER=${LIBDIR}/dpcpp/bin/clang
-DCMAKE_SHARED_LINKER_FLAGS=-L"${LIBDIR}/dpcpp/lib"
-DEMBREE_SYCL_SUPPORT=ON
${EMBREE_EXTRA_ARGS}
)
endif()
endif()
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_TBB_COMPONENT=tbb_static
)
endif()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/embree/src/external_embree <
${PATCH_DIR}/embree.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree
${EMBREE_CMAKE_FLAGS}
${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
if(NOT APPLE AND NOT BLENDER_PLATFORM_ARM)
add_dependencies(
external_embree
external_tbb
external_dpcpp
)
else()
add_dependencies(
external_embree
external_tbb
)
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Release)
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/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
)
else()
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/embree4_d.lib
${HARVEST_TARGET}/embree/lib/embree4_d.lib
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/embree/lib/embree4_sycl_d.lib
${HARVEST_TARGET}/embree/lib/embree4_sycl_d.lib
DEPENDEES install
)
endif()
else()
harvest(external_embree embree/include embree/include "*.h")
harvest(external_embree embree/lib embree/lib "*.a")
harvest_rpath_lib(external_embree embree/lib embree/lib "*${SHAREDLIBEXT}*")
endif()

View File

@@ -0,0 +1,146 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(EMBREE_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
set(EMBREE_EXTRA_ARGS
-DEMBREE_ISPC_SUPPORT=OFF
-DEMBREE_TUTORIALS=OFF
-DEMBREE_STATIC_LIB=OFF
-DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_BACKFACE_CULLING_CURVES=ON
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
-DEMBREE_NO_SPLASH=ON
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
-DCOMPILER_HAS_SYCL_SUPPORT=OFF
)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
set(EMBREE_LLVM_INSTALL_PATH ${LIBDIR}/llvm)
set(EMBREE_CMAKE_FLAGS
-DCMAKE_BUILD_TYPE=${BUILD_MODE}
)
set(EMBREE_EXTRA_ARGS
-DCMAKE_CXX_COMPILER=${EMBREE_LLVM_INSTALL_PATH}/bin/clang-cl.exe
-DCMAKE_C_COMPILER=${EMBREE_LLVM_INSTALL_PATH}/bin/clang-cl.exe
-DCMAKE_C_FLAGS_INIT="--target=arm64-pc-windows-msvc"
-DCMAKE_CXX_FLAGS_INIT="--target=arm64-pc-windows-msvc"
-DCMAKE_SHARED_LINKER_FLAGS=-L"${LIBDIR}/llvm/lib"
${EMBREE_EXTRA_ARGS}
)
# We want the VS2019 tools for embree, as they are stable.
# We cannot use VS2022 easily, unless we specify an older (unsupported) toolset such as 17.35,
# as the newer toolsets mandate LLVM 16, which we cannot use currently,
# due to lack of support in OSL and ISPC.
set(EMBREE_VCTOOLS_REQUIRED_VERSION 14.29)
# Extract the list of installed tools that match the required version from the
# `VCToolsInstallDir` env var
file(TO_CMAKE_PATH $ENV{VCToolsInstallDir} EMBREE_VCTOOLSINSTALLDIR_PATH)
cmake_path(GET EMBREE_VCTOOLSINSTALLDIR_PATH PARENT_PATH EMBREE_VCTOOLSDIR_PATH)
file(GLOB EMBREE_INSTALLED_VCTOOLS RELATIVE ${EMBREE_VCTOOLSDIR_PATH} ${EMBREE_VCTOOLSDIR_PATH}/${EMBREE_VCTOOLS_REQUIRED_VERSION}*)
# Check that at least one of the installed tool versions
# (there may be different subversions) is present.
if(NOT EMBREE_INSTALLED_VCTOOLS)
message(FATAL_ERROR
"When building for Windows ARM64 platforms, embree requires VC Tools "
"${EMBREE_VCTOOLS_REQUIRED_VERSION} to be installed alongside the current version."
)
endif()
# Get the last item in the list (latest, when list is sorted)
list(SORT EMBREE_INSTALLED_VCTOOLS)
list(GET EMBREE_INSTALLED_VCTOOLS -1 EMBREE_VCTOOLS_VERSION)
# Configure our in file and temporarily store it in the build dir
# (with modified extension so nothing else picks it up)
# This feels icky, but we haven't called `ExternalProject_Add` yet,
# so the embree dir does not yet exist.
configure_file(
${PATCH_DIR}/embree_Directory.Build.Props.in
${BUILD_DIR}/embree_Directory.Build.Props_temp
)
# Update the patch command to copy the configured build props file in
set(EMBREE_PATCH_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/embree_Directory.Build.Props_temp
${BUILD_DIR}/embree/src/external_embree-build/Directory.Build.Props &&
${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
)
# This all only works if we use the VS generator (with `clangcl` toolset), so switch back to that
# Note: there is literally no way to get ninja to use a different toolset other than manually
# overwriting every env var, or calling a nested `vcvarsall`, both of which are *messy*.
set(EMBREE_GENERATOR ${CMAKE_GENERATOR})
set(EMBREE_GENERATOR_TOOLSET ClangCL)
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_TBB_COMPONENT=tbb_static
)
endif()
ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH}
CMAKE_GENERATOR ${EMBREE_GENERATOR}
CMAKE_GENERATOR_TOOLSET ${EMBREE_GENERATOR_TOOLSET}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${EMBREE_PATCH_COMMAND}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${EMBREE_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
add_dependencies(
external_embree
external_tbb
external_llvm
)
if(BUILD_MODE STREQUAL Release)
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/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
)
else()
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/embree4_d.lib
${HARVEST_TARGET}/embree/lib/embree4_d.lib
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(EMHASH_EXTRA_ARGS
-DWITH_BENCHMARKS=OFF
)
ExternalProject_Add(external_emhash
URL file://${PACKAGE_DIR}/${EMHASH_FILE}
URL_HASH ${EMHASH_HASH_TYPE}=${EMHASH_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/emhash
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/emhash/src/external_emhash <
${PATCH_DIR}/emhash.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/emhash
${DEFAULT_CMAKE_FLAGS}
${EMHASH_EXTRA_ARGS}
)

View File

@@ -0,0 +1,63 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(EPOXY_LIB_TYPE shared)
else()
set(EPOXY_LIB_TYPE static)
endif()
set(EPOXY_EXTRA_OPTIONS
-Dtests=false
)
ExternalProject_Add(external_epoxy
URL file://${PACKAGE_DIR}/${EPOXY_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH}
PREFIX ${BUILD_DIR}/epoxy
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d
${BUILD_DIR}/epoxy/src/external_epoxy/ <
${PATCH_DIR}/epoxy.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
${MESON} setup
--prefix ${LIBDIR}/epoxy
--libdir lib
--default-library ${EPOXY_LIB_TYPE}
${MESON_BUILD_TYPE}
${EPOXY_EXTRA_OPTIONS}
${BUILD_DIR}/epoxy/src/external_epoxy-build
${BUILD_DIR}/epoxy/src/external_epoxy
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)
add_dependencies(
external_epoxy
# Needed for `MESON`.
external_python_site_packages
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_epoxy after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/epoxy/include
${HARVEST_TARGET}/epoxy/include
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/epoxy/bin/epoxy-0.dll
${HARVEST_TARGET}/epoxy/bin/epoxy-0.dll
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/epoxy/lib/epoxy.lib
${HARVEST_TARGET}/epoxy/lib/epoxy.lib
DEPENDEES install
)
endif()
else()
harvest(external_epoxy epoxy/include epoxy/include "*.h")
harvest(external_epoxy epoxy/lib epoxy/lib "*.a")
endif()

View File

@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(EXPAT_EXTRA_ARGS
-DEXPAT_BUILD_DOCS=OFF
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_SHARED_LIBS=OFF
)
ExternalProject_Add(external_expat
URL file://${PACKAGE_DIR}/${EXPAT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EXPAT_HASH_TYPE}=${EXPAT_HASH}
PREFIX ${BUILD_DIR}/expat
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/expat
${DEFAULT_CMAKE_FLAGS}
${EXPAT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/expat
SOURCE_SUBDIR expat
)

View File

@@ -0,0 +1,100 @@
# SPDX-FileCopyrightText: 2002-2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
if(BLENDER_PLATFORM_WINDOWS_ARM)
set(FFI_TARGET_HOST aarch64-w64-mingw32)
set(FFI_PYTHON_TARGET_ARCH arm64)
set(FFI_MSVC_SH_FLAGS -marm64)
else()
set(FFI_TARGET_HOST x86_64-w64-mingw32)
set(FFI_PYTHON_TARGET_ARCH amd64)
set(FFI_MSVC_SH_FLAGS -m64)
endif()
set(CONFIGURE_ENV_FFI ${CONFIGURE_ENV} &&
set CC=${BUILD_DIR}/ffi/src/external_ffi/msvcc.sh ${FFI_MSVC_SH_FLAGS} &&
set CXX=${BUILD_DIR}/ffi/src/external_ffi/msvcc.sh ${FFI_MSVC_SH_FLAGS} &&
set LD=link &&
set CPP=cl -nologo -EP &&
set CXXCPP=cl -nologo -EP &&
set CPPFLAGS=-DFFI_BUILDING_DLL
)
# `make install` just refuses to do its job without erroring
# out, "fine ,then don't". We'll pick the files we need ourselves
# from the build folder in the after install cmake step.
set(FFI_INSTALL echo .)
set(FFI_EXTRA_ARGS
--disable-docs
--disable-multi-os-directory
--enable-shared=yes
--enable-static=no
--build=${FFI_TARGET_HOST}
--host=${FFI_TARGET_HOST}
)
else()
set(CONFIGURE_ENV_FFI ${CONFIGURE_ENV})
set(FFI_INSTALL make install)
set(FFI_EXTRA_ARGS
--disable-multi-os-directory
--enable-shared=no
--enable-static=yes
--with-pic
)
endif()
ExternalProject_Add(external_ffi
URL file://${PACKAGE_DIR}/${FFI_FILE}
URL_HASH ${FFI_HASH_TYPE}=${FFI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ffi
CONFIGURE_COMMAND ${CONFIGURE_ENV_FFI} &&
cd ${BUILD_DIR}/ffi/src/external_ffi/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ffi
--libdir=${LIBDIR}/ffi/lib/
${FFI_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_FFI} &&
cd ${BUILD_DIR}/ffi/src/external_ffi/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/ffi/src/external_ffi/ &&
${FFI_INSTALL}
INSTALL_DIR ${LIBDIR}/ffi
)
if(UNIX AND NOT APPLE)
ExternalProject_Add_Step(external_ffi after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/ffi/lib/libffi.a
${LIBDIR}/ffi/lib/libffi_pic.a
DEPENDEES install
)
elseif(WIN32)
# Since there are currently no other consumers of ffi
# we populate the libdir in the way python wants to see
# it so we don't have to do this later on in the build
ExternalProject_Add_Step(external_ffi after_install
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/ffi/src/external_ffi/${FFI_TARGET_HOST}/.libs/libffi-8.dll
${LIBDIR}/ffi/${FFI_PYTHON_TARGET_ARCH}/libffi-8.dll
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/ffi/src/external_ffi/${FFI_TARGET_HOST}/.libs/libffi-8.lib
${LIBDIR}/ffi/${FFI_PYTHON_TARGET_ARCH}/libffi-8.lib
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/ffi/src/external_ffi/${FFI_TARGET_HOST}/include/ffi.h
${LIBDIR}/ffi/${FFI_PYTHON_TARGET_ARCH}/include/ffi.h
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/ffi/src/external_ffi/${FFI_TARGET_HOST}/include/ffitarget.h
${LIBDIR}/ffi/${FFI_PYTHON_TARGET_ARCH}/include/ffitarget.h
COMMAND ${CMAKE_COMMAND} -E copy
${BUILD_DIR}/ffi/src/external_ffi/${FFI_TARGET_HOST}/fficonfig.h
${LIBDIR}/ffi/${FFI_PYTHON_TARGET_ARCH}/include/fficonfig.h
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,283 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(NOT WIN32)
set(temp_LIBDIR ${LIBDIR})
set(LIBDIR_FLAG "-L")
else()
set(temp_LIBDIR ${msys2_LIBDIR})
set(LIBDIR_FLAG "-LIBPATH:")
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}/zlib/include \
-I${temp_LIBDIR}/aom/include \
-I${temp_LIBDIR}/x265/include"
)
set(FFMPEG_LDFLAGS "\
${LIBDIR_FLAG}${temp_LIBDIR}/lame/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/openjpeg/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/ogg/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/vorbis/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/theora/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/opus/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/vpx/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/x264/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/x265/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/zlib/lib \
${LIBDIR_FLAG}${temp_LIBDIR}/aom/lib"
)
set(FFMPEG_PATCH_FILE "")
if(WIN32)
set(FFMPEG_CFLAGS "\
${FFMPEG_CFLAGS} \
-I${temp_LIBDIR}/openjpeg_msvc/include/openjpeg-2.5 \
-I${temp_LIBDIR}/opus/include/opus \
-DOPJ_STATIC \
-MD \
-UHAVE_UNISTD_H"
)
set(FFMPEG_LDFLAGS "\
${FFMPEG_LDFLAGS} \
${LIBDIR_FLAG}${temp_LIBDIR}/openjpeg_msvc/lib \
ucrt.lib"
)
# As we now use MSVC on windows, pkgconfig is not really a viable option for many packages
# so this patch removes those checks in favour of looking for the libs directly.
set(FFMPEG_PATCH_FILE ${PATCH_DIR}/ffmpeg_windows.diff)
else()
# OpenJpeg is compiled with pthread support on Linux, which is all fine and is what we
# want for maximum runtime performance, but due to static nature of that library we
# need to force ffmpeg to link against pthread, otherwise test program used by autoconf
# will fail. This patch does that in a way that is compatible with multiple distributions.
set(FFMPEG_PATCH_FILE ${PATCH_DIR}/ffmpeg.diff)
endif()
set(FFMPEG_EXTRA_FLAGS
--pkg-config-flags=--static
--extra-cflags=${FFMPEG_CFLAGS}
--extra-ldflags=${FFMPEG_LDFLAGS}
)
set(FFMPEG_ENV "")
if(NOT WIN32)
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:\
${temp_LIBDIR}/x265/lib/pkgconfig:"
)
endif()
unset(temp_LIBDIR)
if(WIN32)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--disable-static
--enable-shared
--enable-w32threads
--disable-pthreads
--enable-libopenjpeg
--disable-mediafoundation
--toolchain=msvc
--target-os=win32
)
if(BLENDER_PLATFORM_ARM)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--arch=aarch64
"--as=${DOWNLOAD_DIR}/msys2/msys64/usr/bin/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo"
--cc=${LIBDIR}/llvm/bin/clang-cl.exe
--cxx=${LIBDIR}/llvm/bin/clang-cl.exe
--windres=${LIBDIR}/llvm/bin/llvm-rc.exe
--nm=${LIBDIR}/llvm/bin/llvm-nm.exe
--ar='${LIBDIR}/llvm/bin/llvm-ar.exe'
--ranlib=${LIBDIR}/llvm/bin/llvm-ranlib.exe
)
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--disable-inline-asm
--arch=x86_64
)
endif()
set(FFMPEG_CONFIGURE_COMMAND ${CONFIGURE_ENV_MSVC})
else()
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--enable-static
--disable-shared
--enable-libopenjpeg
)
set(FFMPEG_CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL})
endif()
if(APPLE)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--target-os=darwin
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
elseif(UNIX)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
endif()
ExternalProject_Add(external_ffmpeg
URL file://${PACKAGE_DIR}/${FFMPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FFMPEG_HASH_TYPE}=${FFMPEG_HASH}
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d
${BUILD_DIR}/ffmpeg/src/external_ffmpeg <
${FFMPEG_PATCH_FILE}
PREFIX ${BUILD_DIR}/ffmpeg
CONFIGURE_COMMAND ${FFMPEG_CONFIGURE_COMMAND} &&
cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
${FFMPEG_ENV} ${CONFIGURE_COMMAND_NO_TARGET} ${FFMPEG_EXTRA_FLAGS}
--disable-lzma
--disable-vdpau
--disable-bzlib
--disable-libgsm
--disable-libspeex
--enable-libvpx
--enable-libopus
--prefix=${LIBDIR}/ffmpeg
--enable-libtheora
--enable-libvorbis
--enable-zlib
--enable-stripping
--enable-runtime-cpudetect
--disable-vaapi
--disable-nonfree
--enable-gpl
--enable-libmp3lame
--disable-librtmp
--enable-libx264
--enable-libx265
--enable-libaom
--disable-libopencore-amrnb
--disable-libopencore-amrwb
--disable-libdc1394
--disable-version3
--disable-debug
--enable-optimizations
--enable-ffplay
--disable-openssl
--disable-securetransport
--disable-indev=avfoundation
--disable-indev=qtkit
--disable-sdl2
--disable-gnutls
--disable-videotoolbox
--disable-libxcb
--disable-xlib
--disable-audiotoolbox
--disable-cuvid
--disable-nvenc
--disable-indev=jack
--disable-indev=alsa
--disable-outdev=alsa
--disable-sndio
--disable-doc
BUILD_COMMAND ${FFMPEG_CONFIGURE_COMMAND} &&
cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${FFMPEG_CONFIGURE_COMMAND} &&
cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ &&
make install
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg
${DEFAULT_CMAKE_FLAGS}
INSTALL_DIR ${LIBDIR}/ffmpeg
)
if(MSVC)
set_target_properties(external_ffmpeg PROPERTIES FOLDER Mingw)
endif()
add_dependencies(
external_ffmpeg
external_zlib
external_x264
external_x265
external_opus
external_vpx
external_theora
external_vorbis
external_ogg
external_lame
external_aom
external_sndfile
external_flac
)
if(WIN32)
add_dependencies(
external_ffmpeg
external_zlib
external_openjpeg_msvc
)
if(BLENDER_PLATFORM_ARM)
add_dependencies(
external_ffmpeg
external_llvm
)
endif()
endif()
if(UNIX)
add_dependencies(
external_ffmpeg
external_nasm
external_openjpeg
)
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_ffmpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/ffmpeg/include
${HARVEST_TARGET}/ffmpeg/include
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/ffmpeg/bin
${HARVEST_TARGET}/ffmpeg/lib
DEPENDEES install
)
endif()
else()
harvest(external_ffmpeg ffmpeg/include ffmpeg/include "*.h")
harvest(external_ffmpeg ffmpeg/lib ffmpeg/lib "*.a")
endif()

View File

@@ -0,0 +1,93 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(FFTW_EXTRA_ARGS "")
function(fftw_build FFTW_POSTFIX)
if(WIN32)
if("${FFTW_POSTFIX}" STREQUAL "float")
set(FFTW_EXTRA_ARGS -DENABLE_FLOAT=ON)
endif()
ExternalProject_Add(external_fftw3_${FFTW_POSTFIX}
URL file://${PACKAGE_DIR}/${FFTW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FFTW_HASH_TYPE}=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/fftw3
-DENABLE_THREADS=ON
-DWITH_COMBINED_THREADS=OFF
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTS=OFF
${FFTW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/fftw3
)
else()
set(FFTW_EXTRA_ARGS --enable-static --enable-threads)
set(FFTW_INSTALL install)
ExternalProject_Add(external_fftw3_${FFTW_POSTFIX}
URL file://${PACKAGE_DIR}/${FFTW_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FFTW_HASH_TYPE}=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/fftw3/src/external_fftw3_${FFTW_POSTFIX}/ &&
${CONFIGURE_COMMAND} ${FFTW_EXTRA_ARGS} ${ARGN} --prefix=${mingw_LIBDIR}/fftw3
BUILD_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/fftw3/src/external_fftw3_${FFTW_POSTFIX}/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/fftw3/src/external_fftw3_${FFTW_POSTFIX}/ &&
make ${FFTW_INSTALL}
INSTALL_DIR ${LIBDIR}/fftw3
)
endif()
endfunction()
fftw_build(double)
fftw_build(float --enable-float)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_fftw3_double after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fftw3/lib/fftw3.lib
${HARVEST_TARGET}/fftw3/lib/fftw3.lib
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fftw3/include/fftw3.h
${HARVEST_TARGET}/fftw3/include/fftw3.h
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fftw3/lib/fftw3_threads.lib
${HARVEST_TARGET}/fftw3/lib/fftw3_threads.lib
DEPENDEES install
)
ExternalProject_Add_Step(external_fftw3_float after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fftw3/lib/fftw3f.lib
${HARVEST_TARGET}/fftw3/lib/fftw3f.lib
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fftw3/lib/fftw3f_threads.lib
${HARVEST_TARGET}/fftw3/lib/fftw3f_threads.lib
DEPENDEES install
)
endif()
endif()
add_custom_target(external_fftw)
add_dependencies(
external_fftw
external_fftw3_double
external_fftw3_float)
if(NOT WIN32)
harvest(external_fftw3 fftw3/include fftw3/include "*.h")
harvest(external_fftw3 fftw3/lib fftw3/lib "*.a")
endif()

View File

@@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2002-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(NOT WIN32)
ExternalProject_Add(external_flac
URL file://${PACKAGE_DIR}/${FLAC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FLAC_HASH_TYPE}=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flac/src/external_flac/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flac/src/external_flac/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flac/src/external_flac/ &&
make install
INSTALL_DIR ${LIBDIR}/flac
)
harvest(external_flac flac/lib sndfile/lib "libFLAC.a")
else()
set(FLAC_CXX_FLAGS "-DFLAC__NO_DLL=ON")
set(FLAC_EXTRA_ARGS
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW
-DBUILD_PROGRAMS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_DOCS=OFF
-DBUILD_TESTING=OFF
-DINSTALL_MANPAGES=OFF
-DOgg_ROOT=${LIBDIR}/ogg
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_C_FLAGS_RELEASE=${FLAC_CXX_FLAGS}
)
ExternalProject_Add(external_flac
URL file://${PACKAGE_DIR}/${FLAC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FLAC_HASH_TYPE}=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac
CMAKE_GENERATOR "Ninja"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/flac
${DEFAULT_CMAKE_FLAGS}
${FLAC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/flac
)
add_dependencies(
external_flac
external_ogg
)
endif()

View File

@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Generated configuration files use an old `aclocal-1.15` on RockyLinux8.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_autoconf_cmd_optional ./autogen.sh &&)
else()
set(_autoconf_cmd_optional "")
endif()
ExternalProject_Add(external_flex
URL file://${PACKAGE_DIR}/${FLEX_FILE}
URL_HASH ${FLEX_HASH_TYPE}=${FLEX_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/flex
PATCH_COMMAND ${PATCH_CMD} --verbose -p1 -d
${BUILD_DIR}/flex/src/external_flex <
${PATCH_DIR}/flex_gcc14.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flex/src/external_flex/ &&
${_autoconf_cmd_optional} ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
BUILD_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flex/src/external_flex/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/flex/src/external_flex/ &&
make install
INSTALL_DIR ${LIBDIR}/flex
)
unset(_autoconf_cmd_optional)

View File

@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(FLEXBISON_EXTRA_ARGS "")
ExternalProject_Add(external_flexbison
URL file://${PACKAGE_DIR}/${FLEXBISON_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FLEXBISON_HASH_TYPE}=${FLEXBISON_HASH}
PREFIX ${BUILD_DIR}/flexbison
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison
${DEFAULT_CMAKE_FLAGS}
${FLEXBISON_EXTRA_ARGS}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy_directory
${BUILD_DIR}/flexbison/src/external_flexbison/
${LIBDIR}/flexbison/
INSTALL_DIR ${LIBDIR}/flexbison
)

View File

@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(FMT_EXTRA_ARGS
-DFMT_TEST=OFF
-DFMT_DOC=OFF
)
ExternalProject_Add(external_fmt
URL file://${PACKAGE_DIR}/${FMT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FMT_HASH_TYPE}=${FMT_HASH}
PREFIX ${BUILD_DIR}/fmt
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/fmt
${DEFAULT_CMAKE_FLAGS}
${FMT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/fmt
)
if(WIN32)
ExternalProject_Add_Step(external_fmt after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/fmt/
${HARVEST_TARGET}/fmt
DEPENDEES install
)
else()
harvest(external_fmt fmt/include fmt/include "*.h")
harvest(external_fmt fmt/lib/cmake/fmt fmt/lib/cmake/fmt "*.cmake")
harvest(external_fmt fmt/lib fmt/lib "*.a")
endif()

View File

@@ -0,0 +1,65 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(FREETYPE_LIB_PREFIX "")
else()
set(FREETYPE_LIB_PREFIX "lib")
endif()
set(FREETYPE_EXTRA_ARGS
-DCMAKE_RELEASE_POSTFIX:STRING=2ST
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
-DFT_DISABLE_BZIP2=ON
-DFT_DISABLE_HARFBUZZ=ON
-DFT_DISABLE_PNG=ON
-DFT_REQUIRE_BROTLI=ON
-DFT_REQUIRE_ZLIB=ON
-DBROTLIDEC_INCLUDE_DIRS=${LIBDIR}/brotli/include
-DBROTLIDEC_LIBRARIES=${LIBDIR}/brotli/lib/${FREETYPE_LIB_PREFIX}brotlicommon-static${LIBEXT}
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
)
ExternalProject_Add(external_freetype
URL file://${PACKAGE_DIR}/${FREETYPE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FREETYPE_HASH_TYPE}=${FREETYPE_HASH}
PREFIX ${BUILD_DIR}/freetype
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype
${DEFAULT_CMAKE_FLAGS}
${FREETYPE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freetype
)
add_dependencies(
external_freetype
external_brotli
external_zlib
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/freetype
${HARVEST_TARGET}/freetype
# `harfbuzz` *NEEDS* to find `freetype.lib` and will not be convinced to take
# alternative names so just give it what it wants.
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/freetype/lib/freetype2st.lib
${LIBDIR}/freetype/lib/freetype.lib
DEPENDEES install
)
endif()
else()
harvest(external_freetype freetype/include freetype/include "*.h")
harvest(external_freetype freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
endif()

View File

@@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(FRIBIDI_CONFIGURE_ENV ${CONFIGURE_ENV_MSVC})
else()
set(FRIBIDI_CONFIGURE_ENV ${CONFIGURE_ENV})
endif()
set(FRIBIDI_EXTRA_OPTIONS
-Ddocs=false
)
ExternalProject_Add(external_fribidi
URL file://${PACKAGE_DIR}/${FRIBIDI_FILE}
URL_HASH ${FRIBIDI_HASH_TYPE}=${FRIBIDI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/fribidi
CONFIGURE_COMMAND ${FRIBIDI_CONFIGURE_ENV} &&
${MESON} setup
--prefix ${LIBDIR}/fribidi
--libdir lib
--default-library static
${MESON_BUILD_TYPE}
${FRIBIDI_EXTRA_OPTIONS}
${BUILD_DIR}/fribidi/src/external_fribidi-build
${BUILD_DIR}/fribidi/src/external_fribidi
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/fribidi
)
add_dependencies(
external_fribidi
external_python
# Needed for `MESON`.
external_python_site_packages
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_fribidi after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/fribidi/include
${HARVEST_TARGET}/fribidi/include
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/fribidi/lib/libfribidi.a
${HARVEST_TARGET}/fribidi/lib/libfribidi.lib
DEPENDEES install
)
endif()
else()
harvest(external_fribidi fribidi/include fribidi/include "*.h")
harvest(external_fribidi fribidi/lib fribidi/lib "*.a")
endif()

View File

@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(GMMLIB_EXTRA_ARGS
)
ExternalProject_Add(external_gmmlib
URL file://${PACKAGE_DIR}/${GMMLIB_FILE}
URL_HASH ${GMMLIB_HASH_TYPE}=${GMMLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/gmmlib
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmmlib
${DEFAULT_CMAKE_FLAGS}
${GMMLIB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/gmmlib
)

View File

@@ -0,0 +1,164 @@
# SPDX-FileCopyrightText: 2020-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32)
cmake_to_msys_path("${BUILD_DIR}/gmp/src/external_gmp/compile" compilescript_path)
set(arlib_joint_path "ar-lib lib.exe")
set(GMP_CFLAGS "-nologo -W3 -utf-8 -MP -MD -Z7 -Ob0 -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS")
set(GMP_CC_CXX "${compilescript_path} cl")
set(GMP_NM "dumpbin.exe -symbols -headers")
set(GMP_CONFIGURE_ENV
set AR=${arlib_joint_path} &&
set NM=${GMP_NM} &&
${CONFIGURE_ENV_NO_PERL} &&
set CC=${GMP_CC_CXX} &&
set CXX=${GMP_CC_CXX} &&
set CFLAGS=${GMP_CFLAGS} &&
set AS=:
)
set(GMP_OPTIONS
--disable-static
--enable-shared
--enable-cxx
--verbose
gmp_cv_check_libm_for_build=no
ac_cv_prog_LEX=:
ac_cv_prog_YACC=:
ac_cv_prog_ac_ct_STRIP=:
ac_cv_prog_RANLIB=:
lt_cv_to_host_file_cmd=func_convert_file_noop
lt_cv_to_tool_file_cmd=func_convert_file_noop
)
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--enable-assembly=no
--build=aarch64-pc-mingw32
)
else()
set(GMP_OPTIONS
${GMP_OPTIONS}
--enable-assembly=no
--build=x86_64-pc-mingw32
ac_cv_func_memset=yes
gmp_cv_asm_w32=.word
)
endif()
else()
set(GMP_CONFIGURE_ENV ${CONFIGURE_ENV_NO_PERL})
set(GMP_OPTIONS --enable-static --disable-shared )
endif()
if(UNIX)
if(NOT (APPLE AND BLENDER_PLATFORM_ARM))
set(GMP_OPTIONS ${GMP_OPTIONS} --with-pic)
endif()
if(NOT (APPLE OR BLENDER_PLATFORM_ARM))
set(GMP_OPTIONS ${GMP_OPTIONS} --enable-fat)
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
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/gmp/src/external_gmp <
${PATCH_DIR}/gmp.diff
CONFIGURE_COMMAND ${GMP_CONFIGURE_ENV} &&
cd ${BUILD_DIR}/gmp/src/external_gmp/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} &&
cd ${BUILD_DIR}/gmp/src/external_gmp/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} &&
cd ${BUILD_DIR}/gmp/src/external_gmp/ &&
make install
INSTALL_DIR ${LIBDIR}/gmp
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/gmp/bin/gmp-10.dll
${HARVEST_TARGET}/gmp/lib/gmp-10.dll
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/gmp/lib/gmp.dll.lib
${HARVEST_TARGET}/gmp/lib/gmp.dll.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/gmp/include
${HARVEST_TARGET}/gmp/include
DEPENDEES install
)
endif()
if(WIN32)
# gmpxx is somewhat special, it builds on top of the C style gmp library but exposes C++ bindings
# given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
# with MSVC, while GMP can only be built with mingw.
ExternalProject_Add(external_gmpxx
URL file://${PACKAGE_DIR}/${GMP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmpxx
# Intentionally empty, COMMAND is used but it must follow a PATCH_COMMAND.
PATCH_COMMAND
COMMAND
${CMAKE_COMMAND} -E copy
${PATCH_DIR}/cmakelists_gmpxx.txt
${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy
${PATCH_DIR}/config_gmpxx.h
${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmpxx
${DEFAULT_CMAKE_FLAGS}
-DGMP_LIBRARY=${BUILD_DIR}/gmp/src/external_gmp/.libs/gmp.dll.lib
-DGMP_INCLUDE_DIR=${BUILD_DIR}/gmp/src/external_gmp
-DCMAKE_DEBUG_POSTFIX=_d
INSTALL_DIR ${LIBDIR}/gmpxx
)
add_dependencies(
external_gmpxx
external_gmp
)
ExternalProject_Add_Step(external_gmpxx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/gmpxx/
${HARVEST_TARGET}/gmp
DEPENDEES install
)
else()
harvest(external_gmp gmp/include gmp/include "*.h")
harvest(external_gmp gmp/lib gmp/lib "*.a")
endif()

View File

@@ -0,0 +1,85 @@
# Remarks: NotAffected / FalsePositive / Mitigated
ignore:
# [NotAffected] issue in convert command line tool not used by blender
- vulnerability: CVE-2016-9675
# [NotAffected] issue in pygresql not used by blender
- vulnerability: CVE-2009-2940
# [NotAffected] issue in odoo not used by blender
- vulnerability: CVE-2020-29396
# [NotAffected] issue in django not used by blender
- vulnerability: CVE-2021-32052
# [NotAffected] already fixed in libexpat version used
- vulnerability: CVE-2009-3720
# [NotAffected] not used in blender and not considered a bug upstream
- vulnerability: CVE-2023-36632
# [NotAffected] not used in blender
- vulnerability: CVE-2023-27043
# [FalsePositive] fixed in 3.11.10 upstream fix gh-121285
- vulnerability: CVE-2024-6232
# [FalsePositive] fixed in 3.11.10 upstream fix gh-123067
- vulnerability: CVE-2024-7592
# [NotAffected] not a blender specific issue and pip is inherently affected by malicious packages
- vulnerability: CVE-2018-20225
# [NotAffected] issue in mutt not used by blender
- vulnerability: CVE-2009-1390
# [NotAffected] issue in mutt not used by blender
- vulnerability: CVE-2009-3765
# [NotAffected] issue in mutt not used by blender
- vulnerability: CVE-2009-3766
# [NotAffected] issue in ldap not used by blender
- vulnerability: CVE-2009-3767
# [NotAffected] issue in apache not used by blender
- vulnerability: CVE-2019-0190
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2056
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2057
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2058
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2519
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2520
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2521
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-2953
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-34526
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3570
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3597
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3598
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3599
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3626
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2022-3627
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2023-40745
# [NotAffected] issue in tiff command line tool not used by blender
- vulnerability: CVE-2023-41175
# [NotAffected] not affecting blender and not considered a security issue upstream
- vulnerability: CVE-2016-3709
# [NotAffected] not affecting blender and not considered a security issue upstream
- vulnerability: CVE-2023-39615
# [NotAffected] already fixed in the libxml2 version used
- vulnerability: CVE-2020-7595
# [Mitigated] patched using upstream commit 561a9c25298e
- vulnerability: CVE-2021-43618
# [NotAffected] only affects SQLITE_ENABLE_STAT4 compile option not used by blender or python
- vulnerability: CVE-2022-35737
# [NotAffected] does not affect blender use of sqlite
- vulnerability: CVE-2023-7104
# [NotAffected] does not affect blender use of sqlite
- vulnerability: CVE-2024-0232
# [NotAffected] only affects minizip not used by blender
- vulnerability: CVE-2023-45853
# [Mitigated] patched using upstream PR 1045
- vulnerability: CVE-2024-50612
# [NotAffected] all mp3 handling in blender goes through ffmpeg
- vulnerability: CVE-2024-50613

View File

@@ -0,0 +1,82 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV_MSVC})
set(HARFBUZZ_PKG_ENV FREETYPE_DIR=${LIBDIR}/freetype)
else()
set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV})
set(HARFBUZZ_PKG_ENV "PKG_CONFIG_PATH=\
${LIBDIR}/freetype/lib/pkgconfig:\
${LIBDIR}/brotli/lib/pkgconfig:\
${LIBDIR}/lib/python3.10/pkgconfig:\
$PKG_CONFIG_PATH"
)
endif()
set(HARFBUZZ_EXTRA_OPTIONS
-Dtests=disabled
-Dfreetype=enabled
-Dglib=disabled
-Dgobject=disabled
# Only used for command line utilities,
# disable as this would add an additional & unnecessary build-dependency.
-Dcairo=disabled
)
ExternalProject_Add(external_harfbuzz
URL file://${PACKAGE_DIR}/${HARFBUZZ_FILE}
URL_HASH ${HARFBUZZ_HASH_TYPE}=${HARFBUZZ_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/harfbuzz
CONFIGURE_COMMAND ${HARFBUZZ_CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E env ${HARFBUZZ_PKG_ENV} ${MESON} setup
--prefix ${LIBDIR}/harfbuzz
--libdir lib
--default-library static
${MESON_BUILD_TYPE}
${HARFBUZZ_EXTRA_OPTIONS}
${BUILD_DIR}/harfbuzz/src/external_harfbuzz-build
${BUILD_DIR}/harfbuzz/src/external_harfbuzz
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/harfbuzz
)
add_dependencies(
external_harfbuzz
external_python
external_freetype
# Needed for `MESON`.
external_python_site_packages
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_harfbuzz after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/harfbuzz/include
${HARVEST_TARGET}/harfbuzz/include
# We do not use the subset API currently, so copying only the main library will suffice for now
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/harfbuzz/lib/libharfbuzz.a
${HARVEST_TARGET}/harfbuzz/lib/libharfbuzz.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
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()
else()
harvest(external_harfbuzz harfbuzz/include harfbuzz/include "*.h")
harvest(external_harfbuzz harfbuzz/lib harfbuzz/lib "*.a")
endif()

View File

@@ -0,0 +1,40 @@
# SPDX-FileCopyrightText: 2017-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(HARU_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DLIBHPDF_EXAMPLES=OFF
-DLIBHPDF_ENABLE_EXCEPTIONS=ON
)
ExternalProject_Add(external_haru
URL file://${PACKAGE_DIR}/${HARU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${HARU_HASH_TYPE}=${HARU_HASH}
PREFIX ${BUILD_DIR}/haru
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/haru
${DEFAULT_CMAKE_FLAGS} ${HARU_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/haru
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_haru after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/haru/include
${HARVEST_TARGET}/haru/include
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/haru/lib/hpdf.lib
${HARVEST_TARGET}/haru/lib/hpdf.lib
DEPENDEES install
)
endif()
else()
harvest(external_haru haru/include haru/include "*.h")
harvest(external_haru haru/lib haru/lib "*.a")
endif()

View File

@@ -0,0 +1,129 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
########################################################################
# Copy all generated files to the proper structure as blender prefers
########################################################################
if(NOT DEFINED HARVEST_TARGET)
set(HARVEST_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/Harvest)
endif()
message(STATUS "HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # JPEG rename lib-file + copy include.
${CMAKE_COMMAND} -E copy
${LIBDIR}/jpeg/lib/jpeg-static.lib
${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/jpeg/include/
${HARVEST_TARGET}/jpeg/include/ &&
# PNG.
${CMAKE_COMMAND} -E copy
${LIBDIR}/png/lib/libpng16_static.lib
${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/png/include/
${HARVEST_TARGET}/png/include/
)
endif()
else()
function(harvest project from to)
set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename}
)
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE
PATTERN "meson*" EXCLUDE
)
endif()
endfunction()
# Set rpath on shared libraries to $ORIGIN since all will be installed in the same
# lib folder, and remove any absolute paths.
#
# Ideally this would be done as part of the Blender build since it makes assumptions
# about where the files will be installed. However it would add patchelf as a new
# dependency for building.
#
# Also removes versioned symlinks, which give errors with macOS notarization.
if(APPLE)
set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/utils/set_rpath.py @loader_path)
else()
set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
endif()
function(harvest_rpath_lib project from to pattern)
harvest(project ${from} ${to} ${pattern})
install(CODE "\
cmake_policy(SET CMP0009 NEW)\n
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
if((NOT IS_SYMLINK \${f}) OR APPLE)\n
execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
endif()\n
endforeach()")
endfunction()
# Set rpath on utility binaries assuming they are run from their install location.
function(harvest_rpath_bin project from to pattern)
harvest(project ${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
execute_process(COMMAND ${set_rpath_cmd}/../lib \${f}) \n
endforeach()")
endfunction()
# Set rpath on Python module to point to the shared libraries folder in the Blender
# installation.
function(harvest_rpath_python project from to pattern)
harvest(project ${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
foreach(f \${shared_libs}) \n
if(IS_SYMLINK \${f})\n
if(APPLE)\n
file(REMOVE_RECURSE \${f})
endif()\n
else()\n
get_filename_component(f_dir \${f} DIRECTORY) \n
file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
endif()\n
endforeach()")
endfunction()
# Strip all shared/static libraries in the HARVEST_TARGET location.
function(harvest_strip_all_libraries)
install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/utils/strip_libraries.py ${HARVEST_TARGET})")
endfunction()
endif()

View File

@@ -0,0 +1,69 @@
# SPDX-FileCopyrightText: 2017-2024 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(NOT HIP_FOUND)
message(STATUS "Missing HIP compiler, skipping HIPRT build")
return()
endif()
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
get_filename_component(_hip_bin_path ${HIP_HIPCC_EXECUTABLE} DIRECTORY)
get_filename_component(_hip_path ${_hip_bin_path} DIRECTORY)
set(HIPRT_EXTRA_ARGS
-DCMAKE_BUILD_TYPE=Release
-DHIP_PATH=${_hip_path}
-DBITCODE=OFF
-DGENERATE_BAKE_KERNEL=OFF
-DNO_UNITTEST=ON
-DBAKE_COMPILED_KERNEL=ON
-DPRECOMPILE=ON
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DFORCE_DISABLE_CUDA=ON
)
set(HIPRT_SOURCE_DIR ${BUILD_DIR}/hiprt/src/external_hiprt)
set(HIPRT_BUILD_DIR ${BUILD_DIR}/hiprt/src/external_hiprt-build)
ExternalProject_Add(external_hiprt
URL file://${PACKAGE_DIR}/${HIPRT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${HIPRT_HASH_TYPE}=${HIPRT_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/hiprt
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/hiprt/src/external_hiprt <
${PATCH_DIR}/hiprt_rocm7_support.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/hiprt
${HIPRT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hiprt
)
add_dependencies(
external_hiprt
external_python
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_hiprt after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/hiprt
${HARVEST_TARGET}/hiprt
DEPENDEES install
)
endif()
else()
harvest(external_hiprt hiprt/include hiprt/include "*.h")
harvest(external_hiprt hiprt/bin hiprt/lib "*${SHAREDLIBEXT}*")
harvest(external_hiprt hiprt/bin hiprt/lib "*.hipfb")
endif()

View File

@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(ICONV_EXTRA_ARGS "")
ExternalProject_Add(external_iconv
URL file://${PACKAGE_DIR}/${ICONV_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ICONV_HASH_TYPE}=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/iconv/src/external_iconv/ &&
${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/iconv/src/external_iconv/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/iconv/src/external_iconv/ &&
make install
INSTALL_DIR ${LIBDIR}/iconv
)
if(MSVC)
set_target_properties(external_iconv PROPERTIES FOLDER Mingw)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_iconv after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/iconv/lib/libiconv.a
${HARVEST_TARGET}/iconv/lib/iconv.lib
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/iconv/include/iconv.h
${HARVEST_TARGET}/iconv/include/iconv.h
DEPENDEES install
)
endif()
endif()

View File

@@ -0,0 +1,145 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
unpack_only(igc_vcintrinsics)
unpack_only(igc_spirv_headers)
unpack_only(igc_spirv_tools)
#
# igc_opencl_clang contains patches that need to be applied
# to external_igc_llvm and igc_spirv_translator, we unpack
# igc_opencl_clang first, then have the patch stages of
# external_igc_llvm and igc_spirv_translator apply them.
#
ExternalProject_Add(external_igc_opencl_clang
URL file://${PACKAGE_DIR}/${IGC_OPENCL_CLANG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_OPENCL_CLANG_HASH_TYPE}=${IGC_OPENCL_CLANG_HASH}
PREFIX ${BUILD_DIR}/igc_opencl_clang
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
set(IGC_OPENCL_CLANG_PATCH_DIR ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/patches)
set(IGC_LLVM_SOURCE_DIR ${BUILD_DIR}/igc_llvm/src/external_igc_llvm)
set(IGC_SPIRV_TRANSLATOR_SOURCE_DIR ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator)
ExternalProject_Add(external_igc_llvm
URL file://${PACKAGE_DIR}/${IGC_LLVM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_LLVM_HASH_TYPE}=${IGC_LLVM_HASH}
PREFIX ${BUILD_DIR}/igc_llvm
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${IGC_LLVM_SOURCE_DIR} <
${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
${PATCH_CMD} -p 1 -d
${IGC_LLVM_SOURCE_DIR} <
${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-wrong-check-of-__opencl_c_images-feature-macr.patch &&
${PATCH_CMD} -p 1 -d
${IGC_LLVM_SOURCE_DIR} <
${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Fix-checking-mechanism-for-read_write-Image-type.patch &&
${PATCH_CMD} -p 1 -d
${IGC_LLVM_SOURCE_DIR} <
${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-Allow-undefining-header-only-macros.patch &&
${PATCH_CMD} -p 1 -d
${IGC_LLVM_SOURCE_DIR} <
${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-Enable-use-of-GNU-C-extension.patch
)
add_dependencies(
external_igc_llvm
external_igc_opencl_clang
)
ExternalProject_Add(external_igc_spirv_translator
URL file://${PACKAGE_DIR}/${IGC_SPIRV_TRANSLATOR_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_SPIRV_TRANSLATOR_HASH_TYPE}=${IGC_SPIRV_TRANSLATOR_HASH}
PREFIX ${BUILD_DIR}/igc_spirv_translator
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
add_dependencies(
external_igc_spirv_translator
external_igc_opencl_clang
)
if(WIN32)
set(IGC_GENERATOR "Ninja")
set(IGC_TARGET Windows64)
else()
set(IGC_GENERATOR "Unix Makefiles")
set(IGC_TARGET Linux64)
endif()
string(REPLACE "-DCMAKE_CXX_STANDARD=20" " " IGC_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
set(IGC_EXTRA_ARGS
-DIGC_OPTION__ARCHITECTURE_TARGET=${IGC_TARGET}
-DIGC_OPTION__ARCHITECTURE_HOST=${IGC_TARGET}
)
list(APPEND IGC_EXTRA_ARGS
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
-DFLEX_INCLUDE_DIR=${LIBDIR}/flex/include
)
ExternalProject_Add(external_igc
URL file://${PACKAGE_DIR}/${IGC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_HASH_TYPE}=${IGC_HASH}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/igc
${IGC_CMAKE_FLAGS}
${IGC_EXTRA_ARGS}
# IGC is pretty set in its way where sub projects ought to live, for some it offers
# hooks to supply alternative folders, other are just hard-coded with no way to configure
# we symlink everything here, since it's less work than trying to convince the cmake
# scripts to accept alternative locations.
PATCH_COMMAND
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_llvm/src/external_igc_llvm/
${BUILD_DIR}/igc/src/llvm-project &&
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/
${BUILD_DIR}/igc/src/llvm-project/llvm/projects/opencl-clang &&
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator/
${BUILD_DIR}/igc/src/llvm-project/llvm/projects/llvm-spirv &&
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_spirv_tools/src/external_igc_spirv_tools/
${BUILD_DIR}/igc/src/SPIRV-Tools &&
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_spirv_headers/src/external_igc_spirv_headers/
${BUILD_DIR}/igc/src/SPIRV-Headers &&
${CMAKE_COMMAND} -E create_symlink
${BUILD_DIR}/igc_vcintrinsics/src/external_igc_vcintrinsics/
${BUILD_DIR}/igc/src/vc-intrinsics
PREFIX ${BUILD_DIR}/igc
INSTALL_DIR ${LIBDIR}/igc
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --strip
CMAKE_GENERATOR ${IGC_GENERATOR}
)
add_dependencies(
external_igc
external_igc_vcintrinsics
external_igc_llvm
external_igc_opencl_clang
external_igc_spirv_headers
external_igc_spirv_tools
external_igc_spirv_translator
external_flex
)
harvest(external_igc igc dpcpp/lib/igc "*")

View File

@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(IMATH_EXTRA_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
-DIMATH_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)
ExternalProject_Add(external_imath
URL file://${PACKAGE_DIR}/${IMATH_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IMATH_HASH_TYPE}=${IMATH_HASH}
PREFIX ${BUILD_DIR}/imath
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/imath
${DEFAULT_CMAKE_FLAGS}
${IMATH_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/imath
)
if(WIN32)
ExternalProject_Add_Step(external_imath after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/imath/lib
${HARVEST_TARGET}/imath/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/imath/include
${HARVEST_TARGET}/imath/include
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll
${HARVEST_TARGET}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll
DEPENDEES install
)
else()
harvest(external_imath imath/include imath/include "*.h")
harvest(external_imath imath/lib/cmake/Imath imath/lib/cmake/Imath "*.cmake")
harvest_rpath_lib(external_imath imath/lib imath/lib "*${SHAREDLIBEXT}*")
endif()

View File

@@ -0,0 +1,99 @@
# SPDX-FileCopyrightText: 2020-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(ISPC_EXTRA_ARGS_WIN
-DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/msys2/msys64/usr/bin/m4.exe
-DPython3_FIND_REGISTRY=NEVER
)
if(BLENDER_PLATFORM_ARM)
set(ISPC_EXTRA_ARGS_WIN ${ISPC_EXTRA_ARGS_WIN} -DARM_ENABLED=On)
else()
set(ISPC_EXTRA_ARGS_WIN ${ISPC_EXTRA_ARGS_WIN} -DARM_ENABLED=Off)
endif()
elseif(APPLE)
# Use bison and flex installed via Homebrew.
# The ones that come with Xcode toolset are too old.
if(BLENDER_PLATFORM_ARM)
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex
-DARM_ENABLED=Off
)
endif()
elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
-DARM_ENABLED=${BLENDER_PLATFORM_ARM}
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
)
endif()
set(ISPC_EXTRA_ARGS
-DISPC_INCLUDE_EXAMPLES=Off
-DISPC_INCLUDE_TESTS=Off
-DISPC_INCLUDE_RT=Off
-DISPC_INCLUDE_UTILS=Off
-DISPC_LIBRARY=Off
-DLLVM_CONFIG_EXECUTABLE=${LIBDIR}/llvm/bin/llvm-config
-DLLVM_DIR=${LIBDIR}/llvm/lib/cmake/llvm/
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++
-DISPC_INCLUDE_TESTS=Off
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
-DGIT_BINARY=GIT_BINARY-NOTFOUND # Prevent any git checks
${ISPC_EXTRA_ARGS_WIN}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
)
ExternalProject_Add(external_ispc
URL file://${PACKAGE_DIR}/${ISPC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ISPC_HASH_TYPE}=${ISPC_HASH}
PREFIX ${BUILD_DIR}/ispc
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/ispc/src/external_ispc <
${PATCH_DIR}/ispc.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc
-Wno-dev
${DEFAULT_CMAKE_FLAGS}
${ISPC_EXTRA_ARGS}
${BUILD_DIR}/ispc/src/external_ispc
INSTALL_DIR ${LIBDIR}/ispc
)
add_dependencies(
external_ispc
external_llvm
external_python
)
if(WIN32)
add_dependencies(
external_ispc
external_flexbison
)
elseif(UNIX AND NOT APPLE)
add_dependencies(
external_ispc
external_flex
)
endif()

View File

@@ -0,0 +1,67 @@
# SPDX-FileCopyrightText: 2017-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# CMAKE for MS-Windows.
set(JPEG_EXTRA_ARGS
-DNASM=${NASM_PATH}
-DWITH_JPEG8=ON
-DCMAKE_DEBUG_POSTFIX=d
-DWITH_CRT_DLL=On
-DENABLE_SHARED=OFF
-DENABLE_STATIC=ON
)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT})
else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy
${LIBDIR}/jpeg/lib/${JPEG_LIBRARY}
${LIBDIR}/jpeg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
else()
# CMAKE for UNIX.
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
-DENABLE_STATIC=ON
-DENABLE_SHARED=OFF
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpeg/lib)
ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpeg
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg
${DEFAULT_CMAKE_FLAGS}
${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg
)
set(JPEG_LIBRARY libjpeg${LIBEXT})
harvest(external_jpeg jpeg/include jpeg/include "*.h")
harvest(external_jpeg jpeg/lib jpeg/lib "libjpeg.a")
endif()

View File

@@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: 2017-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(LAME_EXTRA_ARGS "")
if(MSVC)
if(BLENDER_PLATFORM_ARM)
set(LAME_ARCH ARM64)
else()
set(LAME_ARCH Win64)
endif()
set(LAME_CONFIGURE echo .)
set(LAME_BUILD
cd ${BUILD_DIR}/lame/src/external_lame/ &&
nmake /F MakeFile.msvc MSVCVER=${LAME_ARCH} all
)
set(LAME_INSTALL
cd ${BUILD_DIR}/lame/src/external_lame/ &&
${CMAKE_COMMAND} -E copy
include/lame.h
${LIBDIR}/lame/include/lame/lame.h &&
${CMAKE_COMMAND} -E copy
output/libmp3lame-static.lib
${LIBDIR}/lame/lib/mp3lame.lib
)
else()
set(LAME_CONFIGURE
${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lame/src/external_lame/ &&
${CONFIGURE_COMMAND}
--prefix=${LIBDIR}/lame
--disable-shared
--enable-static
${LAME_EXTRA_ARGS}
--enable-export=full
--with-fileio=sndfile
--without-vorbis
--with-pic
--disable-mp3x
--disable-mp3rtp
--disable-gtktest
--disable-frontend)
set(LAME_BUILD ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lame/src/external_lame/ &&
make -j${MAKE_THREADS}
)
set(LAME_INSTALL ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lame/src/external_lame/ &&
make install
)
endif()
ExternalProject_Add(external_lame
URL file://${PACKAGE_DIR}/${LAME_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LAME_HASH_TYPE}=${LAME_HASH}
PREFIX ${BUILD_DIR}/lame
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/lame/src/external_lame <
${PATCH_DIR}/lame.diff
CONFIGURE_COMMAND ${LAME_CONFIGURE}
BUILD_COMMAND ${LAME_BUILD}
INSTALL_COMMAND ${LAME_INSTALL}
INSTALL_DIR ${LIBDIR}/lame
)
if(NOT WIN32)
harvest(external_lame lame/lib ffmpeg/lib "*.a")
endif()

View File

@@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(LEVEL_ZERO_EXTRA_ARGS
)
ExternalProject_Add(external_level-zero
URL file://${PACKAGE_DIR}/${LEVEL_ZERO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LEVEL_ZERO_HASH_TYPE}=${LEVEL_ZERO_HASH}
PREFIX ${BUILD_DIR}/level-zero
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d
${BUILD_DIR}/level-zero/src/external_level-zero <
${PATCH_DIR}/level-zero.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/level-zero
${DEFAULT_CMAKE_FLAGS}
${LEVEL_ZERO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/level-zero
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_level-zero after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/level-zero
${HARVEST_TARGET}/level-zero
DEPENDEES install
)
endif()
else()
harvest(external_level-zero level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(external_level-zero level-zero/lib level-zero/lib "*${SHAREDLIBEXT}*")
endif()

View File

@@ -0,0 +1,56 @@
# SPDX-FileCopyrightText: 2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(AOM_LIBRARY aom${LIBEXT})
else()
set(AOM_LIBRARY libaom${LIBEXT})
endif()
set(LIBHEIF_EXTRA_ARGS
-DWITH_AOM_ENCODER=ON
-DWITH_AOM_DECODER=ON
-DWITH_DAV1D=OFF
-DWITH_FFMPEG_DECODER=OFF
-DWITH_JPEG_ENCODER=OFF
-DWITH_KVAZAAR=OFF
-DWITH_LIBDE265=OFF
-DWITH_LIBSHARPYUV=OFF
-DWITH_OPENJPH_ENCODER=OFF
-DWITH_OpenH264_DECODER=OFF
-DWITH_OpenJPEG_DECODER=OFF
-DWITH_OpenJPEG_ENCODER=OFF
-DWITH_RAV1E=OFF
-DWITH_SvtEnc=OFF
-DWITH_UVG266=OFF
-DWITH_VVDEC=OFF
-DWITH_VVENC=OFF
-DWITH_X265=OFF
-DAOM_INCLUDE_DIR=${LIBDIR}/aom/include/
-DAOM_LIBRARY=${LIBDIR}/aom/lib/${AOM_LIBRARY}
-DBUILD_SHARED_LIBS=OFF
-DWITH_EXAMPLES=OFF
-DWITH_EXAMPLE_HEIF_VIEW=OFF
-DWITH_GDK_PIXBUF=OFF
)
ExternalProject_Add(external_libheif
URL file://${PACKAGE_DIR}/${LIBHEIF_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LIBHEIF_HASH_TYPE}=${LIBHEIF_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/libheif
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/libheif
${DEFAULT_CMAKE_FLAGS}
${LIBHEIF_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/libheif
)
add_dependencies(
external_libheif
external_aom
)

View File

@@ -0,0 +1,140 @@
# SPDX-FileCopyrightText: 2012-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
if(BLENDER_PLATFORM_ARM)
set(LLVM_TARGETS AArch64$<SEMICOLON>ARM)
else()
set(LLVM_TARGETS X86)
endif()
if(UNIX AND NOT APPLE)
# Make llvm's pkgconfig pick up our static xml2 lib
set(LLVM_XML2_ARGS
-DCMAKE_PREFIX_PATH=${LIBDIR}/xml2
)
endif()
if(APPLE)
set(LLVM_XML2_ARGS
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
set(LLVM_EXTRA_PROJECTS ^^clang-tools-extra)
set(BUILD_CLANG_TOOLS ON)
elseif(MSVC AND BLENDER_PLATFORM_ARM)
set(LLVM_EXTRA_PROJECTS ^^lld)
else()
# NVIDIA PTX for OSL on Windows and Linux.
set(LLVM_TARGETS ${LLVM_TARGETS}$<SEMICOLON>NVPTX)
endif()
set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS}
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
-DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_ZSTD=OFF
-DLLVM_ENABLE_ZLIB=OFF
-DLLVM_ENABLE_PROJECTS=clang${LLVM_EXTRA_PROJECTS}
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
# Enforce C++17 as C++20 cause compilation errors on recent GCC versions, fixed in LLVM 22.1.0 (GH PR #169772), remove on upgrade.
-DCMAKE_CXX_STANDARD=17
${LLVM_XML2_ARGS}
)
set(LLVM_PATCH
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/llvm/src/external_llvm <
${PATCH_DIR}/llvm.diff
)
if(WIN32)
set(LLVM_GENERATOR "Ninja")
list(APPEND LLVM_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
set(LLVM_PATCH
${LLVM_PATCH} &&
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/llvm/src/external_llvm <
${PATCH_DIR}/llvm_clang_cuda_msvc_header_fix.diff
)
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
ExternalProject_Add(external_llvm
URL file://${PACKAGE_DIR}/${LLVM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LLVM_HASH_TYPE}=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR}
LIST_SEPARATOR ^^
PREFIX ${BUILD_DIR}/llvm
SOURCE_SUBDIR llvm
PATCH_COMMAND ${LLVM_PATCH}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm
${DEFAULT_CMAKE_FLAGS}
${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/llvm/lib
${HARVEST_TARGET}/llvm/lib &&
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/llvm/include
${HARVEST_TARGET}/llvm/include &&
${CMAKE_COMMAND} -E copy
${LIBDIR}/llvm/bin/clang-format.exe
${HARVEST_TARGET}/llvm/bin/clang-format.exe
)
else()
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/llvm/lib/
${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/llvm/include/
${HARVEST_TARGET}/llvm/debug/include/
)
endif()
ExternalProject_Add_Step(external_llvm after_install
COMMAND ${LLVM_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
else()
harvest(external_llvm llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(external_llvm llvm/bin llvm/bin "clang-tidy")
harvest(external_llvm llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(external_llvm llvm/include llvm/include "*")
harvest(external_llvm llvm/bin llvm/bin "llvm-config")
harvest(external_llvm llvm/lib llvm/lib "libLLVM*.a")
harvest(external_llvm llvm/lib llvm/lib "libclang*.a")
harvest(external_llvm llvm/lib/clang llvm/lib/clang "*.h")
endif()
# We currently do not build libxml2 on Windows.
if(UNIX)
add_dependencies(
external_llvm
external_xml2
)
endif()
add_dependencies(
external_llvm
external_python
)

View File

@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2002-2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(LZMA_PATCH_CMD echo .)
ExternalProject_Add(external_lzma
URL file://${PACKAGE_DIR}/${LZMA_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LZMA_HASH_TYPE}=${LZMA_HASH}
PREFIX ${BUILD_DIR}/lzma
PATCH_COMMAND ${LZMA_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lzma/src/external_lzma/ &&
${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lzma --disable-shared
BUILD_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lzma/src/external_lzma/ &&
make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/lzma/src/external_lzma/ &&
make install
INSTALL_DIR ${LIBDIR}/lzma
)

View File

@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# shorthand to only unpack a certain dependency
function(unpack_only name)
string(TOUPPER ${name} UPPER_NAME)
set(TARGET_FILE ${${UPPER_NAME}_FILE})
set(TARGET_HASH_TYPE ${${UPPER_NAME}_HASH_TYPE})
set(TARGET_HASH ${${UPPER_NAME}_HASH})
ExternalProject_Add(external_${name}
URL file://${PACKAGE_DIR}/${TARGET_FILE}
URL_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/${name}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
endfunction()

View File

@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2002-2025 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(MANIFOLD_EXTRA_ARGS
-DMANIFOLD_JSBIND=OFF
-DMANIFOLD_CBIND=OFF
-DMANIFOLD_PYBIND=OFF
-DMANIFOLD_PAR=ON
-DMANIFOLD_CROSS_SECTION=OFF
-DMANIFOLD_EXPORT=OFF
-DMANIFOLD_DEBUG=OFF
-DMANIFOLD_TEST=OFF
-DMANIFOLD_DOWNLOADS=OFF
-DTBB_ROOT=${LIBDIR}/tbb/
-DTRACY_ENABLE=OFF
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
)
ExternalProject_Add(external_manifold
URL file://${PACKAGE_DIR}/${MANIFOLD_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MANIFOLD_HASH_TYPE}=${MANIFOLD_HASH}
PREFIX ${BUILD_DIR}/manifold
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/manifold
${DEFAULT_CMAKE_FLAGS}
${MANIFOLD_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/manifold
)
add_dependencies(
external_manifold
external_tbb
)
if(WIN32)
ExternalProject_Add_Step(external_manifold after_install
COMMAND
${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/manifold/
${HARVEST_TARGET}/manifold/
DEPENDEES install
)
else()
harvest(external_manifold manifold/include manifold/include "*.h")
harvest(external_manifold manifold/lib manifold/lib "*.a")
harvest(external_manifold manifold/lib/cmake/manifold manifold/lib/cmake/manifold "*.cmake")
endif()

View File

@@ -0,0 +1,119 @@
# SPDX-FileCopyrightText: 2022-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(MATERIALX_EXTRA_ARGS
-DMATERIALX_BUILD_PYTHON=ON
-DMATERIALX_BUILD_RENDER=ON
-DMATERIALX_INSTALL_PYTHON=OFF
-DMATERIALX_PYTHON_EXECUTABLE=${PYTHON_BINARY}
-DMATERIALX_PYTHON_VERSION=${PYTHON_SHORT_VERSION}
-DMATERIALX_BUILD_SHARED_LIBS=ON
-DMATERIALX_BUILD_TESTS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
# This policy makes pybind11_ROOT work.
-DCMAKE_POLICY_DEFAULT_CMP0074=NEW
-Dpybind11_ROOT=${LIBDIR}/pybind11
-DPython_EXECUTABLE=${PYTHON_BINARY}
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=.pyd)
else()
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_MODULE_EXTENSION=_d.pyd)
endif()
list(APPEND MATERIALX_EXTRA_ARGS -DPYTHON_LIBRARIES=${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib)
endif()
if(UNIX AND NOT APPLE)
list(APPEND MATERIALX_EXTRA_ARGS
-DCMAKE_SHARED_LINKER_FLAGS=-Wl,--version-script="${CMAKE_SOURCE_DIR}/linux/materialx_symbols_unix.map"
)
endif()
ExternalProject_Add(external_materialx
URL file://${PACKAGE_DIR}/${MATERIALX_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MATERIALX_HASH_TYPE}=${MATERIALX_HASH}
PREFIX ${BUILD_DIR}/materialx
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND
${PATCH_CMD} -p 1 -d
${BUILD_DIR}/materialx/src/external_materialx
-i ${PATCH_DIR}/materialx_2866.diff
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/materialx
${DEFAULT_CMAKE_FLAGS}
${MATERIALX_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/materialx
)
if(WIN32)
set(MATERIALX_PYTHON_TARGET ${HARVEST_TARGET}/materialx/python/${BUILD_MODE})
string(REPLACE "/" "\\" MATERIALX_PYTHON_TARGET_DOS "${MATERIALX_PYTHON_TARGET}")
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_materialx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/include
${HARVEST_TARGET}/materialx/include
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/libraries
${HARVEST_TARGET}/materialx/libraries
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/lib/
${HARVEST_TARGET}/materialx/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/bin/
${HARVEST_TARGET}/materialx/bin/
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/python/
${MATERIALX_PYTHON_TARGET}
COMMAND del ${MATERIALX_PYTHON_TARGET_DOS}\\MaterialX\\*.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_materialx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/lib/
${HARVEST_TARGET}/materialx/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/bin/
${HARVEST_TARGET}/materialx/bin/
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/materialx/python/
${MATERIALX_PYTHON_TARGET}
COMMAND del ${MATERIALX_PYTHON_TARGET_DOS}\\MaterialX\\*.lib
DEPENDEES install
)
endif()
unset(MATERIALX_PYTHON_TARGET)
unset(MATERIALX_PYTHON_TARGET_DOS)
else()
harvest(external_materialx materialx/include materialx/include "*.h")
# CMake files first because harvest_rpath_lib edits them.
harvest(external_materialx materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
harvest_rpath_lib(external_materialx materialx/lib materialx/lib "*${SHAREDLIBEXT}*")
harvest(external_materialx materialx/libraries materialx/libraries "*")
harvest_rpath_python(external_materialx
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(external_materialx materialx/resources materialx/resources "README.md")
endif()
add_dependencies(
external_materialx
external_python
external_pybind11
)

View File

@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2026 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(MESHOPTIMIZER_EXTRA_ARGS
-DMESHOPT_BUILD_SHARED_LIBS=ON
)
if(WIN32)
set(MESHOPTIMIZER_EXTRA_ARGS
${MESHOPTIMIZER_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d
)
endif()
ExternalProject_Add(external_meshoptimizer
URL file://${PACKAGE_DIR}/${MESHOPTIMIZER_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MESHOPTIMIZER_HASH_TYPE}=${MESHOPTIMIZER_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/meshoptimizer
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/meshoptimizer
${DEFAULT_CMAKE_FLAGS}
${MESHOPTIMIZER_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/meshoptimizer
)
if(WIN32)
ExternalProject_Add_Step(external_meshoptimizer after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory
${LIBDIR}/meshoptimizer/
${HARVEST_TARGET}/meshoptimizer
DEPENDEES install
)
else()
harvest(external_meshoptimizer meshoptimizer/include meshoptimizer/include "*.h")
# CMake files first because harvest_rpath_lib edits them.
harvest(external_meshoptimizer meshoptimizer/lib/cmake/meshoptimizer meshoptimizer/lib/cmake/meshoptimizer "*.cmake")
harvest_rpath_lib(external_meshoptimizer meshoptimizer/lib meshoptimizer/lib "*${SHAREDLIBEXT}*")
endif()

View File

@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2022 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
set(MINIZIPNG_EXTRA_ARGS
# Disable most compression methods like OpenColorIO does, enabling
# more is not needed and will give link errors.
-DMZ_FETCH_LIBS=OFF
-DMZ_LIBCOMP=OFF
-DMZ_PKCRYPT=OFF
-DMZ_WZAES=OFF
-DMZ_OPENSSL=OFF
-DMZ_SIGNING=OFF
-DMZ_LZMA=OFF
-DMZ_ZSTD=OFF
-DMZ_BZIP2=OFF
-DMZ_ICONV=OFF
-DMZ_ZLIB=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
# Because OCIO hardcodes a non standard include path
-DCMAKE_INSTALL_INCLUDEDIR=${LIBDIR}/minizipng/include/minizip-ng
)
ExternalProject_Add(external_minizipng
URL file://${PACKAGE_DIR}/${MINIZIPNG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MINIZIPNG_HASH_TYPE}=${MINIZIPNG_HASH}
PREFIX ${BUILD_DIR}/minizipng
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${LIBDIR}/minizipng
${DEFAULT_CMAKE_FLAGS}
${MINIZIPNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/minizipng
)
add_dependencies(
external_minizipng
external_zlib
)

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