mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 23:21:08 +03:00
macos related build tweaks
This commit is contained in:
parent
e2529d1837
commit
8024acff69
@ -32,6 +32,7 @@ addons:
|
||||
- libxcb-ewmh-dev
|
||||
- libxcb-icccm4-dev
|
||||
- libxcb-keysyms1-dev
|
||||
- ragel
|
||||
|
||||
#env:
|
||||
# global:
|
||||
|
@ -21,7 +21,7 @@ You will need a collection of support libraries; the example below shows which
|
||||
deps are needed for ubuntu systems:
|
||||
|
||||
```
|
||||
$ sudo apt-get install -y libxcb-icccm4-dev libxcb-ewmh-dev \
|
||||
$ sudo apt-get install -y ragel libxcb-icccm4-dev libxcb-ewmh-dev \
|
||||
libxcb-keysyms1-dev libfontconfig1-dev libfreetype6-dev libegl1-mesa-dev
|
||||
$ git clone --depth=1 --branch=master https://github.com/wez/wezterm.git
|
||||
$ cd wezterm
|
||||
|
@ -2,9 +2,16 @@ extern crate cmake;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let dst = cmake::Config::new("harfbuzz")
|
||||
.define("HB_HAVE_FREETYPE", "ON")
|
||||
.build();
|
||||
let mut dst = cmake::Config::new("harfbuzz");
|
||||
|
||||
if cfg!(any(
|
||||
target_os = "android",
|
||||
all(unix, not(target_os = "macos")),
|
||||
))
|
||||
{
|
||||
dst.define("HB_HAVE_FREETYPE", "ON");
|
||||
}
|
||||
let dst = dst.build();
|
||||
println!("cargo:rustc-link-search=native={}/lib", dst.display());
|
||||
println!("cargo:rustc-link-lib=static=harfbuzz");
|
||||
|
||||
|
@ -14,6 +14,7 @@ use std::mem;
|
||||
use std::ptr;
|
||||
use std::slice;
|
||||
|
||||
#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
|
||||
extern "C" {
|
||||
fn hb_ft_font_set_load_flags(font: *mut hb_font_t, load_flags: i32);
|
||||
}
|
||||
@ -55,6 +56,7 @@ impl Drop for Font {
|
||||
}
|
||||
|
||||
impl Font {
|
||||
#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
|
||||
/// Create a harfbuzz face from a freetype font
|
||||
pub fn new(face: freetype::freetype::FT_Face) -> Font {
|
||||
// hb_ft_font_create_referenced always returns a
|
||||
@ -64,6 +66,7 @@ impl Font {
|
||||
Font { font: unsafe { hb_ft_font_create_referenced(face) } }
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))]
|
||||
pub fn set_load_flags(&mut self, load_flags: freetype::freetype::FT_Int32) {
|
||||
unsafe {
|
||||
hb_ft_font_set_load_flags(self.font, load_flags);
|
||||
|
Loading…
Reference in New Issue
Block a user