Skip to content

Commit c6a1b76

Browse files
authored
[ports] build libicu_io when -sUSE_ICU=1 (#20181)
1 parent 4391048 commit c6a1b76

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/ports/icu.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
libname_libicu_common = 'libicu_common'
1515
libname_libicu_stubdata = 'libicu_stubdata'
1616
libname_libicu_i18n = 'libicu_i18n'
17+
libname_libicu_io = 'libicu_io'
1718

1819

1920
def needed(settings):
@@ -75,17 +76,27 @@ def create_libicu_i18n(lib_output):
7576
other_includes = [os.path.join(icu_source_path, 'common')]
7677
build_lib(lib_output, lib_src, other_includes, ['-DU_I18N_IMPLEMENTATION=1'])
7778

79+
# creator for libicu_io
80+
def create_libicu_io(lib_output):
81+
prepare_build()
82+
lib_src = os.path.join(icu_source_path, 'io')
83+
ports.install_headers(os.path.join(lib_src, 'unicode'), target='unicode')
84+
other_includes = [os.path.join(icu_source_path, 'common'), os.path.join(icu_source_path, 'i18n')]
85+
build_lib(lib_output, lib_src, other_includes, ['-DU_IO_IMPLEMENTATION=1'])
86+
7887
return [
7988
shared.cache.get_lib(get_lib_name(libname_libicu_common, settings), create_libicu_common), # this also prepares the build
8089
shared.cache.get_lib(get_lib_name(libname_libicu_stubdata, settings), create_libicu_stubdata),
81-
shared.cache.get_lib(get_lib_name(libname_libicu_i18n, settings), create_libicu_i18n)
90+
shared.cache.get_lib(get_lib_name(libname_libicu_i18n, settings), create_libicu_i18n),
91+
shared.cache.get_lib(get_lib_name(libname_libicu_io, settings), create_libicu_io)
8292
]
8393

8494

8595
def clear(ports, settings, shared):
8696
shared.cache.erase_lib(get_lib_name(libname_libicu_common, settings))
8797
shared.cache.erase_lib(get_lib_name(libname_libicu_stubdata, settings))
8898
shared.cache.erase_lib(get_lib_name(libname_libicu_i18n, settings))
99+
shared.cache.erase_lib(get_lib_name(libname_libicu_io, settings))
89100

90101

91102
def process_args(ports):

0 commit comments

Comments
 (0)