Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make jpegxr more optional #13404

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,25 @@ jobs:
os: macos-latest
target: x86_64-apple-darwin
MACOSX_DEPLOYMENT_TARGET: 10.7
DESKTOP_FEATURES: sandbox
DESKTOP_FEATURES: sandbox,jpegxr

- build_name: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET: 11.0
DESKTOP_FEATURES: sandbox
DESKTOP_FEATURES: sandbox,jpegxr

- build_name: windows-x86_32
os: windows-latest
target: i686-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
DESKTOP_FEATURES: jpegxr

- build_name: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
RUSTFLAGS: -Ctarget-feature=+crt-static
DESKTOP_FEATURES: jpegxr

env:
PACKAGE_FILE: ${{ needs.create-nightly-release.outputs.package_prefix }}-${{ matrix.build_name }}.${{ startsWith(matrix.build_name, 'win') && 'zip' || 'tar.gz' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
RUSTDOCFLAGS: -D warnings

- name: Run tests with image tests
run: cargo test --all --locked --features imgtests,lzma
run: cargo test --all --locked --features imgtests,lzma,jpegxr
env:
XDG_RUNTIME_DIR: '' # dummy value, just to silence warnings about it missing

Expand Down
3 changes: 2 additions & 1 deletion desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ embed-resource = "2"
vergen = { version = "8.2.5", features = ["build", "git", "gitcl", "cargo"] }

[features]
default = ["software_video", "ruffle_core/jpegxr"]
default = ["software_video"]
jpegxr = ["ruffle_core/jpegxr"]

# core features
avm_debug = ["ruffle_core/avm_debug"]
Expand Down
3 changes: 2 additions & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ url = "2.4.1"
# Enable running image comparison tests. This is off by default,
# since the images we compare against are generated on CI, and may
# not match your local machine's Vulkan version / image output.
imgtests = ["ruffle_video_software", "ruffle_core/jpegxr"]
imgtests = ["ruffle_video_software"]
jpegxr = ["ruffle_core/jpegxr"]
lzma = ["ruffle_core/lzma"]

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ trigger = "last_frame" # When to trigger this capture. Options are last_frame (d
# Which build features are required for this test to run.
[required_features]
lzma = false # If LZMA support is enabled in this build
jpegxr = false # If JPEG XR support is enabled in this build
```

## Frame-based tests
Expand Down
5 changes: 4 additions & 1 deletion tests/tests/swfs/avm2/stage3d_texture_bytearray/test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ num_frames = 1
tolerance = 2

[player_options]
with_renderer = { optional = true, sample_count = 1 }
with_renderer = { optional = true, sample_count = 1 }

[required_features]
jpegxr = true
3 changes: 2 additions & 1 deletion tests/tests/util/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,12 @@ impl Approximations {
#[serde(default, deny_unknown_fields)]
pub struct RequiredFeatures {
lzma: bool,
jpegxr: bool,
}

impl RequiredFeatures {
pub fn can_run(&self) -> bool {
!self.lzma || cfg!(feature = "lzma")
(!self.lzma || cfg!(feature = "lzma")) && (!self.jpegxr || cfg!(feature = "jpegxr"))
}
}

Expand Down