Skip to content

Commit

Permalink
Merge "[freetype] Build freetype2 as a shared library."
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyUlanov authored and Gerrit Code Review committed Sep 21, 2018
2 parents 6581fd3 + 38d69ce commit 312d4e9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ group("freetype") {
]
}

source_set("freetype2") {
# Shared libs are disabled in host toolchain.
shared_lib = (current_toolchain != host_toolchain)

if (shared_lib) {
library_type = "shared_library"
} else {
library_type = "source_set"
}

target(library_type, "freetype2") {
sources = [
"src/autofit/autofit.c",
"src/base/ftbase.c",
Expand Down Expand Up @@ -94,6 +103,14 @@ source_set("freetype2") {
"FT_EXPORT(x)=x",
]

if (shared_lib) {
defines += [
"FT_EXPORT(x)=extern __attribute__(( visibility( \"default\" ) )) x",
"FT_EXPORT_DEF(x)=extern __attribute__(( visibility( \"default\" ) )) x",
"FT_EXPORT_VAR(x)=extern __attribute__(( visibility( \"default\" ) )) x",
]
}

public_configs = [ ":freetype_config" ]

deps = [
Expand Down

0 comments on commit 312d4e9

Please sign in to comment.