mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibLocale: Move locale source files to the LibLocale library
Everything is now setup to create the LibLocale library and link it where needed.
This commit is contained in:
parent
f082b6ae48
commit
9e860d973e
7 changed files with 38 additions and 17 deletions
|
@ -424,7 +424,7 @@ if (BUILD_LAGOM)
|
||||||
list(REMOVE_ITEM LIBJS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibJS/SyntaxHighlighter.cpp")
|
list(REMOVE_ITEM LIBJS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../../Userland/Libraries/LibJS/SyntaxHighlighter.cpp")
|
||||||
lagom_lib(JS js
|
lagom_lib(JS js
|
||||||
SOURCES ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES}
|
SOURCES ${LIBJS_SOURCES} ${LIBJS_SUBDIR_SOURCES} ${LIBJS_SUBSUBDIR_SOURCES}
|
||||||
LIBS m LibCrypto LibRegex LibUnicode LibTextCodec
|
LIBS m LibCrypto LibRegex LibLocale LibUnicode LibTextCodec
|
||||||
)
|
)
|
||||||
|
|
||||||
# Line
|
# Line
|
||||||
|
@ -433,6 +433,16 @@ if (BUILD_LAGOM)
|
||||||
SOURCES ${LIBLINE_SOURCES}
|
SOURCES ${LIBLINE_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Locale
|
||||||
|
include(locale_data)
|
||||||
|
file(GLOB LIBLOCALE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibLocale/*.cpp")
|
||||||
|
lagom_lib(Locale locale
|
||||||
|
SOURCES ${LIBLOCALE_SOURCES} ${LOCALE_DATA_SOURCES}
|
||||||
|
)
|
||||||
|
target_compile_definitions(LibLocale PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
||||||
|
target_compile_options(LibLocale PRIVATE -Wno-parentheses-equality)
|
||||||
|
target_link_libraries(LibLocale LibTimeZone LibUnicode)
|
||||||
|
|
||||||
# Markdown
|
# Markdown
|
||||||
file(GLOB LIBMARKDOWN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMarkdown/*.cpp")
|
file(GLOB LIBMARKDOWN_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibMarkdown/*.cpp")
|
||||||
lagom_lib(Markdown markdown
|
lagom_lib(Markdown markdown
|
||||||
|
@ -502,15 +512,11 @@ if (BUILD_LAGOM)
|
||||||
|
|
||||||
# Unicode
|
# Unicode
|
||||||
include(unicode_data)
|
include(unicode_data)
|
||||||
include(locale_data)
|
|
||||||
file(GLOB LIBUNICODE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibUnicode/*.cpp")
|
file(GLOB LIBUNICODE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibUnicode/*.cpp")
|
||||||
file(GLOB LIBLOCALE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibLocale/*.cpp")
|
|
||||||
lagom_lib(Unicode unicode
|
lagom_lib(Unicode unicode
|
||||||
SOURCES ${LIBUNICODE_SOURCES} ${UNICODE_DATA_SOURCES} ${LIBLOCALE_SOURCES} ${LOCALE_DATA_SOURCES}
|
SOURCES ${LIBUNICODE_SOURCES} ${UNICODE_DATA_SOURCES}
|
||||||
)
|
)
|
||||||
target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
||||||
target_compile_options(LibUnicode PRIVATE -Wno-parentheses-equality)
|
|
||||||
target_link_libraries(LibUnicode LibTimeZone)
|
|
||||||
|
|
||||||
# WASM
|
# WASM
|
||||||
file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp")
|
file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp")
|
||||||
|
@ -675,6 +681,12 @@ if (BUILD_LAGOM)
|
||||||
lagom_test(${source} WORKING_DIRECTORY LIBS LibGL LibGPU LibSoftGPU)
|
lagom_test(${source} WORKING_DIRECTORY LIBS LibGL LibGPU LibSoftGPU)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Locale
|
||||||
|
file(GLOB LIBLOCALE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibLocale/*.cpp")
|
||||||
|
foreach(source ${LIBLOCALE_TEST_SOURCES})
|
||||||
|
lagom_test(${source} LIBS LibLocale LibUnicode)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# PDF
|
# PDF
|
||||||
file(GLOB LIBPDF_TESTS CONFIGURE_DEPENDS "../../Tests/LibPDF/*.cpp")
|
file(GLOB LIBPDF_TESTS CONFIGURE_DEPENDS "../../Tests/LibPDF/*.cpp")
|
||||||
foreach(source ${LIBPDF_TESTS})
|
foreach(source ${LIBPDF_TESTS})
|
||||||
|
@ -727,8 +739,7 @@ if (BUILD_LAGOM)
|
||||||
|
|
||||||
# Unicode
|
# Unicode
|
||||||
file(GLOB LIBUNICODE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibUnicode/*.cpp")
|
file(GLOB LIBUNICODE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibUnicode/*.cpp")
|
||||||
file(GLOB LIBLOCALE_TEST_SOURCES CONFIGURE_DEPENDS "../../Tests/LibLocale/*.cpp")
|
foreach(source ${LIBUNICODE_TEST_SOURCES})
|
||||||
foreach(source ${LIBUNICODE_TEST_SOURCES} ${LIBLOCALE_TEST_SOURCES})
|
|
||||||
lagom_test(${source} LIBS LibUnicode)
|
lagom_test(${source} LIBS LibUnicode)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ set(TEST_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(source IN LISTS TEST_SOURCES)
|
foreach(source IN LISTS TEST_SOURCES)
|
||||||
serenity_test("${source}" LibLocale LIBS LibUnicode)
|
serenity_test("${source}" LibLocale LIBS LibLocale)
|
||||||
|
|
||||||
get_filename_component(target "${source}" NAME_WLE)
|
get_filename_component(target "${source}" NAME_WLE)
|
||||||
link_with_locale_data("${target}")
|
link_with_locale_data("${target}")
|
||||||
|
|
|
@ -6,5 +6,4 @@ foreach(source IN LISTS TEST_SOURCES)
|
||||||
serenity_test("${source}" LibUnicode LIBS LibUnicode)
|
serenity_test("${source}" LibUnicode LIBS LibUnicode)
|
||||||
|
|
||||||
get_filename_component(target "${source}" NAME_WLE)
|
get_filename_component(target "${source}" NAME_WLE)
|
||||||
link_with_locale_data("${target}")
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -18,5 +18,5 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_app(ClockSettings ICON app-analog-clock) # FIXME: Create a ClockSettings icon.
|
serenity_app(ClockSettings ICON app-analog-clock) # FIXME: Create a ClockSettings icon.
|
||||||
target_link_libraries(ClockSettings LibGUI LibMain LibUnicode)
|
target_link_libraries(ClockSettings LibGUI LibMain LibLocale)
|
||||||
link_with_locale_data(ClockSettings)
|
link_with_locale_data(ClockSettings)
|
||||||
|
|
|
@ -249,4 +249,4 @@ set(SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
serenity_lib(LibJS js)
|
serenity_lib(LibJS js)
|
||||||
target_link_libraries(LibJS LibM LibCore LibCrypto LibRegex LibSyntax LibUnicode)
|
target_link_libraries(LibJS LibM LibCore LibCrypto LibRegex LibSyntax LibLocale LibUnicode)
|
||||||
|
|
|
@ -6,3 +6,19 @@ if (DEFINED LOCALE_DATA_SOURCES)
|
||||||
target_compile_options(LibLocaleData PRIVATE -g0 -Os -Wno-parentheses-equality)
|
target_compile_options(LibLocaleData PRIVATE -g0 -Os -Wno-parentheses-equality)
|
||||||
target_link_libraries(LibLocaleData LibCore LibTimeZone)
|
target_link_libraries(LibLocaleData LibCore LibTimeZone)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
DateTimeFormat.cpp
|
||||||
|
Locale.cpp
|
||||||
|
NumberFormat.cpp
|
||||||
|
PluralRules.cpp
|
||||||
|
RelativeTimeFormat.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
serenity_lib(LibLocale locale)
|
||||||
|
target_link_libraries(LibLocale LibCore LibUnicode)
|
||||||
|
target_compile_definitions(LibLocale PRIVATE ENABLE_UNICODE_DATA=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
|
||||||
|
|
||||||
|
if (DEFINED LOCALE_DATA_SOURCES)
|
||||||
|
add_dependencies(LibLocale LibLocaleData)
|
||||||
|
endif()
|
||||||
|
|
|
@ -3,11 +3,6 @@ include(${SerenityOS_SOURCE_DIR}/Meta/CMake/unicode_data.cmake)
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
CharacterTypes.cpp
|
CharacterTypes.cpp
|
||||||
CurrencyCode.cpp
|
CurrencyCode.cpp
|
||||||
../LibLocale/DateTimeFormat.cpp
|
|
||||||
../LibLocale/Locale.cpp
|
|
||||||
../LibLocale/NumberFormat.cpp
|
|
||||||
../LibLocale/PluralRules.cpp
|
|
||||||
../LibLocale/RelativeTimeFormat.cpp
|
|
||||||
${UNICODE_DATA_SOURCES}
|
${UNICODE_DATA_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue