1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
wezterm/deps/freetype/build.rs
2019-03-23 11:30:34 -07:00

39 lines
1.1 KiB
Rust

use cmake::Config;
use std::env;
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")
.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() {
zlib();
libpng();
freetype();
let out_dir = env::var("OUT_DIR").unwrap();
println!("cargo:outdir={}", out_dir);
}