mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 15:02:56 +00:00
Meta: Add LibUnicode (and its tests) to Lagom
This is primarily to allow using LibUnicode within LibJS and its REPL. Note: this seems to be the first time that a Lagom dependency requires generated source files. For this to work, some of Lagom's CMakeLists.txt commands needed to be re-organized to include the CMake files that fetch and parse UnicodeData.txt. The paths required to invoke the generator also differ depending on what is currently building (SerenityOS vs. Lagom as part of the Serenity build vs. a standalone Lagom build).
This commit is contained in:
parent
4dda3edc9e
commit
98d8274040
Notes:
sideshowbarker
2024-07-18 08:18:37 +09:00
Author: https://github.com/trflynn89
Commit: 98d8274040
Pull-request: https://github.com/SerenityOS/serenity/pull/9004
Reviewed-by: https://github.com/linusg ✅
3 changed files with 47 additions and 7 deletions
|
@ -13,6 +13,16 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
|
|||
set(UNICODE_DATA_HEADER UnicodeData.h)
|
||||
set(UNICODE_DATA_IMPLEMENTATION UnicodeData.cpp)
|
||||
|
||||
if (CMAKE_SOURCE_DIR MATCHES ".*/Lagom") # Lagom-only build.
|
||||
set(UNICODE_GENERATOR LibUnicode/CodeGenerators/GenerateUnicodeData)
|
||||
set(UNICODE_DATA_HEADER LibUnicode/UnicodeData.h)
|
||||
set(UNICODE_DATA_IMPLEMENTATION LibUnicode/UnicodeData.cpp)
|
||||
elseif (CMAKE_CURRENT_BINARY_DIR MATCHES ".*/Lagom") # Lagom build within the main SerenityOS build.
|
||||
set(UNICODE_GENERATOR ../../Userland/Libraries/LibUnicode/CodeGenerators/GenerateUnicodeData)
|
||||
set(UNICODE_DATA_HEADER LibUnicode/UnicodeData.h)
|
||||
set(UNICODE_DATA_IMPLEMENTATION LibUnicode/UnicodeData.cpp)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${UNICODE_DATA_HEADER}
|
||||
COMMAND ${write_if_different} ${UNICODE_DATA_HEADER} ${UNICODE_GENERATOR} -h -u ${UNICODE_DATA_PATH}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue