[Wconversion] Suppress warnings
Undo the previous change where I recklessly wrecked a bunch of things.
Properly add -Wno-conversion this time around.
Bug: 56258
Bug: 58162
Change-Id: I1f497f68ba77da8c24ab53533c74f72a5a60f769
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/freetype2/+/424325
Reviewed-by: Shai Barack <shayba@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 680534d..cbde222 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -25,40 +25,38 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
config("freetype_config") {
- include_dirs = [ "include" ]
-
+ include_dirs = [
+ "include",
+ ]
cflags = []
-
if (is_clang) {
cflags += [
+ "-Wno-conversion",
"-Wno-unused-function",
"-Wno-unused-variable",
]
}
}
-
config("freetype_config_for_rust_host") {
# Without `-fPIC`, we get the error:
# > ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly
# > segment
- cflags = [ "-fPIC" ]
+ cflags = ["-fPIC"]
}
-
#TODO(mikejurka): Remove once we've migrated to the freetype2 target everywhere
group("freetype") {
- public_deps = [ ":freetype2" ]
+ public_deps = [
+ ":freetype2",
+ ]
}
-
template("freetype_library") {
target(invoker.library_type, target_name) {
+ forward_variables_from(invoker, "*")
if (!defined(rust_host)) {
rust_host = false
}
-
- shared_lib = library_type == "shared_library"
-
+ shared_lib = (library_type == "shared_library")
sources = [
"src/autofit/autofit.c",
"src/base/ftbase.c",
@@ -71,9 +69,9 @@
"src/base/ftinit.c",
"src/base/ftmm.c",
"src/base/ftstroke.c",
- "src/base/ftsynth.c",
"src/base/ftsystem.c",
"src/base/fttype1.c",
+ "src/base/ftsynth.c",
"src/gzip/ftgzip.c",
"src/lzw/ftlzw.c",
"src/psaux/psaux.c",
@@ -81,27 +79,20 @@
"src/psnames/psnames.c",
"src/sfnt/sfnt.c",
"src/smooth/smooth.c",
-
# Font Drivers. Drivers need to be enabled in ftmodule.h explicitly.
- "src/cff/cff.c", # OpenType, (.cff, .cef)
- "src/truetype/truetype.c", # TrueType
+ "src/cff/cff.c", # OpenType, (.cff, .cef)
+ "src/truetype/truetype.c", # TrueType
]
-
# TODO(46923): UBSan has found an instance of undefined behavior in this target.
# Disable UBSan for this target temporarily until it is migrated into CI/CQ.
configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ]
- # TODO(fxb/58162): delete the below and fix compiler warnings
- configs += [ "//build/config:Wno-conversion" ]
-
defines = [
"FT2_BUILD_LIBRARY",
"DARWIN_NO_CARBON",
-
# Long directory name to avoid accidentally using wrong headers.
"FT_CONFIG_MODULES_H=<freetype-fuchsia-config/ftmodule.h>",
"FT_CONFIG_OPTIONS_H=<freetype-fuchsia-config/ftoption.h>",
]
-
if (shared_lib) {
defines += [
"FT_EXPORT(x)=extern __attribute__(( visibility( \"default\" ) )) x",
@@ -112,28 +103,23 @@
# Reduce visibility of symbols.
defines += [ "FT_EXPORT(x)=x" ]
}
-
if (!rust_host) {
defines += [ "FT_CONFIG_OPTION_USE_PNG" ]
}
-
public_configs = [ ":freetype_config" ]
-
if (rust_host) {
- public_configs += [ ":freetype_config_for_rust_host" ]
+ public_configs += [":freetype_config_for_rust_host"]
}
-
if (rust_host) {
- deps = [ "//third_party/zlib:zlib_for_rust_host" ]
+ deps = ["//third_party/zlib:zlib_for_rust_host"]
} else {
deps = [
"//third_party/libpng",
- "//third_party/zlib",
+ "//third_party/zlib"
]
}
}
}
-
freetype_library("freetype2") {
# Shared libs are disabled in host toolchain.
if (current_toolchain == host_toolchain) {
@@ -142,7 +128,6 @@
library_type = "shared_library"
}
}
-
# TODO(36315): Remove workaround for Rust host_toolchain
freetype_library("freetype2_for_rust_host") {
library_type = "static_library"