Skip to content

Commit

Permalink
chore: remove -Werror from CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
horror-proton committed Jan 13, 2025
1 parent c5d9644 commit 807e62b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ if (MSVC)

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>: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)
Expand Down

0 comments on commit 807e62b

Please sign in to comment.