diff options
author | Andrew Kaster <akaster@serenityos.org> | 2021-08-08 00:06:55 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-28 08:44:17 +0100 |
commit | e88761b2b97957b755c7406388acede614356a65 (patch) | |
tree | f517d16aaa79a5c92facbe4ebf9f09a1cb92822d | |
parent | 47471c0ec22196b90481da7d7d5e51ac18565548 (diff) | |
download | serenity-e88761b2b97957b755c7406388acede614356a65.zip |
Meta+LibUnicode: Move unicode_data helper to Meta/CMake
Moving this helper CMake file to the centralized Meta/CMake folder helps
to get a better grasp on what extra files are required for the build,
and what files are generated.
While we're at it, don't use add_compile_definitions for
ENABLE_UNICODE_DATA, which only needs to be seen by LibUnicode sources.
-rw-r--r-- | .github/workflows/cmake.yml | 4 | ||||
-rw-r--r-- | .github/workflows/libjs-test262.yml | 2 | ||||
-rw-r--r-- | Meta/Azure/Caches.yml | 4 | ||||
-rw-r--r-- | Meta/CMake/unicode_data.cmake (renamed from Userland/Libraries/LibUnicode/unicode_data.cmake) | 3 | ||||
-rw-r--r-- | Meta/Lagom/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibUnicode/CMakeLists.txt | 3 |
6 files changed, 11 insertions, 10 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ccad4c02ab..bf656add08 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 3221c1c728..815c3d2bb0 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 55d30688f1..f65fd2a739 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 index 16b279afd0..59c1466ebf 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 4347e53910..5797ce98d4 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=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>) # 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 c7ded76f1e..c06d6d1793 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=$<BOOL:${ENABLE_UNICODE_DATABASE_DOWNLOAD}>) |