OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 |
| 3 icu_tools_vars = exec_script("//build/gypi_to_gn.py", |
| 4 [ |
| 5 rebase_path("../icu_tools.gypi") |
| 6 ], |
| 7 "scope", |
| 8 [ "../icu_tools.gypi" ]) |
| 9 |
| 10 |
| 11 icu_vars = exec_script("//build/gypi_to_gn.py", |
| 12 [ |
| 13 rebase_path("../icu.gypi") |
| 14 ], |
| 15 "scope", |
| 16 [ "../icu.gypi" ]) |
| 17 |
| 18 config("icu_tools_config") { |
| 19 # TODO: Make the tools always compile optimized to make |
| 20 # compilation (especially of gendict+cjdict.txt) be faster. |
| 21 cflags = [] |
| 22 |
| 23 # Always optimize so that generation isn't slow in Debug. |
| 24 if (is_win) { |
| 25 cflags += [ "/Os" ] |
| 26 } else { |
| 27 cflags += [ "-O2" ] |
| 28 } |
| 29 |
| 30 if (is_win) { |
| 31 # Disable some compiler warnings. |
| 32 cflags += [ |
| 33 "/wd4005", # Macro redefinition. |
| 34 "/wd4068", # Unknown pragmas. |
| 35 "/wd4267", # Conversion from size_t on 64-bits. |
| 36 "/wd4996", # Deprecated functions. |
| 37 "/wd4310", # cast truncates constant value (only visible in gn? Doe
s gyp also use /W4?) |
| 38 "/wd4189", # local variable is initialized but not referenced (only
visible in gn? Does gyp also use /W4?) |
| 39 "/wd4706", # assignment within conditional expression (only visible
in gn? Does gyp also use /W4?) |
| 40 ] |
| 41 } else if (is_linux) { |
| 42 cflags += [ |
| 43 # Since ICU wants to internally use its own deprecated APIs, don't |
| 44 # complain about it. |
| 45 "-Wno-deprecated-declarations", |
| 46 "-Wno-unused-function", |
| 47 "-Wno-sign-compare", # For makeconv at the very least. |
| 48 ] |
| 49 } |
| 50 if (is_clang) { |
| 51 cflags += [ |
| 52 "-Wno-deprecated-declarations", |
| 53 "-Wno-logical-op-parentheses", |
| 54 "-Wno-tautological-compare", |
| 55 "-Wno-switch", |
| 56 "-Wno-sign-compare", |
| 57 ] |
| 58 } |
| 59 |
| 60 include_dirs = [ |
| 61 "../source/common", |
| 62 "../source/tools/toolutil", |
| 63 "../source/i18n", |
| 64 ] |
| 65 |
| 66 defines = [ |
| 67 "U_STATIC_IMPLEMENTATION", # TODO: Support reuse of dll for faster build
s? |
| 68 "U_USING_ICU_NAMESPACE=0", |
| 69 "U_HAVE_ELF_H=1", |
| 70 # Without U_DEBUG=0 genrb will freak out on sr_Latn.txt because |
| 71 # it cannot find a Seqence in sr.txt which will result in a NULL |
| 72 # importRules which will fail a "validMemory" check. |
| 73 "U_DEBUG=0", |
| 74 ] |
| 75 } |
| 76 |
| 77 group("icu_tools") { |
| 78 deps = [ |
| 79 ":genbrk", |
| 80 ":gencfu", |
| 81 ":gencnval", |
| 82 ":gendict", |
| 83 ":genrb", |
| 84 ":icupkg", |
| 85 ":makeconv", |
| 86 ":pkgdata", |
| 87 ] |
| 88 } |
| 89 |
| 90 static_library("icu_tools_common") |
| 91 { |
| 92 configs += [ |
| 93 ":icu_tools_config" |
| 94 ] |
| 95 |
| 96 sources = rebase_path(icu_vars.icuuc_sources, ".", "..") |
| 97 sources += rebase_path(icu_vars.icui18n_sources, ".", "..") |
| 98 sources += [ "../source/stubdata/stubdata.c" ] |
| 99 sources += rebase_path(icu_tools_vars.icutoolutil_sources, |
| 100 ".", |
| 101 "..") |
| 102 |
| 103 defines = [ |
| 104 "U_I18N_IMPLEMENTATION", |
| 105 "U_COMMON_IMPLEMENTATION", |
| 106 "U_STATIC_IMPLEMENTATION", |
| 107 "U_TOOLUTIL_IMPLEMENTATION", |
| 108 "HAVE_DLOPEN=0", |
| 109 ] |
| 110 # ICU uses RTTI, replace the default "no rtti" config. |
| 111 configs -= [ |
| 112 "//build/config/compiler:no_rtti", # ICU uses RTTI. |
| 113 "//build/config/compiler:chromium_code", |
| 114 ] |
| 115 configs += [ |
| 116 "//build/config/compiler:rtti", |
| 117 "//build/config/compiler:no_chromium_code", |
| 118 ] |
| 119 } |
| 120 |
| 121 tools_to_build = [ |
| 122 ["genbrk", icu_tools_vars.genbrk_sources], |
| 123 ["gencfu", icu_tools_vars.gencfu_sources], |
| 124 ["gencnval", icu_tools_vars.gencnval_sources], |
| 125 ["gendict", icu_tools_vars.gendict_sources], |
| 126 ["genrb", icu_tools_vars.genrb_sources], |
| 127 ["icupkg", icu_tools_vars.icupkg_sources], |
| 128 ["makeconv", icu_tools_vars.makeconv_sources], |
| 129 ["pkgdata", icu_tools_vars.pkgdata_sources], |
| 130 ] |
| 131 |
| 132 foreach(tool_to_build, tools_to_build) { |
| 133 tool_name = tool_to_build[0] |
| 134 tool_sources = tool_to_build[1] |
| 135 |
| 136 executable(tool_name) { |
| 137 deps = [ |
| 138 ":icu_tools_common" |
| 139 ] |
| 140 configs += [ |
| 141 ":icu_tools_config" |
| 142 ] |
| 143 sources = rebase_path(tool_sources, ".", "..") |
| 144 } |
| 145 tool_name = "" |
| 146 tool_sources = [] |
| 147 } |
OLD | NEW |