comparison modules/javafx.web/src/main/native/Source/ThirdParty/icu/CMakeLists.txt @ 11038:20a8447c71c6

8207159: Update ICU to version 62.1 Reviewed-by: mbilla, kcr, ghb
author arajkumar
date Fri, 24 Aug 2018 15:06:40 +0530
parents 2c80e5ef751e
children
comparison
equal deleted inserted replaced
2:ca1a0b26b890 3:afdefba1673f
1 # http://userguide.icu-project.org/howtouseicu#TOC-C-With-Your-Own-Build-System
2 set(ICU_PUBLIC_DEFINES
3 "U_ENABLE_DYLOAD=0"
4 "U_STATIC_IMPLEMENTATION"
5 "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC"
6 )
7
8 set(ICU_PRIVATE_DEFINES
9 "HAVE_DLOPEN=0"
10 "UCONFIG_ONLY_HTML_CONVERSION=1"
11 "U_CHARSET_IS_UTF8=1"
12 )
13
1 if (WIN32) 14 if (WIN32)
2 set(ICU_JAVA_TOOLUTIL_LIB sicutu) 15 list(APPEND ICU_PUBLIC_DEFINES
3 set(ICU_JAVA_ICU_STUBDATA_LIB_NAME icudt) 16 "UCHAR_TYPE=wchar_t"
4 set(ICU_JAVA_ICU_DATA_LIB_NAME sicudt) 17 )
5 if (MSVC) 18 else ()
6 if(NOT CMAKE_CL_64) 19 list(APPEND ICU_PUBLIC_DEFINES
7 add_definitions(-DSIZEOF_VOID_P=4) 20 "UCHAR_TYPE=uint16_t"
8 add_compile_options(-DU_I18N_IMPLEMENTATION=1 -DHAVE_DLOPEN=0 -DU_HAVE_ATOMIC=1 -DU_HAVE_MMAP=0 -DU_HAVE_DIRENT_H=0 -DU_HAVE_POPEN=0 -DU_STATIC_IMPLEMENTATION -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -DU_ATTRIBUTE_DEPRECATED= -DWIN32 -DCYGWINMSVC -DU_COMMON_IMPLEMENTATION -DU_TOOLUTIL_IMPLEMENTATION) 21 )
9 else() 22 endif ()
10 add_compile_options(-DU_I18N_IMPLEMENTATION=1 -DHAVE_DLOPEN=0 -DU_HAVE_ATOMIC=1 -DU_HAVE_MMAP=0 -DU_HAVE_DIRENT_H=0 -DU_HAVE_POPEN=0 -DU_HAVE_TZNAME=0 -DU_STATIC_IMPLEMENTATION -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -DU_ATTRIBUTE_DEPRECATED= -DWIN32 -DCYGWINMSVC -DU_COMMON_IMPLEMENTATION -DU_TOOLUTIL_IMPLEMENTATION) 23
11 endif() 24 set(ICU_PUBLIC_INCLUDES
12 add_compile_options(/GR) 25 "source/common"
13 endif () 26 "source/i18n"
27 )
28
29 # Enable C++ RTTI, WebCore disables it by default.
30 if (UNIX)
31 set(ICU_PRIVATE_COMPILER_OPTIONS
32 "$<$<COMPILE_LANGUAGE:CXX>:-frtti>"
33 )
34 else ()
35 set(ICU_PRIVATE_COMPILER_OPTIONS
36 "/GR"
37 )
38 endif ()
39
40 # Suppress warnings
41 if (WIN32)
42 list(APPEND ICU_PRIVATE_COMPILER_OPTIONS
43 "/wd4005" # Macro redefinition.
44 "/wd4068" # Unknown pragmas.
45 "/wd4245" # Signed/unsigned mismatch
46 "/wd4267" # Conversion from size_t on 64-bits.
47 "/utf-8" # ICU source files are in UTF-8.
48 )
49 elseif (APPLE)
50 list(APPEND ICU_PRIVATE_COMPILER_OPTIONS
51 "-Wno-undef"
52 "-Wno-parentheses"
53
54 "-Wno-unused-function"
55 "-Wno-cast-align"
56
57 # ICU uses its own deprecated functions.
58 "-Wno-deprecated-declarations"
59 )
60 else ()
61 list(APPEND ICU_PRIVATE_COMPILER_OPTIONS
62 "-Wno-undef"
63 "-Wno-unused-function"
64 "-Wno-sign-compare"
65 "-Wno-extra"
66 "-Wno-suggest-attribute=format"
67 # ICU uses its own deprecated functions.
68 "-Wno-deprecated-declarations"
69 )
70 endif ()
71
72 ###### common BEGIN ####
73 set(ICU_COMMON_SOURCES
74 source/common/appendable.cpp
75 source/common/bmpset.cpp
76 source/common/brkeng.cpp
77 source/common/brkiter.cpp
78 source/common/bytesinkutil.cpp
79 source/common/bytestream.cpp
80 source/common/bytestriebuilder.cpp
81 source/common/bytestrie.cpp
82 source/common/bytestrieiterator.cpp
83 source/common/caniter.cpp
84 source/common/chariter.cpp
85 source/common/charstr.cpp
86 source/common/cmemory.cpp
87 source/common/cstr.cpp
88 source/common/cstring.cpp
89 source/common/cwchar.cpp
90 source/common/dictbe.cpp
91 source/common/dictionarydata.cpp
92 source/common/dtintrv.cpp
93 source/common/edits.cpp
94 source/common/errorcode.cpp
95 source/common/filteredbrk.cpp
96 source/common/filterednormalizer2.cpp
97 source/common/icudataver.cpp
98 source/common/icuplug.cpp
99 source/common/listformatter.cpp
100 source/common/loadednormalizer2impl.cpp
101 source/common/locavailable.cpp
102 source/common/locbased.cpp
103 source/common/locdispnames.cpp
104 source/common/locdspnm.cpp
105 source/common/locid.cpp
106 source/common/loclikely.cpp
107 source/common/locmap.cpp
108 source/common/locresdata.cpp
109 source/common/locutil.cpp
110 source/common/messagepattern.cpp
111 source/common/normalizer2.cpp
112 source/common/normalizer2impl.cpp
113 source/common/normlzr.cpp
114 source/common/parsepos.cpp
115 source/common/patternprops.cpp
116 source/common/pluralmap.cpp
117 source/common/propname.cpp
118 source/common/propsvec.cpp
119 source/common/punycode.cpp
120 source/common/putil.cpp
121 source/common/rbbi_cache.cpp
122 source/common/rbbi.cpp
123 source/common/rbbidata.cpp
124 source/common/rbbinode.cpp
125 source/common/rbbirb.cpp
126 source/common/rbbiscan.cpp
127 source/common/rbbisetb.cpp
128 source/common/rbbistbl.cpp
129 source/common/rbbitblb.cpp
130 source/common/resbund_cnv.cpp
131 source/common/resbund.cpp
132 source/common/resource.cpp
133 source/common/ruleiter.cpp
134 source/common/schriter.cpp
135 source/common/serv.cpp
136 source/common/servlk.cpp
137 source/common/servlkf.cpp
138 source/common/servls.cpp
139 source/common/servnotf.cpp
140 source/common/servrbf.cpp
141 source/common/servslkf.cpp
142 source/common/sharedobject.cpp
143 source/common/simpleformatter.cpp
144 source/common/static_unicode_sets.cpp
145 source/common/stringpiece.cpp
146 source/common/stringtriebuilder.cpp
147 source/common/uarrsort.cpp
148 source/common/ubidi.cpp
149 source/common/ubidiln.cpp
150 source/common/ubidi_props.cpp
151 source/common/ubiditransform.cpp
152 source/common/ubidiwrt.cpp
153 source/common/ubrk.cpp
154 source/common/ucase.cpp
155 source/common/ucasemap.cpp
156 source/common/ucasemap_titlecase_brkiter.cpp
157 source/common/ucat.cpp
158 source/common/uchar.cpp
159 source/common/ucharstriebuilder.cpp
160 source/common/ucharstrie.cpp
161 source/common/ucharstrieiterator.cpp
162 source/common/uchriter.cpp
163 source/common/ucln_cmn.cpp
164 source/common/ucmndata.cpp
165 source/common/ucnv2022.cpp
166 source/common/ucnv_bld.cpp
167 source/common/ucnvbocu.cpp
168 source/common/ucnv_cb.cpp
169 source/common/ucnv_cnv.cpp
170 source/common/ucnv.cpp
171 source/common/ucnv_ct.cpp
172 source/common/ucnvdisp.cpp
173 source/common/ucnv_err.cpp
174 source/common/ucnv_ext.cpp
175 source/common/ucnvhz.cpp
176 source/common/ucnv_io.cpp
177 source/common/ucnvisci.cpp
178 source/common/ucnvlat1.cpp
179 source/common/ucnv_lmb.cpp
180 source/common/ucnvmbcs.cpp
181 source/common/ucnvscsu.cpp
182 source/common/ucnvsel.cpp
183 source/common/ucnv_set.cpp
184 source/common/ucnv_u16.cpp
185 source/common/ucnv_u32.cpp
186 source/common/ucnv_u7.cpp
187 source/common/ucnv_u8.cpp
188 source/common/ucol_swp.cpp
189 source/common/ucurr.cpp
190 source/common/udata.cpp
191 source/common/udatamem.cpp
192 source/common/udataswp.cpp
193 source/common/uenum.cpp
194 source/common/uhash.cpp
195 source/common/uhash_us.cpp
196 source/common/uidna.cpp
197 source/common/uinit.cpp
198 source/common/uinvchar.cpp
199 source/common/uiter.cpp
200 source/common/ulist.cpp
201 source/common/ulistformatter.cpp
202 source/common/uloc.cpp
203 source/common/uloc_keytype.cpp
204 source/common/uloc_tag.cpp
205 source/common/umapfile.cpp
206 source/common/umath.cpp
207 source/common/umutex.cpp
208 source/common/unames.cpp
209 source/common/unifiedcache.cpp
210 source/common/unifilt.cpp
211 source/common/unifunct.cpp
212 source/common/uniset_closure.cpp
213 source/common/uniset.cpp
214 source/common/uniset_props.cpp
215 source/common/unisetspan.cpp
216 source/common/unistr_case.cpp
217 source/common/unistr_case_locale.cpp
218 source/common/unistr_cnv.cpp
219 source/common/unistr.cpp
220 source/common/unistr_props.cpp
221 source/common/unistr_titlecase_brkiter.cpp
222 source/common/unormcmp.cpp
223 source/common/unorm.cpp
224 source/common/uobject.cpp
225 source/common/uprops.cpp
226 source/common/uresbund.cpp
227 source/common/ures_cnv.cpp
228 source/common/uresdata.cpp
229 source/common/usc_impl.cpp
230 source/common/uscript.cpp
231 source/common/uscript_props.cpp
232 source/common/uset.cpp
233 source/common/usetiter.cpp
234 source/common/uset_props.cpp
235 source/common/ushape.cpp
236 source/common/usprep.cpp
237 source/common/ustack.cpp
238 source/common/ustrcase.cpp
239 source/common/ustrcase_locale.cpp
240 source/common/ustr_cnv.cpp
241 source/common/ustrenum.cpp
242 source/common/ustrfmt.cpp
243 source/common/ustring.cpp
244 source/common/ustr_titlecase_brkiter.cpp
245 source/common/ustrtrns.cpp
246 source/common/ustr_wcs.cpp
247 source/common/utext.cpp
248 source/common/utf_impl.cpp
249 source/common/util.cpp
250 source/common/util_props.cpp
251 source/common/utrace.cpp
252 source/common/utrie2_builder.cpp
253 source/common/utrie2.cpp
254 source/common/utrie.cpp
255 source/common/uts46.cpp
256 source/common/utypes.cpp
257 source/common/uvector.cpp
258 source/common/uvectr32.cpp
259 source/common/uvectr64.cpp
260 source/common/wintz.cpp
261 )
262
263 add_library(icuuc STATIC ${ICU_COMMON_SOURCES})
264 target_include_directories(icuuc
265 PUBLIC ${ICU_PUBLIC_INCLUDES}
266 )
267 target_compile_definitions(icuuc
268 PRIVATE "U_COMMON_IMPLEMENTATION"
269 PRIVATE ${ICU_PRIVATE_DEFINES}
270 PUBLIC ${ICU_PUBLIC_DEFINES}
271 )
272 target_compile_options(icuuc
273 PRIVATE ${ICU_PRIVATE_COMPILER_OPTIONS}
274 )
275 ###### common END ####
276
277 ###### i18n BEGIN ####
278 set(ICU_I18N_SOURCES
279 source/i18n/alphaindex.cpp
280 source/i18n/anytrans.cpp
281 source/i18n/astro.cpp
282 source/i18n/basictz.cpp
283 source/i18n/bocsu.cpp
284 source/i18n/brktrans.cpp
285 source/i18n/buddhcal.cpp
286 source/i18n/calendar.cpp
287 source/i18n/casetrn.cpp
288 source/i18n/cecal.cpp
289 source/i18n/chnsecal.cpp
290 source/i18n/choicfmt.cpp
291 source/i18n/coleitr.cpp
292 source/i18n/coll.cpp
293 source/i18n/collation.cpp
294 source/i18n/collationbuilder.cpp
295 source/i18n/collationcompare.cpp
296 source/i18n/collationdata.cpp
297 source/i18n/collationdatabuilder.cpp
298 source/i18n/collationdatareader.cpp
299 source/i18n/collationdatawriter.cpp
300 source/i18n/collationfastlatin.cpp
301 source/i18n/collationfastlatinbuilder.cpp
302 source/i18n/collationfcd.cpp
303 source/i18n/collationiterator.cpp
304 source/i18n/collationkeys.cpp
305 source/i18n/collationroot.cpp
306 source/i18n/collationrootelements.cpp
307 source/i18n/collationruleparser.cpp
308 source/i18n/collationsets.cpp
309 source/i18n/collationsettings.cpp
310 source/i18n/collationtailoring.cpp
311 source/i18n/collationweights.cpp
312 source/i18n/compactdecimalformat.cpp
313 source/i18n/coptccal.cpp
314 source/i18n/cpdtrans.cpp
315 source/i18n/csdetect.cpp
316 source/i18n/csmatch.cpp
317 source/i18n/csr2022.cpp
318 source/i18n/csrecog.cpp
319 source/i18n/csrmbcs.cpp
320 source/i18n/csrsbcs.cpp
321 source/i18n/csrucode.cpp
322 source/i18n/csrutf8.cpp
323 source/i18n/curramt.cpp
324 source/i18n/currfmt.cpp
325 source/i18n/currpinf.cpp
326 source/i18n/currunit.cpp
327 source/i18n/dangical.cpp
328 source/i18n/datefmt.cpp
329 source/i18n/dayperiodrules.cpp
330 source/i18n/dcfmtsym.cpp
331 source/i18n/decContext.cpp
332 source/i18n/decNumber.cpp
333 source/i18n/decimfmt.cpp
334 source/i18n/double-conversion-bignum-dtoa.cpp
335 source/i18n/double-conversion-bignum.cpp
336 source/i18n/double-conversion-cached-powers.cpp
337 source/i18n/double-conversion-diy-fp.cpp
338 source/i18n/double-conversion-fast-dtoa.cpp
339 source/i18n/double-conversion-strtod.cpp
340 source/i18n/double-conversion.cpp
341 source/i18n/dtfmtsym.cpp
342 source/i18n/dtitvfmt.cpp
343 source/i18n/dtitvinf.cpp
344 source/i18n/dtptngen.cpp
345 source/i18n/dtrule.cpp
346 source/i18n/esctrn.cpp
347 source/i18n/ethpccal.cpp
348 source/i18n/fmtable.cpp
349 source/i18n/fmtable_cnv.cpp
350 source/i18n/format.cpp
351 source/i18n/fphdlimp.cpp
352 source/i18n/fpositer.cpp
353 source/i18n/funcrepl.cpp
354 source/i18n/gender.cpp
355 source/i18n/gregocal.cpp
356 source/i18n/gregoimp.cpp
357 source/i18n/hebrwcal.cpp
358 source/i18n/indiancal.cpp
359 source/i18n/inputext.cpp
360 source/i18n/islamcal.cpp
361 source/i18n/japancal.cpp
362 source/i18n/measfmt.cpp
363 source/i18n/measunit.cpp
364 source/i18n/measure.cpp
365 source/i18n/msgfmt.cpp
366 source/i18n/name2uni.cpp
367 source/i18n/nfrs.cpp
368 source/i18n/nfrule.cpp
369 source/i18n/nfsubs.cpp
370 source/i18n/nortrans.cpp
371 source/i18n/nounit.cpp
372 source/i18n/nultrans.cpp
373 source/i18n/number_affixutils.cpp
374 source/i18n/number_asformat.cpp
375 source/i18n/number_capi.cpp
376 source/i18n/number_compact.cpp
377 source/i18n/number_currencysymbols.cpp
378 source/i18n/number_decimalquantity.cpp
379 source/i18n/number_decimfmtprops.cpp
380 source/i18n/number_fluent.cpp
381 source/i18n/number_formatimpl.cpp
382 source/i18n/number_grouping.cpp
383 source/i18n/number_integerwidth.cpp
384 source/i18n/number_longnames.cpp
385 source/i18n/number_mapper.cpp
386 source/i18n/number_modifiers.cpp
387 source/i18n/number_multiplier.cpp
388 source/i18n/number_notation.cpp
389 source/i18n/number_padding.cpp
390 source/i18n/number_patternmodifier.cpp
391 source/i18n/number_patternstring.cpp
392 source/i18n/number_rounding.cpp
393 source/i18n/number_scientific.cpp
394 source/i18n/number_skeletons.cpp
395 source/i18n/number_stringbuilder.cpp
396 source/i18n/number_utils.cpp
397 source/i18n/numfmt.cpp
398 source/i18n/numparse_affixes.cpp
399 source/i18n/numparse_compositions.cpp
400 source/i18n/numparse_currency.cpp
401 source/i18n/numparse_decimal.cpp
402 source/i18n/numparse_impl.cpp
403 source/i18n/numparse_parsednumber.cpp
404 source/i18n/numparse_scientific.cpp
405 source/i18n/numparse_stringsegment.cpp
406 source/i18n/numparse_symbols.cpp
407 source/i18n/numparse_validators.cpp
408 source/i18n/numsys.cpp
409 source/i18n/olsontz.cpp
410 source/i18n/persncal.cpp
411 source/i18n/plurfmt.cpp
412 source/i18n/plurrule.cpp
413 source/i18n/quant.cpp
414 source/i18n/quantityformatter.cpp
415 source/i18n/rbnf.cpp
416 source/i18n/rbt.cpp
417 source/i18n/rbt_data.cpp
418 source/i18n/rbt_pars.cpp
419 source/i18n/rbt_rule.cpp
420 source/i18n/rbt_set.cpp
421 source/i18n/rbtz.cpp
422 source/i18n/regexcmp.cpp
423 source/i18n/regeximp.cpp
424 source/i18n/regexst.cpp
425 source/i18n/regextxt.cpp
426 source/i18n/region.cpp
427 source/i18n/reldatefmt.cpp
428 source/i18n/reldtfmt.cpp
429 source/i18n/rematch.cpp
430 source/i18n/remtrans.cpp
431 source/i18n/repattrn.cpp
432 source/i18n/rulebasedcollator.cpp
433 source/i18n/scientificnumberformatter.cpp
434 source/i18n/scriptset.cpp
435 source/i18n/search.cpp
436 source/i18n/selfmt.cpp
437 source/i18n/sharedbreakiterator.cpp
438 source/i18n/simpletz.cpp
439 source/i18n/smpdtfmt.cpp
440 source/i18n/smpdtfst.cpp
441 source/i18n/sortkey.cpp
442 source/i18n/standardplural.cpp
443 source/i18n/strmatch.cpp
444 source/i18n/strrepl.cpp
445 source/i18n/stsearch.cpp
446 source/i18n/taiwncal.cpp
447 source/i18n/timezone.cpp
448 source/i18n/titletrn.cpp
449 source/i18n/tmunit.cpp
450 source/i18n/tmutamt.cpp
451 source/i18n/tmutfmt.cpp
452 source/i18n/tolowtrn.cpp
453 source/i18n/toupptrn.cpp
454 source/i18n/translit.cpp
455 source/i18n/transreg.cpp
456 source/i18n/tridpars.cpp
457 source/i18n/tzfmt.cpp
458 source/i18n/tzgnames.cpp
459 source/i18n/tznames.cpp
460 source/i18n/tznames_impl.cpp
461 source/i18n/tzrule.cpp
462 source/i18n/tztrans.cpp
463 source/i18n/ucal.cpp
464 source/i18n/ucln_in.cpp
465 source/i18n/ucol.cpp
466 source/i18n/ucol_res.cpp
467 source/i18n/ucol_sit.cpp
468 source/i18n/ucoleitr.cpp
469 source/i18n/ucsdet.cpp
470 source/i18n/udat.cpp
471 source/i18n/udateintervalformat.cpp
472 source/i18n/udatpg.cpp
473 source/i18n/ufieldpositer.cpp
474 source/i18n/uitercollationiterator.cpp
475 source/i18n/ulocdata.cpp
476 source/i18n/umsg.cpp
477 source/i18n/unesctrn.cpp
478 source/i18n/uni2name.cpp
479 source/i18n/unum.cpp
480 source/i18n/unumsys.cpp
481 source/i18n/upluralrules.cpp
482 source/i18n/uregex.cpp
483 source/i18n/uregexc.cpp
484 source/i18n/uregion.cpp
485 source/i18n/usearch.cpp
486 source/i18n/uspoof.cpp
487 source/i18n/uspoof_build.cpp
488 source/i18n/uspoof_conf.cpp
489 source/i18n/uspoof_impl.cpp
490 source/i18n/utf16collationiterator.cpp
491 source/i18n/utf8collationiterator.cpp
492 source/i18n/utmscale.cpp
493 source/i18n/utrans.cpp
494 source/i18n/vtzone.cpp
495 source/i18n/vzone.cpp
496 source/i18n/windtfmt.cpp
497 source/i18n/winnmfmt.cpp
498 source/i18n/wintzimpl.cpp
499 source/i18n/zonemeta.cpp
500 source/i18n/zrule.cpp
501 source/i18n/ztrans.cpp
502 )
503
504 add_library(icui18n STATIC ${ICU_I18N_SOURCES})
505 target_include_directories(icui18n
506 PUBLIC ${ICU_PUBLIC_INCLUDES}
507 )
508 target_compile_definitions(icui18n
509 PRIVATE "LIB_ICU_I18N_STATIC"
510 PRIVATE "U_I18N_IMPLEMENTATION"
511 PRIVATE ${ICU_PRIVATE_DEFINES}
512 PUBLIC ${ICU_PUBLIC_DEFINES}
513 )
514 target_compile_options(icui18n
515 PRIVATE ${ICU_PRIVATE_COMPILER_OPTIONS}
516 )
517 target_link_libraries(icui18n PUBLIC icuuc)
518 ###### i18n END ####
519
520 ###### tools BEGIN ####
521 set(ICU_TOOLSUTILS_SOURCES
522 source/tools/toolutil/filestrm.cpp
523 source/tools/toolutil/package.cpp
524 source/tools/toolutil/pkgitems.cpp
525 source/tools/toolutil/swapimpl.cpp
526 source/tools/toolutil/toolutil.cpp
527 source/tools/toolutil/unewdata.cpp
528 source/tools/toolutil/ucm.cpp
529 source/tools/toolutil/ucmstate.cpp
530 source/tools/toolutil/uparse.cpp
531 source/tools/toolutil/ucbuf.cpp
532 source/tools/toolutil/writesrc.cpp
533 source/tools/toolutil/pkg_genc.cpp
534 source/tools/toolutil/pkg_gencmn.cpp
535
536 java/data/data_as_asm.cpp
537 source/stubdata/stubdata.cpp
538 )
539
540 add_executable(data_as_asm ${ICU_TOOLSUTILS_SOURCES})
541 target_include_directories(data_as_asm
542 PRIVATE ${ICU_PUBLIC_INCLUDES}
543 PRIVATE "source/tools/toolutil"
544 )
545 target_compile_definitions(data_as_asm
546 PRIVATE "U_TOOLUTIL_IMPLEMENTATION"
547 )
548 target_compile_options(data_as_asm
549 PRIVATE ${ICU_PRIVATE_COMPILER_OPTIONS}
550 )
551 target_link_libraries(data_as_asm icuuc icui18n)
552 ###### tools END ####
553
554 ###### data BEGIN ####
555 file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/icu/data")
556 file(GLOB ICU_DATA_ZIP_FILE "java/data/icudt*l.zip")
557
558 get_filename_component(ICU_DATA_FILE_NAME ${ICU_DATA_ZIP_FILE} NAME)
559 # Get just file name without extension
560 string(REGEX REPLACE ".zip" "" ICU_DATA_FILE_NAME ${ICU_DATA_FILE_NAME})
561
562 # Use jar instead of unzip, it will be helpful to get rid of cygwin dependency
563 find_package(Java)
564 add_custom_command(
565 COMMAND ${Java_JAR_EXECUTABLE} xf "${ICU_DATA_ZIP_FILE}"
566 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/icu/data"
567 OUTPUT "${CMAKE_BINARY_DIR}/icu/data/${ICU_DATA_FILE_NAME}.dat"
568 VERBATIM
569 )
570
571 if (MSVC)
572 # On Windows, data_as_asm could generates .obj file directly.
573 set(ICU_DATA_SYMBOL_FILE "${CMAKE_BINARY_DIR}/icu/data/${ICU_DATA_FILE_NAME}_dat.obj")
574 set_source_files_properties(${ICU_DATA_SYMBOL_FILE} PROPERTIES EXTERNAL_OBJECT TRUE GENERATED TRUE)
575 else ()
576 set(ICU_DATA_SYMBOL_FILE "${CMAKE_BINARY_DIR}/icu/data/${ICU_DATA_FILE_NAME}_dat.S")
577 enable_language(ASM)
578 endif ()
579
580 # Get data entry point symbol name
581 string(LENGTH ${ICU_DATA_FILE_NAME} ICU_DATA_FILE_LENGTH)
582 math(EXPR ICU_DATA_ENTRY_POINT_LENGTH "${ICU_DATA_FILE_LENGTH} - 1")
583 string(SUBSTRING ${ICU_DATA_FILE_NAME} 0 ${ICU_DATA_ENTRY_POINT_LENGTH} ICU_DATA_ENTRY_POINT)
584
585 if (APPLE)
586 set(ICU_DATA_ASSEMBLER_TYPE gcc-darwin)
14 elseif (UNIX) 587 elseif (UNIX)
15 set(ICU_JAVA_TOOLUTIL_LIB icutu) 588 set(ICU_DATA_ASSEMBLER_TYPE gcc)
16 set(ICU_JAVA_ICU_STUBDATA_LIB_NAME icudata) 589 else ()
17 set(ICU_JAVA_ICU_DATA_LIB_NAME ${ICU_JAVA_ICU_STUBDATA_LIB_NAME}) 590 set(ICU_DATA_ASSEMBLER_TYPE masm)
18 add_definitions("-D_REENTRANT -DU_HAVE_ELF_H=1 -DU_ENABLE_DYLOAD=0 -DU_HAVE_ATOMIC=1 -DU_ATTRIBUTE_DEPRECATED= -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DU_IO_IMPLEMENTATION -DU_TOOLUTIL_IMPLEMENTATION")
19 add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-frtti> $<$<COMPILE_LANGUAGE:C>:-std=c99>)
20 elseif (APPLE)
21 set(ICU_JAVA_TOOLUTIL_LIB icutu)
22 add_definitions("-DU_ATTRIBUTE_DEPRECATED= -DU_ENABLE_DYLOAD=0 -DU_HAVE_ATOMIC=1 -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DU_LAYOUT_IMPLEMENTATION -DU_LAYOUTEX_IMPLEMENTATION -DU_IO_IMPLEMENTATION -DU_TOOLUTIL_IMPLEMENTATION -DT_CTEST_IMPLEMENTATION -frtti")
23 set(ICU_JAVA_ICU_STUBDATA_LIB_NAME icudata)
24 set(ICU_JAVA_ICU_DATA_LIB_NAME ${ICU_JAVA_ICU_STUBDATA_LIB_NAME})
25 add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-frtti> $<$<COMPILE_LANGUAGE:C>:-std=c99>)
26 endif () 591 endif ()
27 592
28 set(ICU_JAVA_ICU_STUBDATA_LIB icustubdata) 593 add_custom_command(
29 594 COMMAND $<TARGET_FILE:data_as_asm> ${ICU_DATA_ASSEMBLER_TYPE} "${CMAKE_BINARY_DIR}/icu/data/${ICU_DATA_FILE_NAME}.dat" ${CMAKE_BINARY_DIR}/icu/data ${ICU_DATA_ENTRY_POINT}
30 add_subdirectory(java/stubdata) 595 OUTPUT ${ICU_DATA_SYMBOL_FILE}
31 add_subdirectory(java/i18n) 596 DEPENDS "${CMAKE_BINARY_DIR}/icu/data/${ICU_DATA_FILE_NAME}.dat"
32 add_subdirectory(java/common) 597 VERBATIM
33 add_subdirectory(java/tools) 598 )
34 add_subdirectory(java/data) 599
600 if (APPLE)
601 set(CMAKE_ASM_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
602 endif ()
603 add_library(icudata STATIC ${ICU_DATA_SYMBOL_FILE})
604 # Be explicit about the which linker to use, otherwise fails on Windows
605 # when creating icudata.lib.
606 set_target_properties(icudata PROPERTIES LINKER_LANGUAGE C)
607
608 ###### data END ####