diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-09-24 16:54:28 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-04 10:19:55 +0200 |
commit | 2a2a1280730a96760ccb0c1b307ad7a644e8a8e1 (patch) | |
tree | dd54d22a0473d58a127334ece11cca14369bc4e2 | |
parent | 19a0ec849dd48fbb0964b41f21c2c56e0944bce3 (diff) | |
download | qtwebengine-chromium-2a2a1280730a96760ccb0c1b307ad7a644e8a8e1.tar.gz |
Add qt static dependencies: qtfreetype, qtharfbuzz
For static build of pdfium we need to take deps
form qtbase, pdfium uses freetype, which needs harfbuzz,
Update build for freetype and harfbuzz in third party, so
code can be compiled with that headers.
It seems if qtfreetype is used we no longer need harfbuzz
dependency, but harfbuzz build changes are introduced for
completeness.
Note we are only interested in include path, since qmake is doing
final link, otherwise lib_dirs can be passed in same manner.
Task-number: QTBUG-87154
Change-Id: I46ade3cfe134d5102a941270fbb90a1fa455e46a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/build/config/freetype/BUILD.gn | 4 | ||||
-rw-r--r-- | chromium/build/config/freetype/freetype.gni | 2 | ||||
-rw-r--r-- | chromium/build/linux/BUILD.gn | 14 | ||||
-rw-r--r-- | chromium/third_party/BUILD.gn | 6 | ||||
-rw-r--r-- | chromium/third_party/freetype/BUILD.gn | 27 | ||||
-rw-r--r-- | chromium/third_party/harfbuzz-ng/BUILD.gn | 12 | ||||
-rw-r--r-- | chromium/third_party/harfbuzz-ng/harfbuzz.gni | 2 |
7 files changed, 50 insertions, 17 deletions
diff --git a/chromium/build/config/freetype/BUILD.gn b/chromium/build/config/freetype/BUILD.gn index 76cb025fbb4..1da7a5daf48 100644 --- a/chromium/build/config/freetype/BUILD.gn +++ b/chromium/build/config/freetype/BUILD.gn @@ -7,7 +7,9 @@ import("//build/config/freetype/freetype.gni") group("freetype") { if (use_system_freetype) { - public_configs = [ "//build/linux:freetype_from_pkgconfig" ] + public_configs = [ "//third_party/freetype:freetype_from_pkgconfig" ] + } else if (use_qt_freetype) { + public_configs = [ "//third_party/freetype:freetype_from_qt" ] } else { public_deps = [ "//third_party:freetype_harfbuzz" ] } diff --git a/chromium/build/config/freetype/freetype.gni b/chromium/build/config/freetype/freetype.gni index b4eced2d650..fdf0f1522e7 100644 --- a/chromium/build/config/freetype/freetype.gni +++ b/chromium/build/config/freetype/freetype.gni @@ -11,4 +11,6 @@ declare_args() { # System FreeType configurations other than as described WILL INTRODUCE TEXT # RENDERING AND SECURITY REGRESSIONS. use_system_freetype = false + use_qt_freetype = false + qt_freetype_includes = "" } diff --git a/chromium/build/linux/BUILD.gn b/chromium/build/linux/BUILD.gn index 54314c76878..8cfc2266afb 100644 --- a/chromium/build/linux/BUILD.gn +++ b/chromium/build/linux/BUILD.gn @@ -3,7 +3,6 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//build/config/freetype/freetype.gni") import("//build/config/linux/pkg_config.gni") if (use_gio) { @@ -16,16 +15,3 @@ if (use_gio) { # Looking for libspeechd? Use //third_party/speech-dispatcher -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") { - visibility = [ - "//third_party:freetype_harfbuzz", - "//third_party/harfbuzz-ng:harfbuzz_source", - ] - packages = [ "freetype2" ] - } -} diff --git a/chromium/third_party/BUILD.gn b/chromium/third_party/BUILD.gn index cb00f51f604..d86a38a4e7a 100644 --- a/chromium/third_party/BUILD.gn +++ b/chromium/third_party/BUILD.gn @@ -71,12 +71,16 @@ component("freetype_harfbuzz") { public_configs = [] public_deps = [] if (use_system_freetype) { - public_configs += [ "//build/linux:freetype_from_pkgconfig" ] + public_configs += [ "//third_party/freetype:freetype_from_pkgconfig" ] + } else if (use_qt_freetype) { + public_configs += [ "//third_party/freetype:freetype_from_qt" ] } else { public_deps += [ "//third_party/freetype:freetype_source" ] } if (use_system_harfbuzz) { public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ] + } else if (use_qt_harfbuzz) { + public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_qt" ] } else { public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ] } diff --git a/chromium/third_party/freetype/BUILD.gn b/chromium/third_party/freetype/BUILD.gn index 5c916355a81..30cab1b6d40 100644 --- a/chromium/third_party/freetype/BUILD.gn +++ b/chromium/third_party/freetype/BUILD.gn @@ -6,6 +6,30 @@ import("//build/config/chromecast_build.gni") import("//build/config/freetype/freetype.gni") import("//third_party/harfbuzz-ng/harfbuzz.gni") + +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. + import("//build/config/linux/pkg_config.gni") + pkg_config("freetype_from_pkgconfig") { + visibility = [ + "//third_party:freetype_harfbuzz", + "//third_party/harfbuzz-ng:harfbuzz_source", + ] + packages = [ "freetype2" ] + } +} else if (use_qt_freetype) { + config("freetype_from_qt") { + visibility = [ + "//third_party:freetype_harfbuzz", + "//third_party/harfbuzz-ng:harfbuzz_source", + ] + include_dirs = [ qt_freetype_includes ] + } +} else { + assert(!use_system_freetype, "Not used when using system freetype.") config("freetype_component_config") { @@ -146,6 +170,8 @@ source_set("freetype_source") { if (use_system_harfbuzz) { configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ] + } else if (use_qt_harfbuzz) { + configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_qt" ] } else { configs += [ "//third_party/harfbuzz-ng:harfbuzz_config" ] } @@ -161,3 +187,4 @@ source_set("freetype_source") { "//third_party/zlib", ] } +} diff --git a/chromium/third_party/harfbuzz-ng/BUILD.gn b/chromium/third_party/harfbuzz-ng/BUILD.gn index 8dfcc66d463..5a0ca941d68 100644 --- a/chromium/third_party/harfbuzz-ng/BUILD.gn +++ b/chromium/third_party/harfbuzz-ng/BUILD.gn @@ -22,6 +22,14 @@ if (use_system_harfbuzz) { "harfbuzz-subset", ] } +} else if (use_qt_harfbuzz) { + config("harfbuzz_from_qt") { + visibility = [ + "//third_party:freetype_harfbuzz", + "//third_party/freetype:freetype_source", + ] + include_dirs = [ qt_harfbuzz_includes ] + } } else { config("harfbuzz_config") { include_dirs = [ "src/src" ] @@ -298,7 +306,9 @@ if (use_system_harfbuzz) { } if (use_system_freetype) { - configs += [ "//build/linux:freetype_from_pkgconfig" ] + configs += [ "//third_party/freetype:freetype_from_pkgconfig" ] + } else if (use_qt_freetype) { + configs += [ "//third_party/freetype:freetype_from_qt" ] } else { configs += [ "//third_party/freetype:freetype_component_config" ] } diff --git a/chromium/third_party/harfbuzz-ng/harfbuzz.gni b/chromium/third_party/harfbuzz-ng/harfbuzz.gni index a152b255e47..4d1c2746ff6 100644 --- a/chromium/third_party/harfbuzz-ng/harfbuzz.gni +++ b/chromium/third_party/harfbuzz-ng/harfbuzz.gni @@ -9,4 +9,6 @@ declare_args() { # new enough version of the library, and so this variable exists so that # ChromeOS can build against the system lib and keep binary sizes smaller. use_system_harfbuzz = false + use_qt_harfbuzz = false + qt_harfbuzz_includes = "" } |