From 92233660b899b90ecfe145141e224fa23348887b Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 14 Dec 2021 08:04:30 -0500 Subject: LibUnicode: Compile generated sources optimized for size This breaks LibUnicode into two libraries: LibUnicode containing the public APIs for accessing the library, and LibUnicodeData containing the generated source files. LibUnicodeData has compile options optimized for size, which save about 1MB of data in total. --- Userland/Libraries/LibUnicode/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibUnicode/CMakeLists.txt b/Userland/Libraries/LibUnicode/CMakeLists.txt index 5a6b89d7d7..6634f4b504 100644 --- a/Userland/Libraries/LibUnicode/CMakeLists.txt +++ b/Userland/Libraries/LibUnicode/CMakeLists.txt @@ -1,7 +1,13 @@ include(${SerenityOS_SOURCE_DIR}/Meta/CMake/unicode_data.cmake) -SET(SOURCES - ${UNICODE_DATA_SOURCES} +if (DEFINED UNICODE_DATA_SOURCES) + set(SOURCES ${UNICODE_DATA_SOURCES}) + serenity_lib(LibUnicodeData unicodedata) + target_compile_options(LibUnicodeData PRIVATE -g0 -Os) + target_link_libraries(LibUnicodeData LibCore) +endif() + +set(SOURCES CharacterTypes.cpp CurrencyCode.cpp DateTimeFormat.cpp @@ -12,3 +18,7 @@ SET(SOURCES serenity_lib(LibUnicode unicode) target_link_libraries(LibUnicode LibCore) target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$) + +if (DEFINED UNICODE_DATA_SOURCES) + target_link_libraries(LibUnicode LibUnicodeData) +endif() -- cgit v1.2.3