LibUnicode+Userland: Migrate generated CLDR data to LibLocaleData

Currently, LibUnicodeData contains the generated UCD and CLDR data. Move
the UCD data to the main LibUnicode library, and rename LibUnicodeData
to LibLocaleData. This is another prepatory change to migrate to
LibLocale.
This commit is contained in:
Timothy Flynn 2022-09-02 10:41:33 -04:00 committed by Tim Flynn
parent 89d1813b5d
commit fc8bf7ac3e
Notes: sideshowbarker 2024-07-17 20:22:04 +09:00
18 changed files with 21 additions and 30 deletions

View file

@ -166,9 +166,9 @@ function(embed_resource target section file)
target_sources("${target}" PRIVATE "${asm_file}")
endfunction()
function(link_with_unicode_data target)
function(link_with_locale_data target)
if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
target_link_libraries("${target}" LibUnicodeData)
target_link_libraries("${target}" LibLocaleData)
endif()
endfunction()

View file

@ -1,10 +1,10 @@
serenity_testjs_test(test-js.cpp test-js)
install(TARGETS test-js RUNTIME DESTINATION bin OPTIONAL)
link_with_unicode_data(test-js)
link_with_locale_data(test-js)
serenity_test(test-invalid-unicode-js.cpp LibJS LIBS LibJS)
link_with_unicode_data(test-invalid-unicode-js)
link_with_locale_data(test-invalid-unicode-js)
serenity_test(test-bytecode-js.cpp LibJS LIBS LibJS)
link_with_unicode_data(test-bytecode-js)
link_with_locale_data(test-bytecode-js)

View file

