Skip to content

Commit

Permalink
Merge pull request #34 from kornelski/libwebp14
Browse files Browse the repository at this point in the history
Update to libwebp 1.4
  • Loading branch information
NoXF authored Oct 29, 2024
2 parents 9469a16 + bb0b7bf commit d69db04
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 1,111 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ readme = "README.md"
build = "build.rs"
homepage = "https://github.com/NoXF/libwebp-sys"
repository = "https://github.com/NoXF/libwebp-sys"
include = ["src/*.rs", "README.md", "build.rs", "/vendor/src/", "/vendor/sharpyuv", "/vendor/COPYING", "/vendor/PATENTS"]
exclude = ["*.sh", "*.am"]

edition = "2021"

[profile.test]
opt-level = 2

[build-dependencies]
cc = "1"
glob = "0.3"
cc = "1.1"
glob = "0.3.1"

[features]
default = ["std", "parallel"]
Expand Down
7 changes: 2 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ fn main() {
}

let mut cc = cc::Build::new();
let mut sharpyuv_build = cc::Build::new();
setup_build(&mut cc, &vendor);
setup_build(&mut sharpyuv_build, &vendor);

for f in glob::glob("vendor/src/**/*.c")
.expect("glob vender/src failed")
Expand All @@ -30,9 +28,8 @@ fn main() {

for f in glob::glob("vendor/sharpyuv/**/*.c").expect("glob vendor/src failed") {
let f = f.expect("glob iteration vendor/src failed");
sharpyuv_build.file(manifest_dir.join(f));
cc.file(manifest_dir.join(f));
}
sharpyuv_build.compile("sharpyuv");
cc.compile("webpsys");
}

Expand All @@ -52,7 +49,7 @@ fn setup_build(build: &mut cc::Build, include_dir: &PathBuf) {

let target_cpu = env::var("TARGET_CPU").ok();
let target_cpu = target_cpu.as_deref().unwrap_or(&*target_arch);
build.flag_if_supported(format!("-march={}", target_cpu));
build.flag_if_supported(&format!("-march={}", target_cpu));

match target_arch.as_str() {
"x86_64" | "i686" => {
Expand Down
Loading

0 comments on commit d69db04

Please sign in to comment.