From 19f55512c1f7e8c2774cb9d4bca743a20e07106b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 16 Feb 2023 16:26:38 +0800 Subject: [PATCH] GHA CI: don't overwrite system default compile flags System might have some default compile flags which are crucial for security hardening so we should append our flags instead of overwriting them. --- .github/workflows/ci_macos.yaml | 4 ++-- .github/workflows/ci_ubuntu.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_macos.yaml b/.github/workflows/ci_macos.yaml index 9559d5daa..87a3726d6 100644 --- a/.github/workflows/ci_macos.yaml +++ b/.github/workflows/ci_macos.yaml @@ -86,11 +86,11 @@ jobs: - name: Build qBittorrent (Qt5) if: ${{ startsWith(matrix.qt_version, 5) }} run: | + CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \ cmake \ -B build \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DBOOST_ROOT="${{ env.boost_path }}" \ -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \ @@ -104,11 +104,11 @@ jobs: - name: Build qBittorrent (Qt6) if: ${{ startsWith(matrix.qt_version, 6) }} run: | + CXXFLAGS="$CXXFLAGS -Wno-gnu-zero-variadic-macro-arguments -Werror -Wno-error=deprecated-declarations" \ cmake \ -B build \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="-Wno-gnu-zero-variadic-macro-arguments -Werror -Wno-error=deprecated-declarations" \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DBOOST_ROOT="${{ env.boost_path }}" \ -DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \ diff --git a/.github/workflows/ci_ubuntu.yaml b/.github/workflows/ci_ubuntu.yaml index 89fcbe0a9..02d857782 100644 --- a/.github/workflows/ci_ubuntu.yaml +++ b/.github/workflows/ci_ubuntu.yaml @@ -68,11 +68,11 @@ jobs: - name: Build qBittorrent (Qt5) if: ${{ startsWith(matrix.qt_version, 5) }} run: | + CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \ cmake \ -B build \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="-Werror -Wno-error=deprecated-declarations" \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DTESTING=ON \ @@ -86,11 +86,11 @@ jobs: - name: Build qBittorrent (Qt6) if: ${{ startsWith(matrix.qt_version, 6) }} run: | + CXXFLAGS="$CXXFLAGS -Werror" \ cmake \ -B build \ -G "Ninja" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="-Werror" \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DQT6=ON \