From db2e48eb594cc10ec0f852688ff4b754880112a2 Mon Sep 17 00:00:00 2001 From: Chloe <25387744+qimiko@users.noreply.github.com> Date: Thu, 5 Sep 2024 03:44:11 -0700 Subject: [PATCH] move ci builds to appleclang (#1030) Co-authored-by: ConfiG Co-authored-by: mat <26722564+matcool@users.noreply.github.com> --- .github/workflows/build.yml | 24 ++++++++++-------------- CMakeLists.txt | 25 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18c2dc97d..80c5df29d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,23 +154,20 @@ jobs: has-sccache: ${{ inputs.use-ccache }} if: inputs.build-debug-info - - name: Setup caches - uses: ./.github/actions/setup-cache - with: - host: mac - target: mac - use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }} + # due to very strange performance issues, sccache is currently disabled for macos. sorry + + # - name: Setup caches + # uses: ./.github/actions/setup-cache + # with: + # host: mac + # target: mac + # use-ccache: ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }} - name: Setup Ninja uses: ./.github/actions/setup-ninja with: host: mac - - name: Install LLVM - run: | - brew install llvm - echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH - - name: Setup CLI uses: geode-sdk/cli/.github/actions/setup@main @@ -180,9 +177,8 @@ jobs: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 - -DCMAKE_AR='/usr/bin/ar' - -DCMAKE_RANLIB='/usr/bin/ranlib' - -DGEODE_DISABLE_PRECOMPILED_HEADERS=Off + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" + -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF ${{ steps.build-debug-info.outputs.extra-configure }} - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eaeb685b..b77224fb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,19 +132,30 @@ endif() if (DEFINED GEODE_CCACHE_VARIANT) if (NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS) - if (${GEODE_CCACHE_VARIANT} STREQUAL "sccache" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be enabled.") - set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF) + if (${GEODE_CCACHE_VARIANT} STREQUAL "sccache" AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + if (DEFINED CMAKE_OSX_ARCHITECTURES AND (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64;x86_64" OR CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64;arm64")) + message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID} while building multiple architectures, PCH will be disabled due to issues with sccache.") + set(GEODE_DISABLE_PRECOMPILED_HEADERS ON) + else() + message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be enabled.") + set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF) + endif() else() message(NOTICE "Using ${GEODE_CCACHE_VARIANT} with ${CMAKE_CXX_COMPILER_ID}, PCH will be disabled.") set(GEODE_DISABLE_PRECOMPILED_HEADERS ON) endif() endif() else() - message(NOTICE "Not using a caching compiler (ccache/sccache). " - "It is recommended to install one to improve build times.") - message(NOTICE "We recommend sccache, check its README for installation instructions, " - "normally you can just use your usual package manager (e.g. 'scoop install sccache').") + if (DEFINED CMAKE_OSX_ARCHITECTURES AND (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64;x86_64" OR CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64;arm64")) + # when building for multiple architectures, a caching compiler is not recommended + message(NOTICE "Not using a caching compiler (ccache/sccache).") + else() + message(NOTICE "Not using a caching compiler (ccache/sccache). " + "It is recommended to install one to improve build times.") + message(NOTICE "We recommend sccache, check its README for installation instructions, " + "normally you can just use your usual package manager (e.g. 'scoop install sccache').") + endif() + if (NOT DEFINED GEODE_DISABLE_PRECOMPILED_HEADERS) message(NOTICE "Because of this, PCH will be enabled.") set(GEODE_DISABLE_PRECOMPILED_HEADERS OFF)