From 807e62b8e55d39de36210b411588e0d85816cc61 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] chore: remove -Werror from CMakeLists.txt --- .github/workflows/ci.yml | 5 +++++ CMakeLists.txt | 9 +-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ece538da49a..3017e122b1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,6 +248,7 @@ 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 \ @@ -260,6 +261,10 @@ jobs: 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 + CXXFLAGS: | # workaround for gcc bugs + -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)