mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Meta: Move downloading of emoji-test.txt to unicode_data.cmake
The current emoji_txt.cmake does not handle download errors (which were a common source of issues in the build problems channel) or Unicode versioning. These are both handled by unicode_data.cmake. Move the download to unicode_data.cmake so that we can more easily handle next month's Unicode 15 release.
This commit is contained in:
parent
cde4552710
commit
d86b25c460
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/d86b25c460 Pull-request: https://github.com/SerenityOS/serenity/pull/14970 Reviewed-by: https://github.com/linusg ✅
3 changed files with 20 additions and 24 deletions
|
@ -206,7 +206,6 @@ option(BUILD_EVERYTHING "Build all optional components" ON)
|
|||
|
||||
include(utils)
|
||||
include(wasm_spec_tests)
|
||||
include(emoji_txt)
|
||||
|
||||
serenity_component(
|
||||
Tests
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
option(ENABLE_EMOJI_TXT_GENERATION "Enable download of emoji-test.txt and generation of emoji.txt at build time" ON)
|
||||
|
||||
set(EMOJI_TEST_TXT_PATH ${CMAKE_BINARY_DIR}/emoji-test.txt)
|
||||
set(EMOJI_TEST_TXT_URL https://unicode.org/Public/emoji/14.0/emoji-test.txt)
|
||||
|
||||
if(ENABLE_EMOJI_TXT_GENERATION)
|
||||
if(NOT EXISTS ${EMOJI_TEST_TXT_PATH})
|
||||
file(DOWNLOAD ${EMOJI_TEST_TXT_URL} ${EMOJI_TEST_TXT_PATH})
|
||||
endif()
|
||||
set(EMOJI_RES_PATH "${SerenityOS_SOURCE_DIR}/Base/res/emoji")
|
||||
set(EMOJI_TXT_INSTALL_PATH "${SerenityOS_SOURCE_DIR}/Base/home/anon/Documents/emoji.txt")
|
||||
add_custom_command(
|
||||
OUTPUT ${EMOJI_TXT_INSTALL_PATH}
|
||||
COMMAND ${SerenityOS_SOURCE_DIR}/Meta/generate-emoji-txt.sh "${EMOJI_TEST_TXT_PATH}" "${EMOJI_RES_PATH}" "${EMOJI_TXT_INSTALL_PATH}"
|
||||
# This will make this command only run when the modified time of the directory changes,
|
||||
# which only happens if files within it are added or deleted, but not when a file is modified.
|
||||
# This is fine for this use-case, because the contents of a file changing should not affect
|
||||
# the generated emoji.txt file.
|
||||
MAIN_DEPENDENCY ${EMOJI_RES_PATH}
|
||||
USES_TERMINAL
|
||||
)
|
||||
add_custom_target(generate_emoji_txt ALL DEPENDS ${EMOJI_TXT_INSTALL_PATH})
|
||||
endif()
|
|
@ -63,6 +63,12 @@ set(WORD_BREAK_PROP_PATH "${UCD_PATH}/${WORD_BREAK_PROP_SOURCE}")
|
|||
set(SENTENCE_BREAK_PROP_SOURCE "auxiliary/SentenceBreakProperty.txt")
|
||||
set(SENTENCE_BREAK_PROP_PATH "${UCD_PATH}/${SENTENCE_BREAK_PROP_SOURCE}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+\\.[0-9]+)\\.[0-9]+" "\\1" EMOJI_VERSION "${UCD_VERSION}")
|
||||
set(EMOJI_TEST_URL "https://unicode.org/Public/emoji/${EMOJI_VERSION}/emoji-test.txt")
|
||||
set(EMOJI_TEST_PATH "${UCD_PATH}/emoji-test.txt")
|
||||
set(EMOJI_RES_PATH "${SerenityOS_SOURCE_DIR}/Base/res/emoji")
|
||||
set(EMOJI_INSTALL_PATH "${SerenityOS_SOURCE_DIR}/Base/home/anon/Documents/emoji.txt")
|
||||
|
||||
set(CLDR_ZIP_URL "https://github.com/unicode-org/cldr-json/releases/download/${CLDR_VERSION}/cldr-${CLDR_VERSION}-json-modern.zip")
|
||||
set(CLDR_ZIP_PATH "${CLDR_PATH}/cldr.zip")
|
||||
|
||||
|
@ -120,6 +126,8 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
|
|||
extract_path("${UCD_PATH}" "${UCD_ZIP_PATH}" "${WORD_BREAK_PROP_SOURCE}" "${WORD_BREAK_PROP_PATH}")
|
||||
extract_path("${UCD_PATH}" "${UCD_ZIP_PATH}" "${SENTENCE_BREAK_PROP_SOURCE}" "${SENTENCE_BREAK_PROP_PATH}")
|
||||
|
||||
download_file("${EMOJI_TEST_URL}" "${EMOJI_TEST_PATH}")
|
||||
|
||||
download_file("${CLDR_ZIP_URL}" "${CLDR_ZIP_PATH}")
|
||||
extract_path("${CLDR_PATH}" "${CLDR_ZIP_PATH}" "${CLDR_BCP47_SOURCE}/**" "${CLDR_BCP47_PATH}")
|
||||
extract_path("${CLDR_PATH}" "${CLDR_ZIP_PATH}" "${CLDR_CORE_SOURCE}/**" "${CLDR_CORE_PATH}")
|
||||
|
@ -226,6 +234,18 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
|
|||
arguments -d "${CLDR_DATES_PATH}"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${EMOJI_INSTALL_PATH}"
|
||||
COMMAND "${SerenityOS_SOURCE_DIR}/Meta/generate-emoji-txt.sh" "${EMOJI_TEST_PATH}" "${EMOJI_RES_PATH}" "${EMOJI_INSTALL_PATH}"
|
||||
# This will make this command only run when the modified time of the directory changes,
|
||||
# which only happens if files within it are added or deleted, but not when a file is modified.
|
||||
# This is fine for this use-case, because the contents of a file changing should not affect
|
||||
# the generated emoji.txt file.
|
||||
DEPENDS "${EMOJI_RES_PATH}" "${EMOJI_TEST_PATH}"
|
||||
USES_TERMINAL
|
||||
)
|
||||
add_custom_target(generate_emoji_txt ALL DEPENDS "${EMOJI_INSTALL_PATH}")
|
||||
|
||||
set(UNICODE_DATA_SOURCES
|
||||
${UNICODE_DATA_HEADER}
|
||||
${UNICODE_DATA_IMPLEMENTATION}
|
||||
|
|
Loading…
Reference in a new issue