diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ccad4c02ab4..bf656add08f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -126,13 +126,13 @@ jobs: uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b with: path: ${{ github.workspace }}/Build/UCD - key: UnicodeData-${{ hashFiles('Userland/Libraries/LibUnicode/unicode_data.cmake') }} + key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} - name: UnicodeLocale Cache # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b with: path: ${{ github.workspace }}/Build/CLDR - key: UnicodeLocale-${{ hashFiles('Userland/Libraries/LibUnicode/unicode_data.cmake') }} + key: UnicodeLocale-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} - name: Create build environment with extra debug options working-directory: ${{ github.workspace }}/Build # Build the entire project with all available debug options turned on, to prevent code rot. diff --git a/.github/workflows/libjs-test262.yml b/.github/workflows/libjs-test262.yml index 3221c1c7282..815c3d2bb0a 100644 --- a/.github/workflows/libjs-test262.yml +++ b/.github/workflows/libjs-test262.yml @@ -71,7 +71,7 @@ jobs: uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b with: path: ${{ github.workspace }}/libjs-test262/Build/UCD - key: UnicodeData-${{ hashFiles('Userland/Libraries/LibUnicode/unicode_data.cmake') }} + key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} - name: Build libjs-test262-runner and test-js working-directory: libjs-test262 diff --git a/Meta/Azure/Caches.yml b/Meta/Azure/Caches.yml index 55d30688f1d..f65fd2a7396 100644 --- a/Meta/Azure/Caches.yml +++ b/Meta/Azure/Caches.yml @@ -36,13 +36,13 @@ steps: - ${{ if eq(parameters.with_unicode_caches, true) }}: - task: Cache@2 inputs: - key: '"unicode_data" | Userland/Libraries/LibUnicode/unicode_data.cmake' + key: '"unicode_data" | Meta/CMake/unicode_data.cmake' path: $(Build.SourcesDirectory)/${{ parameters.build_directory }}/UCD displayName: 'UnicodeData Cache' - task: Cache@2 inputs: - key: '"unicode_locale" | Userland/Libraries/LibUnicode/unicode_data.cmake' + key: '"unicode_locale" | Meta/CMake/unicode_data.cmake' path: $(Build.SourcesDirectory)/${{ parameters.build_directory }}/CLDR displayName: 'UnicodeLocale Cache' diff --git a/Userland/Libraries/LibUnicode/unicode_data.cmake b/Meta/CMake/unicode_data.cmake similarity index 98% rename from Userland/Libraries/LibUnicode/unicode_data.cmake rename to Meta/CMake/unicode_data.cmake index 16b279afd08..59c1466ebf8 100644 --- a/Userland/Libraries/LibUnicode/unicode_data.cmake +++ b/Meta/CMake/unicode_data.cmake @@ -144,7 +144,4 @@ if (ENABLE_UNICODE_DATABASE_DOWNLOAD) ) set(UNICODE_DATA_SOURCES ${UNICODE_DATA_HEADER} ${UNICODE_DATA_IMPLEMENTATION} ${UNICODE_LOCALE_HEADER} ${UNICODE_LOCALE_IMPLEMENTATION}) - add_compile_definitions(ENABLE_UNICODE_DATA=1) -else() - add_compile_definitions(ENABLE_UNICODE_DATA=0) endif() diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 4347e53910c..5797ce98d44 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -371,12 +371,15 @@ if (BUILD_LAGOM) set(write_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../write-only-on-difference.sh) add_subdirectory(../../Userland/Libraries/LibUnicode/CodeGenerators ${CMAKE_CURRENT_BINARY_DIR}/LibUnicode/CodeGenerators) endif() - include(../../Userland/Libraries/LibUnicode/unicode_data.cmake) + include(${SERENITY_PROJECT_ROOT}/Meta/CMake/unicode_data.cmake) + else() + set(ENABLE_UNICODE_DATABASE_DOWNLOAD OFF) endif() file(GLOB LIBUNICODE_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibUnicode/*.cpp") lagom_lib(Unicode unicode SOURCES ${LIBUNICODE_SOURCES} ${UNICODE_DATA_SOURCES} ) + target_compile_definitions(LagomUnicode PRIVATE ENABLE_UNICODE_DATA=$) # WASM file(GLOB LIBWASM_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibWasm/*/*.cpp") diff --git a/Userland/Libraries/LibUnicode/CMakeLists.txt b/Userland/Libraries/LibUnicode/CMakeLists.txt index c7ded76f1ed..c06d6d17939 100644 --- a/Userland/Libraries/LibUnicode/CMakeLists.txt +++ b/Userland/Libraries/LibUnicode/CMakeLists.txt @@ -1,4 +1,4 @@ -include(unicode_data.cmake) +include(${SerenityOS_SOURCE_DIR}/Meta/CMake/unicode_data.cmake) SET(SOURCES ${UNICODE_DATA_SOURCES} @@ -8,3 +8,4 @@ SET(SOURCES serenity_lib(LibUnicode unicode) target_link_libraries(LibUnicode LibCore) +target_compile_definitions(LibUnicode PRIVATE ENABLE_UNICODE_DATA=$)