Include FreeBSD in conditional compile attributes (#8246)

This commit is contained in:
Andie Bradley 2025-09-20 21:46:46 -05:00 committed by GitHub
parent 0b38e96379
commit f6005a16c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View File

@ -127,6 +127,13 @@ jobs:
tier: 1
kind: native
# FreeBSD
- name: FreeBSD x86_64
os: ubuntu-24.04
target: x86_64-unknown-freebsd
tier: 2
kind: wgpu-only
# Android
- name: Android aarch64
os: ubuntu-24.04

View File

@ -161,7 +161,7 @@ wgpu-core-deps-apple = { workspace = true, optional = true }
wgpu-core-deps-emscripten = { workspace = true, optional = true }
[target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
wgpu-core-deps-wasm = { workspace = true, optional = true }
[target.'cfg(any(windows, target_os = "linux", target_os = "android"))'.dependencies]
[target.'cfg(any(windows, target_os = "linux", target_os = "android", target_os = "freebsd"))'.dependencies]
wgpu-core-deps-windows-linux-android = { workspace = true, optional = true }
[dependencies]

View File

@ -1,6 +1,6 @@
fn main() {
cfg_aliases::cfg_aliases! {
windows_linux_android: { any(windows, target_os = "linux", target_os = "android") },
windows_linux_android: { any(windows, target_os = "linux", target_os = "android", target_os = "freebsd") },
send_sync: { all(
feature = "std",
any(

View File

@ -23,5 +23,5 @@ dx12 = ["wgpu-hal/dx12"]
renderdoc = ["wgpu-hal/renderdoc"]
# Depend on wgpu-hal conditionally, so that the above features only apply to wgpu-hal on this set of platforms.
[target.'cfg(any(windows, target_os = "linux", target_os = "android"))'.dependencies]
[target.'cfg(any(windows, target_os = "linux", target_os = "android", target_os = "freebsd"))'.dependencies]
wgpu-hal.workspace = true

View File

@ -16,7 +16,7 @@ fn main() {
metal: { all(target_vendor = "apple", feature = "metal") },
vulkan: { any(
// The `vulkan` feature enables the Vulkan backend only on "native Vulkan" platforms, i.e. Windows/Linux/Android
all(any(windows, target_os = "linux", target_os = "android"), feature = "vulkan"),
all(any(windows, target_os = "linux", target_os = "android", target_os = "freebsd"), feature = "vulkan"),
// On Apple platforms, however, we require the `vulkan-portability` feature
// to explicitly opt-in to Vulkan since it's meant to be used with MoltenVK.
all(target_vendor = "apple", feature = "vulkan-portability")
@ -24,7 +24,7 @@ fn main() {
gles: { any(
// The `gles` feature enables the OpenGL/GLES backend only on "native OpenGL" platforms, i.e. Windows, Linux, Android, and Emscripten.
// (Note that WebGL is also not included here!)
all(any(windows, target_os = "linux", target_os = "android", Emscripten), feature = "gles"),
all(any(windows, target_os = "linux", target_os = "android", target_os = "freebsd", Emscripten), feature = "gles"),
// On Apple platforms, however, we require the `angle` feature to explicitly opt-in to OpenGL
// since its meant to be used with ANGLE.
all(target_vendor = "apple", feature = "angle")