chromium-src-build/linux/BUILD.gn

50 строки
1.8 KiB
Plaintext
Исходник Обычный вид История

# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/features.gni")
Build FreeType and HarfBuzz together. The effect of this change is to hide the FreeType and HarfBuzz builds from the rest of the build except for a new component library named 'freetype_harfbuzz'. All existing users of the 'freetype' and 'harfbuzz' targets will instead depend on the 'freetype_harfbuzz' target. The 'freetype_harfbuzz' component will depend on the appropriate source sets or export the system packages for both FreeType and HarfBuzz. The reason for this change is that the full FreeType and HarfBuzz libraries we desire are circularly dependent. Before this change the build attempted to work around this by building HarfBuzz as a static library which also pulled in a small bootstrap FreeType static library. However, this causes ODR violations in component build, and potentially in the non-component build as well. Recent changes in FreeType cause FreeType to act incorrectly in these circumstances, so these ODR issues are preventing FreeType from rolling. A different approach would be to 1) Compile all the sources. 2) Link the base libraries. 3) Link the complete libraries against the base libraries. 4) Create the final libraries from the complete libraries by re-targeting the dependent library names directly. This last step can in theory be done for ELF using a tool like patchelf --replace-needed <other complete library path> <other final library path> <complete library> that outputs to <final library path> instead of updating in place. However, even if there were such a tool for dlls, this is something which would be needed on any platform. As a result, this only seems promising if all linkers supported this sort of re-writing. BUG=chromium:768938 Change-Id: I488dc8cde8f6a8f88903d25f13ecd61fd2d74a3f Reviewed-on: https://chromium-review.googlesource.com/696241 Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Dominik Röttsches <drott@chromium.org> Reviewed-by: Elliot Glaysher <erg@chromium.org> Reviewed-by: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Ben Wagner <bungeman@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#507381} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 7619f01f1fa10674df56b9921df2f94718478201
2017-10-09 18:35:00 +03:00
import("//build/config/freetype/freetype.gni")
import("//build/config/linux/pkg_config.gni")
if (use_gio) {
pkg_config("gio_config") {
packages = [ "gio-2.0" ]
# glib >=2.40 deprecate g_settings_list_schemas in favor of
# g_settings_schema_source_list_schemas. This function is not available on
# earlier versions that we still need to support (specifically, 2.32), so
# disable the warning with the GLIB_DISABLE_DEPRECATION_WARNINGS define.
# TODO(mgiuca): Remove this suppression when we drop support for Ubuntu
# 13.10 (saucy) and earlier. Update the code to use
# g_settings_schema_source_list_schemas instead.
defines = [
"USE_GIO",
"GLIB_DISABLE_DEPRECATION_WARNINGS",
]
# TODO(brettw) Theoretically I think ignore_libs should be set so that we
# don't link directly to GIO and use the loader generated below. But the
# gio target in GYP doesn't make any sense to me and appears to link
# directly to GIO in addition to making a loader. This this uncommented,
# the link in component build fails, so I think this is closer to the
# GYP build.
#ignore_libs = true # Loader generated below.
}
}
# Looking for libspeechd? Use //third_party/speech-dispatcher
Build FreeType and HarfBuzz together. The effect of this change is to hide the FreeType and HarfBuzz builds from the rest of the build except for a new component library named 'freetype_harfbuzz'. All existing users of the 'freetype' and 'harfbuzz' targets will instead depend on the 'freetype_harfbuzz' target. The 'freetype_harfbuzz' component will depend on the appropriate source sets or export the system packages for both FreeType and HarfBuzz. The reason for this change is that the full FreeType and HarfBuzz libraries we desire are circularly dependent. Before this change the build attempted to work around this by building HarfBuzz as a static library which also pulled in a small bootstrap FreeType static library. However, this causes ODR violations in component build, and potentially in the non-component build as well. Recent changes in FreeType cause FreeType to act incorrectly in these circumstances, so these ODR issues are preventing FreeType from rolling. A different approach would be to 1) Compile all the sources. 2) Link the base libraries. 3) Link the complete libraries against the base libraries. 4) Create the final libraries from the complete libraries by re-targeting the dependent library names directly. This last step can in theory be done for ELF using a tool like patchelf --replace-needed <other complete library path> <other final library path> <complete library> that outputs to <final library path> instead of updating in place. However, even if there were such a tool for dlls, this is something which would be needed on any platform. As a result, this only seems promising if all linkers supported this sort of re-writing. BUG=chromium:768938 Change-Id: I488dc8cde8f6a8f88903d25f13ecd61fd2d74a3f Reviewed-on: https://chromium-review.googlesource.com/696241 Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Dominik Röttsches <drott@chromium.org> Reviewed-by: Elliot Glaysher <erg@chromium.org> Reviewed-by: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Ben Wagner <bungeman@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#507381} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 7619f01f1fa10674df56b9921df2f94718478201
2017-10-09 18:35:00 +03:00
if (use_system_freetype) {
assert(!is_chromecast)
# Only provided for distributions which prefer to keep linking to FreeType on
# the system, use with caution,for details see build/config/freetype/BUILD.gn.
pkg_config("freetype_from_pkgconfig") {
Build FreeType and HarfBuzz together. The effect of this change is to hide the FreeType and HarfBuzz builds from the rest of the build except for a new component library named 'freetype_harfbuzz'. All existing users of the 'freetype' and 'harfbuzz' targets will instead depend on the 'freetype_harfbuzz' target. The 'freetype_harfbuzz' component will depend on the appropriate source sets or export the system packages for both FreeType and HarfBuzz. The reason for this change is that the full FreeType and HarfBuzz libraries we desire are circularly dependent. Before this change the build attempted to work around this by building HarfBuzz as a static library which also pulled in a small bootstrap FreeType static library. However, this causes ODR violations in component build, and potentially in the non-component build as well. Recent changes in FreeType cause FreeType to act incorrectly in these circumstances, so these ODR issues are preventing FreeType from rolling. A different approach would be to 1) Compile all the sources. 2) Link the base libraries. 3) Link the complete libraries against the base libraries. 4) Create the final libraries from the complete libraries by re-targeting the dependent library names directly. This last step can in theory be done for ELF using a tool like patchelf --replace-needed <other complete library path> <other final library path> <complete library> that outputs to <final library path> instead of updating in place. However, even if there were such a tool for dlls, this is something which would be needed on any platform. As a result, this only seems promising if all linkers supported this sort of re-writing. BUG=chromium:768938 Change-Id: I488dc8cde8f6a8f88903d25f13ecd61fd2d74a3f Reviewed-on: https://chromium-review.googlesource.com/696241 Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Dominik Röttsches <drott@chromium.org> Reviewed-by: Elliot Glaysher <erg@chromium.org> Reviewed-by: Alex Clarke <alexclarke@chromium.org> Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Ben Wagner <bungeman@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#507381} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 7619f01f1fa10674df56b9921df2f94718478201
2017-10-09 18:35:00 +03:00
visibility = [
"//third_party:freetype_harfbuzz",
"//third_party/harfbuzz-ng:harfbuzz_source",
]
packages = [ "freetype2" ]
}
}