summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-12-14 08:04:30 -0500
committerLinus Groh <mail@linusgroh.de>2021-12-15 13:26:03 +0000
commit92233660b899b90ecfe145141e224fa23348887b (patch)
treead12105a25b704deebd04c188d15a45706021a47 /Userland
parented9c79e131769d060f7538664eb301d41446a3e1 (diff)
downloadserenity-92233660b899b90ecfe145141e224fa23348887b.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibUnicode/CMakeLists.txt14
1 files changed, 12 insertions, 2 deletions
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=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>)
+
+if (DEFINED UNICODE_DATA_SOURCES)
+ target_link_libraries(LibUnicode LibUnicodeData)
+endif()