forked from yeslogic/fontconfig-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dlopen Cargo feature using dlib to load fontconfig at runtime
Fixes yeslogic#11
- Loading branch information
Showing
9 changed files
with
455 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
members = [ | ||
"fontconfig-sys", | ||
"fontconfig" | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[package] | ||
name = "yeslogic-fontconfig-sys" | ||
version = "2.11.2" | ||
version = "3.0.0" | ||
edition = "2018" | ||
rust-version = "1.46" | ||
authors = [ | ||
"Austin Bonander <[email protected]>", | ||
"The Servo Project Developers", | ||
|
@@ -16,7 +18,6 @@ homepage = "https://github.com/yeslogic/fontconfig-rs" | |
documentation = "https://docs.rs/crate/yeslogic-fontconfig-sys" | ||
repository = "https://github.com/yeslogic/fontconfig-rs" | ||
|
||
build = "build.rs" | ||
links = "fontconfig" | ||
|
||
[badges] | ||
|
@@ -27,6 +28,13 @@ name = "fontconfig_sys" | |
|
||
[dependencies] | ||
const-cstr = "0.3" | ||
dlib = "0.5.0" | ||
# This cannot be optional because build.rs can't conditionally enable it | ||
# when the RUST_FONTCONFIG_DLOPEN environment variable is set. | ||
lazy_static = "1.4.0" | ||
|
||
[features] | ||
dlopen = [] | ||
|
||
[build-dependencies] | ||
pkg-config = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
extern crate pkg_config; | ||
|
||
fn main() { | ||
pkg_config::find_library("fontconfig").unwrap(); | ||
let dlopen = std::env::var("RUST_FONTCONFIG_DLOPEN").is_ok(); | ||
if dlopen { | ||
println!("cargo:rustc-cfg=feature=\"dlopen\""); | ||
} | ||
if !(dlopen || cfg!(feature = "dlopen")) { | ||
pkg_config::find_library("fontconfig").unwrap(); | ||
} | ||
} |
Oops, something went wrong.