BUILD.gn 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 2014 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/freetype/freetype.gni")
  5. import("//third_party/harfbuzz-ng/harfbuzz.gni")
  6. import("//third_party/libjpeg.gni")
  7. assert(!is_ios, "This is not used on iOS, don't drag it in unintentionally")
  8. config("system_libjpeg_config") {
  9. libs = [ "jpeg" ]
  10. defines = [ "USE_SYSTEM_LIBJPEG" ]
  11. }
  12. config("libjpeg_turbo_config") {
  13. defines = [ "USE_LIBJPEG_TURBO=1" ]
  14. }
  15. # This is a meta target that forwards to the system's libjpeg,
  16. # third_party/libjpeg, or third_party/libjpeg_turbo depending on the build args
  17. # declared in this file.
  18. group("jpeg") {
  19. if (use_system_libjpeg) {
  20. public_configs = [ ":system_libjpeg_config" ]
  21. } else if (use_libjpeg_turbo) {
  22. public_deps = [ "//third_party/libjpeg_turbo:libjpeg" ]
  23. public_configs = [ ":libjpeg_turbo_config" ]
  24. } else {
  25. public_deps = [ "//third_party/libjpeg:libjpeg" ]
  26. }
  27. }
  28. # This is a meta target that forwards include paths only to the system's
  29. # libjpeg, third_party/libjpeg, or third_party/libjpeg_turbo depending on the
  30. # build args declared in this file. This is needed, rarely, for targets that
  31. # need to reference libjpeg without explicitly building it.
  32. group("jpeg_includes") {
  33. if (use_system_libjpeg) {
  34. public_configs = [ ":system_libjpeg_config" ]
  35. } else if (use_libjpeg_turbo) {
  36. public_configs = [ "//third_party/libjpeg_turbo:libjpeg_config" ]
  37. } else {
  38. public_configs = [ "//third_party/libjpeg:libjpeg_config" ]
  39. }
  40. }
  41. # FreeType and HarfBuzz libraries are dependent on each other. This component
  42. # will depend on the appropriate source sets or export the system packages
  43. # for both FreeType and HarfBuzz.
  44. component("freetype_harfbuzz") {
  45. public_configs = []
  46. public_deps = []
  47. if (use_system_freetype) {
  48. public_configs += [ "//build/linux:freetype_from_pkgconfig" ]
  49. } else {
  50. public_deps += [ "//third_party/freetype:freetype_source" ]
  51. }
  52. if (use_system_harfbuzz) {
  53. public_configs += [ "//third_party/harfbuzz-ng:harfbuzz_from_pkgconfig" ]
  54. } else {
  55. public_deps += [ "//third_party/harfbuzz-ng:harfbuzz_source" ]
  56. }
  57. }