diff --git a/.ci/linux.sh b/.ci/linux.sh index 612aaec1b3..58912ba3e1 100755 --- a/.ci/linux.sh +++ b/.ci/linux.sh @@ -1,13 +1,15 @@ -#!/bin/sh -ex +#!/bin/bash -ex + +if [ "$TARGET" = "appimage" ]; then + export COMPILER_FLAGS=(-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=/etc/bin/ld.lld) +fi mkdir build && cd build cmake .. -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_C_COMPILER=clang \ - -DCMAKE_LINKER=/etc/bin/ld.lld \ + "${COMPILER_FLAGS[@]}" \ -DENABLE_QT_TRANSLATION=ON \ -DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON \ -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d5f22267e8..52fc647118 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,6 +124,12 @@ else() add_compile_options("-stdlib=libc++") endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL GNU) + # GCC may warn when it ignores attributes like maybe_unused, + # which is a problem for older versions (e.g. GCC 11). + add_compile_options("-Wno-attributes") + endif() + if (MINGW) add_definitions(-DMINGW_HAS_SECURE_API) if (COMPILE_WITH_DWARF)