@ -7,5 +7,3 @@ set(TEST_SOURCES
foreach(source IN LISTS TEST_SOURCES)
serenity_test("${source}" LibRegex LIBS LibRegex)
endforeach()
link_with_unicode_data(Regex)

View file

@ -8,5 +8,5 @@ foreach(source IN LISTS TEST_SOURCES)
serenity_test("${source}" LibUnicode LIBS LibUnicode)
get_filename_component(target "${source}" NAME_WLE)
link_with_unicode_data("${target}")
link_with_locale_data("${target}")
endforeach()

View file

@ -1,3 +1,2 @@
serenity_testjs_test(test-spreadsheet.cpp test-spreadsheet)
install(TARGETS test-spreadsheet RUNTIME DESTINATION bin OPTIONAL)
link_with_unicode_data(test-spreadsheet)

View file

@ -11,4 +11,3 @@ set(SOURCES
serenity_app(Assistant ICON app-run)
target_link_libraries(Assistant LibCore LibDesktop LibGUI LibJS LibMain LibThreading)
link_with_unicode_data(Assistant)

View file

@ -34,4 +34,4 @@ set(SOURCES
serenity_app(Browser ICON app-browser)
target_link_libraries(Browser LibWebView LibWeb LibProtocol LibGUI LibDesktop LibConfig LibMain)
link_with_unicode_data(Browser)
link_with_locale_data(Browser)

View file

@ -16,5 +16,4 @@ set(SOURCES
)
serenity_app(CharacterMap ICON app-character-map)
target_link_libraries(CharacterMap LibDesktop LibGUI LibMain)
link_with_unicode_data(CharacterMap)
target_link_libraries(CharacterMap LibDesktop LibGUI LibMain LibUnicode)

View file

@ -19,4 +19,4 @@ set(SOURCES
serenity_app(ClockSettings ICON app-analog-clock) # FIXME: Create a ClockSettings icon.
target_link_libraries(ClockSettings LibGUI LibMain LibUnicode)
link_with_unicode_data(ClockSettings)
link_with_locale_data(ClockSettings)

View file

@ -23,5 +23,4 @@ set(SOURCES
)
serenity_app(FontEditor ICON app-font-editor)
target_link_libraries(FontEditor LibGUI LibDesktop LibGfx LibMain)
link_with_unicode_data(FontEditor)
target_link_libraries(FontEditor LibGUI LibDesktop LibGfx LibMain LibUnicode)

View file

@ -19,4 +19,3 @@ set(SOURCES
serenity_app(Help ICON app-help)
target_link_libraries(Help LibWebView LibWeb LibMarkdown LibGUI LibDesktop LibMain)
link_with_unicode_data(Help)

View file

@ -43,7 +43,6 @@ set(GENERATED_SOURCES
serenity_app(Spreadsheet ICON app-spreadsheet)
target_link_libraries(Spreadsheet LibFileSystemAccessClient LibGUI LibJS LibMain LibWebView LibWeb)
link_with_unicode_data(Spreadsheet)
serenity_test(Writers/Test/TestXSVWriter.cpp Spreadsheet)

View file

@ -16,4 +16,3 @@ set(SOURCES
serenity_app(TextEditor ICON app-text-editor)
target_link_libraries(TextEditor LibWebView LibWeb LibMarkdown LibGUI LibShell LibRegex LibDesktop LibCpp LibJS LibSQL LibFileSystemAccessClient LibConfig LibMain)
link_with_unicode_data(TextEditor)

View file

@ -56,5 +56,4 @@ set(SOURCES
serenity_app(HackStudio ICON app-hack-studio)
target_link_libraries(HackStudio LibWebView LibWeb LibMarkdown LibGUI LibCpp LibGfx LibCore LibVT LibDebug LibX86 LibDiff LibShell LibSymbolication LibRegex LibSQL LibCoredump LibMain)
link_with_unicode_data(HackStudio)
add_dependencies(HackStudio CppLanguageServer)

View file

@ -1,11 +1,11 @@
include(${SerenityOS_SOURCE_DIR}/Meta/CMake/unicode_data.cmake)
include(${SerenityOS_SOURCE_DIR}/Meta/CMake/locale_data.cmake)
if (DEFINED UNICODE_DATA_SOURCES)
set(SOURCES ${UNICODE_DATA_SOURCES} ${LOCALE_DATA_SOURCES})
serenity_lib(LibUnicodeData unicodedata)
target_compile_options(LibUnicodeData PRIVATE -g0 -Os -Wno-parentheses-equality)
target_link_libraries(LibUnicodeData LibCore LibTimeZone)
if (DEFINED LOCALE_DATA_SOURCES)
set(SOURCES ${LOCALE_DATA_SOURCES})
serenity_lib(LibLocaleData localedata)
target_compile_options(LibLocaleData PRIVATE -g0 -Os -Wno-parentheses-equality)
target_link_libraries(LibLocaleData LibCore LibTimeZone)
endif()
set(SOURCES
@ -16,12 +16,13 @@ set(SOURCES
NumberFormat.cpp
PluralRules.cpp
RelativeTimeFormat.cpp
${UNICODE_DATA_SOURCES}
)
serenity_lib(LibUnicode unicode)
target_link_libraries(LibUnicode LibCore)
target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
if (DEFINED UNICODE_DATA_SOURCES)
add_dependencies(LibUnicode LibUnicodeData)
if (DEFINED LOCALE_DATA_SOURCES)
add_dependencies(LibUnicode LibLocaleData)
endif()

View file

@ -407,7 +407,7 @@ serenity_lib(LibWeb web)
# NOTE: We link with LibSoftGPU here instead of lazy loading it via dlopen() so that we do not have to unveil the library and pledge prot_exec.
target_link_libraries(LibWeb LibCore LibJS LibMarkdown LibGemini LibGL LibGUI LibGfx LibSoftGPU LibTextCodec LibWasm LibXML)
link_with_unicode_data(LibWeb)
link_with_locale_data(LibWeb)
generate_js_wrappers(LibWeb)

View file

@ -19,4 +19,4 @@ set(SOURCES
serenity_bin(WebContent)
target_link_libraries(WebContent LibCore LibIPC LibGfx LibWebView LibWeb LibMain)
link_with_unicode_data(WebContent)
link_with_locale_data(WebContent)

View file

@ -136,7 +136,7 @@ target_link_libraries(ini LibMain)
target_link_libraries(install-bin LibMain)
target_link_libraries(jp LibMain)
target_link_libraries(js LibJS LibLine LibMain LibTextCodec)
link_with_unicode_data(js)
link_with_locale_data(js)
target_link_libraries(kcov-example LibMain)
target_link_libraries(keymap LibKeyboard LibMain)
target_link_libraries(kill LibMain)