From f3692a9cc5f298652cd58ea923c1cf17dadbd68d Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:51:12 +0800 Subject: [PATCH] temp --- .github/workflows/ci.yml | 8 +++++++- CMakeLists.txt | 9 +-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ece538da49a..7d6363a4a70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,18 +248,24 @@ jobs: run: | mkdir -p build cmake -B build \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DMAADEPS_TRIPLET='maa-${{ matrix.arch == 'x86_64' && 'x64' || 'arm64' }}-linux' \ -DINSTALL_THIRD_LIBS=ON \ -DINSTALL_RESOURCE=ON \ -DINSTALL_PYTHON=ON \ -DMAA_VERSION='${{ needs.meta.outputs.tag }}' - cmake --build build --parallel $(nproc --all) + cmake --build build --parallel $(nproc --all) --verbose mkdir -p install cmake --install build --prefix install env: CC: ${{ matrix.arch == 'x86_64' && 'ccache gcc-12' || 'ccache aarch64-linux-gnu-gcc-12' }} CXX: ${{ matrix.arch == 'x86_64' && 'ccache g++-12' || 'ccache aarch64-linux-gnu-g++-12' }} + CMAKE_COLOR_DIAGNOSTICS: ON + CLICOLOR_FORCE: 1 + # workaround for gcc bugs + CXXFLAGS: | + -Wno-error=restrict -Wno-error=array-bounds -Wno-error=stringop-overread -Wno-error=missing-field-initializers - name: Setup Cross Compile Toolchains for CLI uses: ./src/maa-cli/.github/actions/setup diff --git a/CMakeLists.txt b/CMakeLists.txt index 7373fb11772..59846c7d5bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,14 +44,7 @@ if (MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") else () - target_compile_options(MaaCore PRIVATE "-Wall;-Werror;-Wextra;-Wpedantic;-Wno-missing-field-initializers") - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) - target_compile_options(MaaCore PRIVATE "-Wno-restrict;-Wno-array-bounds;-Wno-stringop-overread") - elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 14.2.1) - target_compile_options(MaaCore PRIVATE "-Wno-error=maybe-uninitialized") - endif() - endif() + target_compile_options(MaaCore PRIVATE "-Wall;-Wextra;-Wpedantic") # LLVM clang 16 will failed with `error: no member named 'join' in namespace 'std::ranges::views'`, but Apple clang 16 won't # value defined in https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html if ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)