icu.gn 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. # Copyright 2016 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/linux/pkg_config.gni")
  5. import("//build/shim_headers.gni")
  6. group("icu") {
  7. public_deps = [
  8. ":icui18n",
  9. ":icuuc",
  10. ]
  11. }
  12. config("icu_config") {
  13. defines = [
  14. "USING_SYSTEM_ICU=1",
  15. "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
  16. # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
  17. # on classes through the U_COMMON_API and U_I18N_API macros (among others).
  18. # When linking against the system ICU library, we want its symbols to have
  19. # public LTO visibility. This disables CFI checks for the ICU classes and
  20. # allows whole-program optimization to be applied to the rest of Chromium.
  21. #
  22. # Both U_COMMON_API and U_I18N_API macros would be defined to U_EXPORT only
  23. # when U_COMBINED_IMPLEMENTATION is defined (see unicode/utypes.h). Because
  24. # we override the default system UCHAR_TYPE (char16_t), it is not possible
  25. # to use U_COMBINED_IMPLEMENTATION at this moment, meaning the U_COMMON_API
  26. # and U_I18N_API macros are set to U_IMPORT which is an empty definition.
  27. #
  28. # Until building with UCHAR_TYPE=char16_t is supported, one way to apply
  29. # public visibility (and thus public LTO visibility) to all ICU classes is
  30. # to define U_IMPORT to have the same value as U_EXPORT. For more details,
  31. # please see: https://crbug.com/822820
  32. "U_IMPORT=U_EXPORT",
  33. ]
  34. }
  35. pkg_config("system_icui18n") {
  36. packages = [ "icu-i18n" ]
  37. }
  38. pkg_config("system_icuuc") {
  39. packages = [ "icu-uc" ]
  40. }
  41. source_set("icui18n") {
  42. deps = [ ":icui18n_shim" ]
  43. public_configs = [
  44. ":icu_config",
  45. ":system_icui18n",
  46. ]
  47. }
  48. source_set("icuuc") {
  49. deps = [ ":icuuc_shim" ]
  50. public_configs = [
  51. ":icu_config",
  52. ":system_icuuc",
  53. ]
  54. }
  55. shim_headers("icui18n_shim") {
  56. root_path = "source/i18n"
  57. headers = [
  58. # This list can easily be updated using the commands below:
  59. # cd third_party/icu/source/i18n
  60. # find unicode -iname '*.h' -printf ' "%p",\n' | LC_ALL=C sort -u
  61. "unicode/alphaindex.h",
  62. "unicode/basictz.h",
  63. "unicode/calendar.h",
  64. "unicode/choicfmt.h",
  65. "unicode/coleitr.h",
  66. "unicode/coll.h",
  67. "unicode/compactdecimalformat.h",
  68. "unicode/curramt.h",
  69. "unicode/currpinf.h",
  70. "unicode/currunit.h",
  71. "unicode/datefmt.h",
  72. "unicode/dcfmtsym.h",
  73. "unicode/decimfmt.h",
  74. "unicode/dtfmtsym.h",
  75. "unicode/dtitvfmt.h",
  76. "unicode/dtitvinf.h",
  77. "unicode/dtptngen.h",
  78. "unicode/dtrule.h",
  79. "unicode/fieldpos.h",
  80. "unicode/fmtable.h",
  81. "unicode/format.h",
  82. "unicode/fpositer.h",
  83. "unicode/gender.h",
  84. "unicode/gregocal.h",
  85. "unicode/listformatter.h",
  86. "unicode/measfmt.h",
  87. "unicode/measunit.h",
  88. "unicode/measure.h",
  89. "unicode/msgfmt.h",
  90. "unicode/numfmt.h",
  91. "unicode/numsys.h",
  92. "unicode/plurfmt.h",
  93. "unicode/plurrule.h",
  94. "unicode/rbnf.h",
  95. "unicode/rbtz.h",
  96. "unicode/regex.h",
  97. "unicode/region.h",
  98. "unicode/reldatefmt.h",
  99. "unicode/scientificnumberformatter.h",
  100. "unicode/search.h",
  101. "unicode/selfmt.h",
  102. "unicode/simpletz.h",
  103. "unicode/smpdtfmt.h",
  104. "unicode/sortkey.h",
  105. "unicode/stsearch.h",
  106. "unicode/tblcoll.h",
  107. "unicode/timezone.h",
  108. "unicode/tmunit.h",
  109. "unicode/tmutamt.h",
  110. "unicode/tmutfmt.h",
  111. "unicode/translit.h",
  112. "unicode/tzfmt.h",
  113. "unicode/tznames.h",
  114. "unicode/tzrule.h",
  115. "unicode/tztrans.h",
  116. "unicode/ucal.h",
  117. "unicode/ucol.h",
  118. "unicode/ucoleitr.h",
  119. "unicode/ucsdet.h",
  120. "unicode/udat.h",
  121. "unicode/udateintervalformat.h",
  122. "unicode/udatpg.h",
  123. "unicode/ufieldpositer.h",
  124. "unicode/uformattable.h",
  125. "unicode/ugender.h",
  126. "unicode/ulocdata.h",
  127. "unicode/umsg.h",
  128. "unicode/unirepl.h",
  129. "unicode/unum.h",
  130. "unicode/unumsys.h",
  131. "unicode/upluralrules.h",
  132. "unicode/uregex.h",
  133. "unicode/uregion.h",
  134. "unicode/ureldatefmt.h",
  135. "unicode/usearch.h",
  136. "unicode/uspoof.h",
  137. "unicode/utmscale.h",
  138. "unicode/utrans.h",
  139. "unicode/vtzone.h",
  140. ]
  141. }
  142. shim_headers("icuuc_shim") {
  143. root_path = "source/common"
  144. headers = [
  145. # This list can easily be updated using the commands below:
  146. # cd third_party/icu/source/common
  147. # find unicode -iname '*.h' -printf ' "%p",\n' | LC_ALL=C sort -u
  148. "unicode/appendable.h",
  149. "unicode/brkiter.h",
  150. "unicode/bytestream.h",
  151. "unicode/bytestrie.h",
  152. "unicode/bytestriebuilder.h",
  153. "unicode/caniter.h",
  154. "unicode/casemap.h",
  155. "unicode/char16ptr.h",
  156. "unicode/chariter.h",
  157. "unicode/dbbi.h",
  158. "unicode/docmain.h",
  159. "unicode/dtintrv.h",
  160. "unicode/edits.h",
  161. "unicode/enumset.h",
  162. "unicode/errorcode.h",
  163. "unicode/filteredbrk.h",
  164. "unicode/icudataver.h",
  165. "unicode/icuplug.h",
  166. "unicode/idna.h",
  167. "unicode/localematcher.h",
  168. "unicode/localpointer.h",
  169. "unicode/locdspnm.h",
  170. "unicode/locid.h",
  171. "unicode/messagepattern.h",
  172. "unicode/normalizer2.h",
  173. "unicode/normlzr.h",
  174. "unicode/parseerr.h",
  175. "unicode/parsepos.h",
  176. "unicode/platform.h",
  177. "unicode/ptypes.h",
  178. "unicode/putil.h",
  179. "unicode/rbbi.h",
  180. "unicode/rep.h",
  181. "unicode/resbund.h",
  182. "unicode/schriter.h",
  183. "unicode/simpleformatter.h",
  184. "unicode/std_string.h",
  185. "unicode/strenum.h",
  186. "unicode/stringpiece.h",
  187. "unicode/stringtriebuilder.h",
  188. "unicode/symtable.h",
  189. "unicode/ubidi.h",
  190. "unicode/ubiditransform.h",
  191. "unicode/ubrk.h",
  192. "unicode/ucasemap.h",
  193. "unicode/ucat.h",
  194. "unicode/uchar.h",
  195. "unicode/ucharstrie.h",
  196. "unicode/ucharstriebuilder.h",
  197. "unicode/uchriter.h",
  198. "unicode/uclean.h",
  199. "unicode/ucnv.h",
  200. "unicode/ucnv_cb.h",
  201. "unicode/ucnv_err.h",
  202. "unicode/ucnvsel.h",
  203. "unicode/uconfig.h",
  204. "unicode/ucurr.h",
  205. "unicode/udata.h",
  206. "unicode/udisplaycontext.h",
  207. "unicode/uenum.h",
  208. "unicode/uidna.h",
  209. "unicode/uiter.h",
  210. "unicode/uldnames.h",
  211. "unicode/ulistformatter.h",
  212. "unicode/uloc.h",
  213. "unicode/umachine.h",
  214. "unicode/umisc.h",
  215. "unicode/unifilt.h",
  216. "unicode/unifunct.h",
  217. "unicode/unimatch.h",
  218. "unicode/uniset.h",
  219. "unicode/unistr.h",
  220. "unicode/unorm.h",
  221. "unicode/unorm2.h",
  222. "unicode/uobject.h",
  223. "unicode/urename.h",
  224. "unicode/urep.h",
  225. "unicode/ures.h",
  226. "unicode/uscript.h",
  227. "unicode/uset.h",
  228. "unicode/usetiter.h",
  229. "unicode/ushape.h",
  230. "unicode/usprep.h",
  231. "unicode/ustring.h",
  232. "unicode/ustringtrie.h",
  233. "unicode/utext.h",
  234. "unicode/utf.h",
  235. "unicode/utf16.h",
  236. "unicode/utf32.h",
  237. "unicode/utf8.h",
  238. "unicode/utf_old.h",
  239. "unicode/utrace.h",
  240. "unicode/utypes.h",
  241. "unicode/uvernum.h",
  242. "unicode/uversion.h",
  243. ]
  244. }