1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00
wezterm/deps/freetype/build.rs

39 lines
1.1 KiB
Rust
Raw Normal View History

use cmake::Config;
use std::env;
2019-03-23 21:14:53 +03:00
fn zlib() {
let mut config = Config::new("zlib");
let dst = config.profile("Release").build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=z");
}
fn libpng() {
let mut config = Config::new("libpng");
let dst = config.profile("Release").build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=png");
}
fn freetype() {
let mut config = Config::new("freetype2");
let dst = config
.define("FT_WITH_PNG", "ON")
2019-03-23 20:51:09 +03:00
.define("CMAKE_DISABLE_FIND_PACKAGE_BZip2", "TRUE")
.profile("Release")
.build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=freetype");
println!("cargo:rustc-link-search=native=/usr/lib");
println!("cargo:include={}/include/freetype2", dst.display());
println!("cargo:lib={}/lib/libfreetype.a", dst.display());
}
fn main() {
2019-03-23 21:14:53 +03:00
zlib();
libpng();
freetype();
let out_dir = env::var("OUT_DIR").unwrap();
println!("cargo:outdir={}", out_dir);
}