Skip to content
This repository was archived by the owner on Jun 8, 2020. It is now read-only.

Fix build on FreeBSD #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ if(NOT APPLE AND NOT WIN32)
message(STATUS "Using FREETYPE_CLDFLAGS: " ${FREETYPE_CLDFLAGS})
add_definitions(${FREETYPE_CFLAGS})
link_libraries(${FREETYPE_CLDFLAGS})
EXEC_PROGRAM(pkg-config ARGS --cflags fontconfig OUTPUT_VARIABLE FONTCONFIG_CFLAGS RESULT_VARIABLE FONTCONFIG_NOT_FOUND)
if(FONTCONFIG_NOT_FOUND)
message(FATAL_ERROR "Fontconfig is required by rust-azure for this build, but it was not built by the fontconfig crate nor found by pkg-config")
endif()
EXEC_PROGRAM(pkg-config ARGS --libs fontconfig OUTPUT_VARIABLE FONTCONFIG_CLDFLAGS)
message(STATUS "Using FONTCONFIG_CFLAGS: " ${FONTCONFIG_CFLAGS})
message(STATUS "Using FONTCONFIG_CLDFLAGS: " ${FONTCONFIG_CLDFLAGS})
add_definitions(${FONTCONFIG_CFLAGS})
link_libraries(${FONTCONFIG_CLDFLAGS})
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ serde = {version = "1.0", optional = true}
serde_derive = {version = "1.0", optional = true}
servo-skia = "0.30000006"

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
servo-freetype-sys = "4.0.1"
9 changes: 9 additions & 0 deletions src/linkhack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ extern { }
#[link(name = "ApplicationServices", kind = "framework")]
extern { }

#[cfg(target_os = "freebsd")]
#[link(name = "azure", kind = "static")]
#[link(name = "c++")]
#[link(name = "freetype")]
#[link(name = "bz2")]
#[link(name = "fontconfig")]
#[link(name = "expat")]
#[link(name = "X11")]
extern { }