Skip to content

Commit

Permalink
Link to webkit2gtk only, do not try to compile any C/C++ dependencies…
Browse files Browse the repository at this point in the history
…, there aren't any

fixes #245
  • Loading branch information
richardhozak committed Dec 9, 2020
1 parent eb621f8 commit 23b8cab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "web-view"
version = "0.7.1"
version = "0.7.2"
authors = ["Boscop", "zxey <[email protected]>", "Sam Green <[email protected]>"]
readme = "README.md"
license = "MIT"
Expand All @@ -12,7 +12,7 @@ exclude = ["examples/todo-ps/dist/**/*", "examples/elm-counter/index.html"]

[dependencies]
urlencoding = "1.1"
webview-sys = { path = "webview-sys", version = "0.6" }
webview-sys = { path = "webview-sys", version = "0.6.1" }
boxfnonce = "0.1"
tinyfiledialogs = "3.3"

Expand Down
2 changes: 1 addition & 1 deletion webview-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "webview-sys"
version = "0.6.0"
version = "0.6.1"
authors = ["Boscop", "zxey <[email protected]>"]
license = "MIT"
repository = "https://github.com/Boscop/web-view"
Expand Down
20 changes: 13 additions & 7 deletions webview-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@ extern crate pkg_config;
use std::env;

fn main() {
let mut build = cc::Build::new();

let target = env::var("TARGET").unwrap();

if target.contains("linux") || target.contains("bsd") {
// linux or bsd need to link to webkit2gtk library only,
// there is no C/C++ code to compile as in other platforms
pkg_config::Config::new()
.atleast_version("2.8")
.probe("webkit2gtk-4.0")
.unwrap();

return;
}

let mut build = cc::Build::new();

build
.include("webview.h")
.flag_if_supported("-std=c11")
Expand Down Expand Up @@ -37,11 +48,6 @@ fn main() {
println!("cargo:rustc-link-lib={}", lib);
}
}
} else if target.contains("linux") || target.contains("bsd") {
pkg_config::Config::new()
.atleast_version("2.8")
.probe("webkit2gtk-4.0")
.unwrap();
} else if target.contains("apple") {
build
.file("webview_cocoa.c")
Expand Down

0 comments on commit 23b8cab

Please sign in to comment.