diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 132cfc9fa..caf3c6047 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -26,6 +26,11 @@ inputs: description: Flag to enable or disable PCH required: false type: boolean + maxerrors: + default: 1 + description: Max allowed error count before compilation stops + required: false + type: number runs: using: composite steps: @@ -106,8 +111,8 @@ runs: -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_C_FLAGS="-Werror" \ - -DCMAKE_CXX_FLAGS="-Werror" \ + -DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.cc, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} " \ + -DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.cxx, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}}" \ -DBUILD_TESTING="ON" \ -DUSE_SCRIPTPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ -DUSE_COREPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index e67614ebe..38d930cec 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -49,3 +49,4 @@ jobs: CXX: ${{ matrix.compiler.CXX }} modules: true pch: false + maxerrors: 0