summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibUnicode
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-07-29 02:18:52 -0600
committerLinus Groh <mail@linusgroh.de>2021-07-29 21:46:25 +0100
commit38707f4a20c9ac8a389c0c5725b7bca25e62b783 (patch)
tree0fdcff8b5935eda4b56bd2a7358acf1543338c36 /Userland/Libraries/LibUnicode
parentde2bf3f333eb85ffe49afcdd0321e03c1d1f7cb6 (diff)
downloadserenity-38707f4a20c9ac8a389c0c5725b7bca25e62b783.zip
LibUnicode: Make unicode data generation logic more relocatable
The previous logic had several checks for Lagom directories and subdirectories. All we really want to do for these header checks is make sure that the files end up in an included folder prefixed with LibUnicode. We also don't need to hard code the path to the generator, the $<TARGET_FILES> generator expression can create the path for us.
Diffstat (limited to 'Userland/Libraries/LibUnicode')
-rw-r--r--Userland/Libraries/LibUnicode/unicode_data.cmake20
1 files changed, 7 insertions, 13 deletions
diff --git a/Userland/Libraries/LibUnicode/unicode_data.cmake b/Userland/Libraries/LibUnicode/unicode_data.cmake
index 5197a75209..6650d0dec5 100644
--- a/Userland/Libraries/LibUnicode/unicode_data.cmake
+++ b/Userland/Libraries/LibUnicode/unicode_data.cmake
@@ -30,23 +30,17 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
file(DOWNLOAD ${WORD_BREAK_URL} ${WORD_BREAK_PATH} INACTIVITY_TIMEOUT 10)
endif()
- set(UNICODE_GENERATOR CodeGenerators/GenerateUnicodeData)
- set(UNICODE_DATA_HEADER UnicodeData.h)
- set(UNICODE_DATA_IMPLEMENTATION UnicodeData.cpp)
+ set(UNICODE_DATA_HEADER LibUnicode/UnicodeData.h)
+ set(UNICODE_DATA_IMPLEMENTATION LibUnicode/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)
+ if (CMAKE_CURRENT_BINARY_DIR MATCHES ".*/LibUnicode") # Serenity build.
+ set(UNICODE_DATA_HEADER UnicodeData.h)
+ set(UNICODE_DATA_IMPLEMENTATION UnicodeData.cpp)
endif()
add_custom_command(
OUTPUT ${UNICODE_DATA_HEADER}
- COMMAND ${write_if_different} ${UNICODE_DATA_HEADER} ${UNICODE_GENERATOR} -h -u ${UNICODE_DATA_PATH} -s ${SPECIAL_CASING_PATH} -p ${PROP_LIST_PATH} -w ${WORD_BREAK_PATH}
+ COMMAND ${write_if_different} ${UNICODE_DATA_HEADER} $<TARGET_FILE:GenerateUnicodeData> -h -u ${UNICODE_DATA_PATH} -s ${SPECIAL_CASING_PATH} -p ${PROP_LIST_PATH} -w ${WORD_BREAK_PATH}
VERBATIM
DEPENDS GenerateUnicodeData
MAIN_DEPENDENCY ${UNICODE_DATA_PATH} ${SPECIAL_CASING_PATH}
@@ -54,7 +48,7 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD)
add_custom_command(
OUTPUT ${UNICODE_DATA_IMPLEMENTATION}
- COMMAND ${write_if_different} ${UNICODE_DATA_IMPLEMENTATION} ${UNICODE_GENERATOR} -c -u ${UNICODE_DATA_PATH} -s ${SPECIAL_CASING_PATH} -p ${PROP_LIST_PATH} -w ${WORD_BREAK_PATH}
+ COMMAND ${write_if_different} ${UNICODE_DATA_IMPLEMENTATION} $<TARGET_FILE:GenerateUnicodeData> -c -u ${UNICODE_DATA_PATH} -s ${SPECIAL_CASING_PATH} -p ${PROP_LIST_PATH} -w ${WORD_BREAK_PATH}
VERBATIM
DEPENDS GenerateUnicodeData
MAIN_DEPENDENCY ${UNICODE_DATA_PATH} ${SPECIAL_CASING_PATH}