From 38707f4a20c9ac8a389c0c5725b7bca25e62b783 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 29 Jul 2021 02:18:52 -0600 Subject: 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 $ generator expression can create the path for us. --- Userland/Libraries/LibUnicode/unicode_data.cmake | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'Userland/Libraries/LibUnicode') 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} $ -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} $ -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} -- cgit v1.2.3