Skip to content

Commit

Permalink
Try using pkgconfig to find glfw3
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuuzetsu committed Feb 28, 2024
1 parent 7e69112 commit 5924245
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ path = "lib.rs"

[build-dependencies]
cmake = "0.1"
pkg-config = "0.3"

[features]
wayland = []
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
extern crate cmake;
extern crate pkg_config;

use cmake::Config;

fn main() {
if pkg_config::probe_library("glfw3").is_ok() {
// We got the library via pkg_config, we don't need to try and build it
// below.
return;
}

let mut cfg = Config::new("glfw");

cfg.define("GLFW_BUILD_EXAMPLES", "OFF")
Expand Down

0 comments on commit 5924245

Please sign in to comment.