diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml deleted file mode 100644 index 0eee9446869..00000000000 --- a/.github/workflows/CI-cygwin.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: CI-cygwin - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -defaults: - run: - shell: cmd - -jobs: - # TODO: add CMake build - build_cygwin: - strategy: - matrix: - # only use the latest windows-* as the installed toolchain is identical - os: [windows-2025] - platform: [x86_64] - include: - - platform: 'x86_64' - packages: | - gcc-g++ - python3 - fail-fast: false - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Set up Cygwin - uses: cygwin/cygwin-install-action@master - with: - site: https://mirrors.cicku.me/cygwin/ - platform: ${{ matrix.platform }} - packages: ${{ matrix.packages }} - - # Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries. - - name: Build all and run test - run: | - C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j%NUMBER_OF_PROCESSORS% CXXOPTS="-Werror" test - - - name: Extra test for misra - run: | - cd %GITHUB_WORKSPACE%\addons\test - ..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 - python3 ..\misra.py -verify misra\misra-test.c.dump - ..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c - diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml deleted file mode 100644 index 1b0cf3e5672..00000000000 --- a/.github/workflows/CI-mingw.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: CI-mingw - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -defaults: - run: - shell: msys2 {0} - -jobs: - # TODO: add CMake build - build_mingw: - strategy: - matrix: - # only use the latest windows-* as the installed toolchain is identical - os: [windows-2025] - fail-fast: false - - runs-on: ${{ matrix.os }} - - timeout-minutes: 19 # max + 3*std of the last 7K runs - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - release: false # use pre-installed - # TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions." - install: >- - mingw-w64-x86_64-lld - mingw-w64-x86_64-ccache - make - mingw-w64-x86_64-gcc - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} - - - name: Build cppcheck - run: | - export PATH="/mingw64/lib/ccache/bin:$PATH" - # set RDYNAMIC to work around broken MinGW detection - # use lld for faster linking - make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" cppcheck - - - name: Build test - run: | - export PATH="/mingw64/lib/ccache/bin:$PATH" - # set RDYNAMIC to work around broken MinGW detection - # use lld for faster linking - make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" testrunner - - - name: Run test - run: | - export PATH="/mingw64/lib/ccache/bin:$PATH" - # set RDYNAMIC to work around broken MinGW detection - # use lld for faster linking - make VERBOSE=1 RDYNAMIC=-lshlwapi LDOPTS=-fuse-ld=lld -j$(nproc) CXXOPTS="-Werror" test diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index e254c1e986f..e4407060abe 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -57,7 +57,7 @@ jobs: - name: Run CMake run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - name: CMake build (with GUI) run: | diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index fabe0832f4b..836452e16cb 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -58,13 +58,13 @@ jobs: - name: CMake build on ubuntu (with GUI / system tinyxml2) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output.tinyxml2 -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output.tinyxml2 -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: CMake build on macos (with GUI / system tinyxml2) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output.tinyxml2 -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + cmake -S . -B cmake.output.tinyxml2 -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 cmake --build cmake.output.tinyxml2 -- -j$(nproc) - name: Run CMake test (system tinyxml2) @@ -127,12 +127,12 @@ jobs: - name: Run CMake on ubuntu (with GUI) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install - name: Run CMake on macos (with GUI) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 - name: Run CMake build run: | @@ -154,13 +154,13 @@ jobs: - name: Run CMake on ubuntu (no CLI) if: matrix.os == 'ubuntu-22.04' run: | - cmake -S . -B cmake.output_nocli -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DBUILD_CLI=Off + cmake -S . -B cmake.output_nocli -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_CLI=Off - name: Run CMake on ubuntu (no CLI / with tests) if: matrix.os == 'ubuntu-22.04' run: | # the test and CLI code are too intertwined so for now we need to reject that - if cmake -S . -B cmake.output_nocli_tests -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=On -DBUILD_CLI=Off; then + if cmake -S . -B cmake.output_nocli_tests -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DBUILD_CLI=Off; then exit 1 else exit 0 @@ -169,18 +169,18 @@ jobs: - name: Run CMake on ubuntu (no CLI / with GUI) if: matrix.os == 'ubuntu-22.04' run: | - cmake -S . -B cmake.output_nocli_gui -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=On + cmake -S . -B cmake.output_nocli_gui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=On - name: Run CMake on ubuntu (no GUI) if: matrix.os == 'ubuntu-22.04' run: | - cmake -S . -B cmake.output_nogui -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DBUILD_GUI=Off + cmake -S . -B cmake.output_nogui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off - name: Run CMake on ubuntu (no GUI / with triage) if: matrix.os == 'ubuntu-22.04' run: | # cannot build triage without GUI - if cmake -S . -B cmake.output_nogui_triage -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DBUILD_GUI=Off -DBUILD_TRIAGE=On; then + if cmake -S . -B cmake.output_nogui_triage -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off -DBUILD_TRIAGE=On; then exit 1 else exit 0 @@ -189,7 +189,7 @@ jobs: - name: Run CMake on ubuntu (no CLI / no GUI) if: matrix.os == 'ubuntu-22.04' run: | - cmake -S . -B cmake.output_nocli_nogui -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DBUILD_GUI=Off + cmake -S . -B cmake.output_nocli_nogui -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DBUILD_GUI=Off build_cmake_cxxstd: @@ -243,12 +243,12 @@ jobs: - name: Run CMake on ubuntu (with GUI) if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - name: Run CMake on macos (with GUI) if: contains(matrix.os, 'macos') run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6 - name: Run CMake build run: | @@ -373,7 +373,7 @@ jobs: run: | # make sure we fail when Boost is requested and not available. # will fail because no package configuration is available. - if cmake -S . -B cmake.output.boost-force-noavail -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DUSE_BOOST=On; then + if cmake -S . -B cmake.output.boost-force-noavail -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=On; then exit 1 else exit 0 @@ -386,12 +386,12 @@ jobs: - name: Run CMake on macOS (force Boost) run: | - cmake -S . -B cmake.output.boost-force -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DUSE_BOOST=On + cmake -S . -B cmake.output.boost-force -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=On - name: Run CMake on macOS (no Boost) run: | # make sure Boost is not used when disabled even though it is available - cmake -S . -B cmake.output.boost-no -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=Off -DUSE_BOOST=Off + cmake -S . -B cmake.output.boost-no -Werror=dev --warn-uninitialized -DBUILD_TESTING=Off -DUSE_BOOST=Off if grep -q '\-DHAVE_BOOST' ./cmake.output.boost-no/compile_commands.json; then exit 1 else @@ -400,7 +400,7 @@ jobs: - name: Run CMake on macOS (with Boost) run: | - cmake -S . -B cmake.output.boost -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output.boost -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache grep -q '\-DHAVE_BOOST' ./cmake.output.boost/compile_commands.json - name: Build with CMake on macOS (with Boost) @@ -436,12 +436,14 @@ jobs: - name: Run CMake (without GUI) run: | export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On + # FIXME: cannot use --warn-uninitialized here as it completely break the build + cmake -S . -B cmake.output -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On - name: Run CMake (with GUI) run: | export PATH=cmake-${{ env.CMAKE_VERSION_FULL }}-linux-x86_64/bin:$PATH - cmake -S . -B cmake.output.gui -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On + # FIXME: cannot use --warn-uninitialized here as it completely break the build + cmake -S . -B cmake.output.gui -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On build: @@ -596,7 +598,7 @@ jobs: - name: Test Signalhandler run: | - cmake -S . -B build.cmake.signal -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On + cmake -S . -B build.cmake.signal -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On cmake --build build.cmake.signal --target test-signalhandler -- -j$(nproc) # TODO: how to run this without copying the file? cp build.cmake.signal/bin/test-s* . @@ -607,7 +609,7 @@ jobs: - name: Test Stacktrace if: contains(matrix.os, 'ubuntu') run: | - cmake -S . -B build.cmake.stack -Werror=dev -G "Unix Makefiles" -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On + cmake -S . -B build.cmake.stack -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On cmake --build build.cmake.stack --target test-stacktrace -- -j$(nproc) # TODO: how to run this without copying the file? cp build.cmake.stack/bin/test-s* . @@ -721,7 +723,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -Werror=dev -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On - name: Generate dependencies run: | diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index c993c57753a..f1b640e1c8f 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -53,7 +53,7 @@ jobs: run: | rem TODO: enable rules? rem specify Release build so matchcompiler is used - cmake -S . -B build -Werror=dev -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! + cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! - name: Build GUI release run: | @@ -92,7 +92,7 @@ jobs: - name: Run CMake run: | - cmake -S . -B build.cxxstd -Werror=dev -G "Visual Studio 17 2022" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! + cmake -S . -B build.cxxstd -Werror=dev --warn-uninitialized -G "Visual Studio 17 2022" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.cxxstd }} -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! - name: Build run: | @@ -272,7 +272,7 @@ jobs: - name: Test SEH wrapper if: matrix.config == 'release' run: | - cmake -S . -B build.cmake.seh -Werror=dev -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! + cmake -S . -B build.cmake.seh -Werror=dev --warn-uninitialized -DBUILD_TESTING=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! cmake --build build.cmake.seh --target test-sehwrapper || exit /b !errorlevel! :: TODO: how to run this without copying the file? copy build.cmake.seh\bin\Debug\test-sehwrapper.exe . || exit /b !errorlevel! diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 38e90cb760a..3ac98a8d4e2 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -74,7 +74,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: CC: clang-22 CXX: clang++-22 diff --git a/.github/workflows/buildman.yml b/.github/workflows/buildman.yml deleted file mode 100644 index b0b399dd851..00000000000 --- a/.github/workflows/buildman.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: Build manual - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - convert_via_pandoc: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - run: | - mkdir output - - - uses: docker://pandoc/latex:3.6.3 - with: - args: --output=output/manual.html man/manual.md - - - uses: docker://pandoc/latex:3.6.3 - with: - args: --output=output/manual.pdf man/manual.md - - - uses: docker://pandoc/latex:3.6.3 - with: - args: --output=output/manual-premium.pdf man/manual-premium.md - - - uses: actions/upload-artifact@v4 - with: - name: output - path: output - - manpage: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Install missing software on ubuntu - run: | - sudo apt-get update - sudo apt-get install -y xsltproc docbook-xsl - - - name: build manpage - run: | - make man - - - uses: actions/upload-artifact@v4 - with: - name: cppcheck.1 - path: cppcheck.1 diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml deleted file mode 100644 index 7b462c688f0..00000000000 --- a/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: CIFuzz - -on: [pull_request] - -permissions: - contents: read - -jobs: - Fuzzing: - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'danmar' }} - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'cppcheck' - dry-run: false - language: c++ - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'cppcheck' - fuzz-seconds: 300 - dry-run: false - language: c++ - - name: Upload Crash - uses: actions/upload-artifact@v4 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 540e5770382..7a5b317693a 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -61,7 +61,7 @@ jobs: - name: Prepare CMake run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_COMPILE_WARNING_AS_ERROR=On env: CC: clang-22 CXX: clang++-22 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 12e758d2c9e..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,52 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: "CodeQL" - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-22.04 - permissions: - security-events: write - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['cpp', 'python'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - persist-credentials: false - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Build cppcheck - if: matrix.language == 'cpp' - run: | - make -j$(nproc) CXXOPTS="-Werror" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= cppcheck - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 13f56172a80..00000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: Coverage - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.workflow }}-${{ runner.os }} - - - name: Install missing software on ubuntu - run: | - sudo apt-get update - sudo apt-get install libxml2-utils lcov - - - name: Install missing Python packages on ubuntu - run: | - python -m pip install pip --upgrade - python -m pip install lcov_cobertura - - - name: Compile instrumented - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) CXXOPTS="-Werror -g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes CPPCHK_GLIBCXX_DEBUG= all - - - name: Run instrumented tests - run: | - ./testrunner - test/cfg/runtests.sh - - - name: Generate coverage report - run: | - gcov lib/*.cpp -o lib/ - lcov --directory ./ --capture --output-file lcov_tmp.info -b ./ - lcov --extract lcov_tmp.info "$(pwd)/*" --output-file lcov.info - genhtml lcov.info -o coverage_report --frame --legend --demangle-cpp - - - uses: actions/upload-artifact@v4 - with: - name: Coverage results - path: coverage_report - - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - # file: ./coverage.xml # optional - flags: unittests # optional - name: ${{ github.repository }} # optional - fail_ci_if_error: true # optional (default = false): diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml deleted file mode 100644 index 3c07b61d7c7..00000000000 --- a/.github/workflows/coverity.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: Coverity - -on: - schedule: - - cron: "0 0 * * *" - -permissions: - contents: read - -jobs: - scan: - runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'danmar' }} - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Install missing software on ubuntu - run: | - sudo apt-get update - sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev - - name: Download Coverity build tool - run: | - wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=cppcheck" -O coverity_tool.tar.gz - mkdir coverity_tool - tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool - - name: Build with Coverity build tool - run: | - export PATH=`pwd`/coverity_tool/bin:$PATH - cov-build --dir cov-int make CPPCHK_GLIBCXX_DEBUG= - - name: Submit build result to Coverity Scan - run: | - tar czvf cov.tar.gz cov-int - curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \ - --form email=daniel.marjamaki@gmail.com \ - --form file=@cov.tar.gz \ - --form version="Commit $GITHUB_SHA" \ - --form description="Development" \ - https://scan.coverity.com/builds?project=cppcheck diff --git a/.github/workflows/cppcheck-premium.yml b/.github/workflows/cppcheck-premium.yml deleted file mode 100644 index 5cb63ca4d5e..00000000000 --- a/.github/workflows/cppcheck-premium.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: cppcheck-premium - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - workflow_dispatch: - inputs: - premium_version: - description: 'Cppcheck Premium version' - -permissions: - contents: read - security-events: write - -jobs: - - build: - runs-on: ubuntu-24.04 # run on the latest image only - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Download cppcheckpremium release - run: | - premium_version=${{ inputs.premium_version }} - if [ -z $premium_version ]; then - premium_version=25.8.3 - #wget https://files.cppchecksolutions.com/devdrop/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz - wget https://files.cppchecksolutions.com/$premium_version/ubuntu-24.04/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz - else - wget https://files.cppchecksolutions.com/$premium_version/ubuntu-24.04/cppcheckpremium-$premium_version-amd64.tar.gz -O cppcheckpremium.tar.gz - fi - tar xzf cppcheckpremium.tar.gz - mv cppcheckpremium-$premium_version cppcheckpremium - - - name: Generate a license file - run: | - echo cppcheck > cppcheck.lic - echo 261231 >> cppcheck.lic - echo 80000 >> cppcheck.lic - echo 4b64673f03fb6230 >> cppcheck.lic - echo path:lib >> cppcheck.lic - - - name: Check - run: | - cppcheckpremium/premiumaddon --check-loc-license cppcheck.lic > cppcheck-premium-loc - cppcheckpremium/cppcheck --premium=safety-off -j$(nproc) -D__GNUC__ -D__CPPCHECK__ --suppressions-list=cppcheckpremium-suppressions --platform=unix64 --enable=style --premium=misra-c++-2023 --premium=cert-c++-2016 --inline-suppr lib --error-exitcode=0 --output-format=sarif 2> results.sarif - - - name: Cat results - run: | - #sed -i 's|"security-severity":.*||' results.sarif - cat results.sarif - - - uses: actions/upload-artifact@v4 - with: - name: results - path: results.sarif - - - name: Upload report - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif - category: cppcheckpremium diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index fd491c0ec0e..00000000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: format - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-22.04 - - env: - UNCRUSTIFY_VERSION: 0.80.1 - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Cache uncrustify - uses: actions/cache@v4 - id: cache-uncrustify - with: - path: | - ~/uncrustify - key: ${{ runner.os }}-uncrustify-${{ env.UNCRUSTIFY_VERSION }} - - - name: build uncrustify - if: steps.cache-uncrustify.outputs.cache-hit != 'true' - run: | - set -x - wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz - tar xzvf uncrustify-${{ env.UNCRUSTIFY_VERSION }}.tar.gz - cd uncrustify-uncrustify-${{ env.UNCRUSTIFY_VERSION }} - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - cmake --build build -- -j$(nproc) -s - mkdir ~/uncrustify - cp build/uncrustify ~/uncrustify/ - - - name: Uncrustify check - run: | - UNCRUSTIFY=~/uncrustify/uncrustify ./runformat - git diff - git diff | diff - /dev/null &> /dev/null diff --git a/.github/workflows/iwyu.yml b/.github/workflows/iwyu.yml index 9ac43313671..7e0fb03ecbb 100644 --- a/.github/workflows/iwyu.yml +++ b/.github/workflows/iwyu.yml @@ -2,10 +2,7 @@ # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners name: include-what-you-use -on: - schedule: - - cron: '0 0 * * 0' - workflow_dispatch: +on: [pull_request, push] permissions: contents: read @@ -128,7 +125,7 @@ jobs: - name: Prepare CMake run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.stdlib == 'libc++' }} + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.stdlib == 'libc++' }} env: CC: clang CXX: clang++ @@ -236,7 +233,7 @@ jobs: - name: Prepare CMake run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }} + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCPPCHK_GLIBCXX_DEBUG=Off -DUSE_MATCHCOMPILER=Off -DEXTERNALS_AS_SYSTEM=On -DUSE_LIBCXX=${{ matrix.use_libcxx }} env: CC: clang-22 CXX: clang++-22 diff --git a/.github/workflows/release-windows-mingw.yml b/.github/workflows/release-windows-mingw.yml deleted file mode 100644 index 3b9b836347f..00000000000 --- a/.github/workflows/release-windows-mingw.yml +++ /dev/null @@ -1,69 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: release-windows-mingw - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -defaults: - run: - shell: msys2 {0} - -jobs: - # TODO: add CMake build - build_mingw: - strategy: - matrix: - # only use the latest windows-* as the installed toolchain is identical - os: [windows-2025] - fail-fast: false - - runs-on: ${{ matrix.os }} - - timeout-minutes: 19 # max + 3*std of the last 7K runs - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Set up MSYS2 - uses: msys2/setup-msys2@v2 - with: - release: false # use pre-installed - # TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions." - install: >- - mingw-w64-x86_64-lld - make - mingw-w64-x86_64-gcc - python - - - name: Build cppcheck - run: | - export PATH="/mingw64/lib/ccache/bin:$PATH" - # set RDYNAMIC to work around broken MinGW detection - make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) CXXFLAGS=-O2 MATCHCOMPILER=yes cppcheck - - - name: Package - run: | - mkdir cppcheck-mingw - cp cppcheck.exe cppcheck-mingw/ - cp -R cfg platforms cppcheck-mingw/ - cp /mingw64/bin/libgcc_s_seh-1.dll cppcheck-mingw/ - cp /mingw64/bin/libstdc*.dll cppcheck-mingw/ - cp /mingw64/bin/libwinpthread-1.dll cppcheck-mingw/ - - - uses: actions/upload-artifact@v4 - with: - name: cppcheck-mingw - path: cppcheck-mingw diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index 20868c1c607..a392ee94039 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -2,13 +2,7 @@ # Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners name: release-windows -on: - push: - tags: - - '2.*' - schedule: - - cron: '0 0 * * *' - workflow_dispatch: +on: [pull_request, push] permissions: contents: read @@ -79,7 +73,7 @@ jobs: run: | :: TODO: enable rules? :: specify Release build so matchcompiler is used - cmake -S . -B build -Werror=dev -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On -DUSE_BOOST=ON -DBOOST_INCLUDEDIR=%GITHUB_WORKSPACE%\boost -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! + cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On -DUSE_BOOST=ON -DBOOST_INCLUDEDIR=%GITHUB_WORKSPACE%\boost -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel! cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel! # TODO: package PDBs diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml deleted file mode 100644 index 844b1d5c2f3..00000000000 --- a/.github/workflows/scriptcheck.yml +++ /dev/null @@ -1,222 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: scriptcheck - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.workflow }}-${{ runner.os }} - - - name: Cache Cppcheck - uses: actions/cache@v4 - with: - path: cppcheck - key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }} - - - name: build cppcheck - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) CXXOPTS="-Werror" - strip -s ./cppcheck - - scriptcheck: - - needs: build - runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] - include: - - python-version: '3.14' - python-latest: true - - fail-fast: false - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - # TODO: bailout on error - - name: Restore Cppcheck - uses: actions/cache@v4 - with: - path: cppcheck - key: ${{ runner.os }}-scriptcheck-cppcheck-${{ github.sha }} - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - check-latest: true - - - name: Install missing software on ubuntu - run: | - sudo apt-get update - sudo apt-get install tidy libxml2-utils - - - name: Install missing software on ubuntu (Python 3) - run: | - # shellcheck cannot be installed via pip - # ERROR: Could not find a version that satisfies the requirement shellcheck (from versions: none) - # ERROR: No matching distribution found for shellcheck - sudo apt-get install shellcheck - python -m pip install pip --upgrade - python -m pip install natsort - python -m pip install pexpect - python -m pip install 'pylint<4.1.0' - python -m pip install unittest2 - python -m pip install pytest - python -m pip install pytest-xdist - python -m pip install pygments - python -m pip install requests - python -m pip install psutil - python -m pip install setuptools - - - name: run Shellcheck - if: matrix.python-latest - run: | - find . -name "*.sh" | xargs shellcheck --exclude SC2002,SC2013,SC2034,SC2035,SC2043,SC2046,SC2086,SC2089,SC2090,SC2129,SC2211,SC2231 - - - name: run pylint - if: matrix.python-latest - run: | - shopt -s globstar - pylint --jobs $(nproc) --py-version 3.7 addons/**/*.py htmlreport/cppcheck-htmlreport htmlreport/**/*.py test/**/*.py tools/**/*.py - - - name: check .json files - if: matrix.python-latest - run: | - find . -name '*.json' | xargs -n 1 python -m json.tool > /dev/null - - - name: Validate - if: matrix.python-latest - run: | - make -j$(nproc) validateCFG validatePlatforms validateRules - - - name: check python syntax - run: | - shopt -s globstar - python -m py_compile addons/**/*.py - python -m py_compile htmlreport/cppcheck-htmlreport - python -m py_compile htmlreport/**/*.py - python -m py_compile test/**/*.py - python -m py_compile tools/**/*.py - - - name: compile addons - run: | - python -m compileall ./addons - - - name: test matchcompiler - run: | - python test/tools/test_matchcompiler.py - env: - PYTHONPATH: ./tools - - # TODO: run with "-n auto" when misra_test.py can be run in parallel - # we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.9/3.10 contains an unclosed file - - name: test addons - if: matrix.python-version == '3.9' || matrix.python-version == '3.10' - run: | - python -m pytest --strict-markers -vv -n 1 addons/test - env: - PYTHONPATH: ./addons - - # TODO: run with "-n auto" when misra_test.py can be run in parallel - - name: test addons - if: matrix.python-version != '3.9' && matrix.python-version != '3.10' - run: | - python -m pytest -Werror --strict-markers -vv -n 1 addons/test - env: - PYTHONPATH: ./addons - - - name: test htmlreport (standalone) - run: | - test/tools/htmlreport/test_htmlreport.py - test/tools/htmlreport/check.sh - - - name: test htmlreport (pip) - run: | - python -m venv venv - source venv/bin/activate - python -m pip install -U pip - pip install ./htmlreport/ - which cppcheck-htmlreport - PIP_PACKAGE_TEST=1 test/tools/htmlreport/test_htmlreport.py - # TODO: does not test the pip binary - test/tools/htmlreport/check.sh - - - name: test reduce - run: | - python -m pytest -Werror --strict-markers -vv test/tools/reduce_test.py - env: - PYTHONPATH: ./tools - - - name: test donate_cpu_lib - run: | - python -m pytest -Werror --strict-markers -vv test/tools/donate_cpu_lib_test.py - env: - PYTHONPATH: ./tools - - - name: test donate_cpu_server - run: | - python -m pytest -Werror --strict-markers -vv test/tools/donate_cpu_server_test.py - # TODO: why is this file generated? also should be in a temporary folder if possible - rm -f test/tools/donate-cpu-server.log - env: - PYTHONPATH: ./tools - - - name: Show all ignored files - if: false # TODO: currently lists all the contents of ignored folders - we only need what actually matched - run: | - git ls-files --others --ignored --exclude-standard - - - name: Check for changed and unversioned files - run: | - # TODO: how to do this with a single command? - git status --ignored=no - git status --ignored=no | grep -q 'working tree clean' - - dmake: - strategy: - matrix: - os: [ubuntu-22.04, macos-15, windows-2025] - fail-fast: false - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: run dmake - run: | - make -j3 CXXOPTS="-Werror" run-dmake - - - name: check diff - run: | - git diff --exit-code diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml index aa5b61d859b..c2b22eeea2c 100644 --- a/.github/workflows/selfcheck.yml +++ b/.github/workflows/selfcheck.yml @@ -64,7 +64,7 @@ jobs: # unusedFunction - start - name: CMake run: | - cmake -S . -B cmake.output -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off - name: Generate dependencies run: | @@ -90,7 +90,7 @@ jobs: # unusedFunction notest - start - name: CMake (no test) run: | - cmake -S . -B cmake.output.notest -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DBUILD_TRIAGE=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output.notest -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DBUILD_TRIAGE=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off - name: Generate dependencies (no test) run: | @@ -112,7 +112,7 @@ jobs: # unusedFunction notest nogui - start - name: CMake (no test / no gui) run: | - cmake -S . -B cmake.output.notest_nogui -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output.notest_nogui -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off - name: Generate dependencies (no test / no gui) run: | @@ -131,7 +131,7 @@ jobs: # unusedFunction notest nocli - start - name: CMake (no test / no cli) run: | - cmake -S . -B cmake.output.notest_nocli -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output.notest_nocli -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=ON -DWITH_QCHART=ON -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off - name: Generate dependencies (no test / no cli) run: | @@ -154,7 +154,7 @@ jobs: # unusedFunction notest nocli nogui - start - name: CMake (no test / no cli / no gui) run: | - cmake -S . -B cmake.output.notest_nocli_nogui -Werror=dev -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off + cmake -S . -B cmake.output.notest_nocli_nogui -Werror=dev --warn-uninitialized -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_CLI=Off -DBUILD_GUI=Off -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off - name: Generate dependencies (no test / no cli / no gui) run: | @@ -177,7 +177,7 @@ jobs: - name: CMake (corpus / no test) run: | - cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake -S cppcheck-2.8 -B cmake.output.corpus -DHAVE_RULES=On -DBUILD_TESTING=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5 - name: Generate dependencies (corpus) run: | diff --git a/.github/workflows/tsan.yml b/.github/workflows/tsan.yml index 72b1764d11d..c8c01e53b4d 100644 --- a/.github/workflows/tsan.yml +++ b/.github/workflows/tsan.yml @@ -73,7 +73,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: CC: clang-22 CXX: clang++-22 diff --git a/.github/workflows/ubsan.yml b/.github/workflows/ubsan.yml index 5afc5feb1f9..8aa81c0c3ce 100644 --- a/.github/workflows/ubsan.yml +++ b/.github/workflows/ubsan.yml @@ -73,7 +73,7 @@ jobs: - name: CMake run: | - cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake -S . -B cmake.output -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache env: CC: clang-22 CXX: clang++-22 diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml deleted file mode 100644 index 9a6026aa25b..00000000000 --- a/.github/workflows/valgrind.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions -# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners -name: valgrind - -on: - push: - branches: - - 'main' - - 'releases/**' - - '2.*' - tags: - - '2.*' - pull_request: - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.workflow }}-${{ runner.os }} - - - name: Install missing software - run: | - sudo apt-get update - sudo apt-get install libxml2-utils - sudo apt-get install valgrind - sudo apt-get install libboost-container-dev - sudo apt-get install debuginfod - - - name: Build cppcheck - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) CXXOPTS="-Werror -O1 -g" CPPOPTS="-DHAVE_BOOST" HAVE_RULES=yes MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG= - - - name: Build test - run: | - export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" - make -j$(nproc) CXXOPTS="-Werror -O1 -g" CPPOPTS="-DHAVE_BOOST" HAVE_RULES=yes MATCHCOMPILER=yes CPPCHK_GLIBCXX_DEBUG= testrunner - - - name: Run valgrind - run: | - ec=0 - valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log || ec=1 - cat memcheck.log - exit $ec - # TODO: debuginfod.ubuntu.com is currently not responding to any requests causing it to run into a 40(!) minute timeout - #env: - # DEBUGINFOD_URLS: https://debuginfod.ubuntu.com - - - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: Logs - path: ./*.log diff --git a/cmake/clang_tidy.cmake b/cmake/clang_tidy.cmake index fe0efbbe32f..a7d0fbeb7cb 100644 --- a/cmake/clang_tidy.cmake +++ b/cmake/clang_tidy.cmake @@ -40,6 +40,8 @@ if(RUN_CLANG_TIDY_NAMES) set(CLANG_TIDY_CSA_CONFIG "-config={InheritParentConfig: true, Checks: '-*,clang-analyzer-*,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-cplusplus.NewDelete,-clang-analyzer-core.NullDereference,-clang-analyzer-unix.Stream,-clang-analyzer-alpha.clone.CloneChecker,-clang-analyzer-alpha.webkit.*'}") if (ENABLE_CSA_ALPHA) set(CLANG_TIDY_CSA_ALPHA_OPTS "-allow-enabling-alpha-checkers" "-extra-arg=-Xclang" "-extra-arg=-analyzer-config" "-extra-arg=-Xclang" "-extra-arg=aggressive-binary-operation-simplification=true") + else() + set(CLANG_TIDY_CSA_ALPHA_OPTS "") endif() # TODO: exclude moc_*.cpp diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index f3d7b0b2fec..ddfef6718c2 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -34,6 +34,8 @@ if(HAVE_RULES) if(NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") endif() +else() + set(PCRE_LIBRARY "") endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -70,6 +72,9 @@ if(NOT USE_BUNDLED_TINYXML2) endif() find_package(Threads REQUIRED) +if(NOT DEFINED CMAKE_THREAD_LIBS_INIT) + set(CMAKE_THREAD_LIBS_INIT "") +endif() if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.30") # avoid legacy warning about Boost lookup in CMake @@ -90,7 +95,7 @@ if(USE_BOOST) endif() set(Boost_FOUND ON) set(Boost_INCLUDE_DIRS "${BOOST_INCLUDEDIR}") - # TODO: set Boost_VERSION_STRING + set(Boost_VERSION_STRING "") # TODO: set proper value elseif(USE_BOOST STREQUAL "Auto") find_package(Boost) else() diff --git a/cmake/printInfo.cmake b/cmake/printInfo.cmake index 97f0f7d2536..44e068165db 100644 --- a/cmake/printInfo.cmake +++ b/cmake/printInfo.cmake @@ -69,7 +69,9 @@ if(BUILD_GUI) message(STATUS "QT_VERSION = ${QT_VERSION}") message(STATUS "Qt6Core_LIBRARIES = ${Qt6Core_LIBRARIES}") message(STATUS "Qt6Core_INCLUDE_DIRS = ${Qt6Core_INCLUDE_DIRS}") - message(STATUS "QHELPGENERATOR = ${QHELPGENERATOR}") + if(BUILD_ONLINE_HELP) + message(STATUS "QHELPGENERATOR = ${QHELPGENERATOR}") + endif() endif() message(STATUS) message(STATUS "HAVE_RULES = ${HAVE_RULES}") @@ -83,16 +85,22 @@ message(STATUS "CMAKE_THREAD_LIBS_INIT = ${CMAKE_THREAD_LIBS_INIT}") message(STATUS) message(STATUS "USE_BUNDLED_TINYXML2 = ${USE_BUNDLED_TINYXML2}") if(NOT USE_BUNDLED_TINYXML2) - message(STATUS "tinyxml2_LIBRARIES = ${tinyxml2_LIBRARIES}") - message(STATUS "tinyxml2_INCLUDE_DIRS = ${tinyxml2_INCLUDE_DIRS}") + if(TARGET tinyxml2::tinyxml2) + # TODO: print libraries and include dirs + else() + message(STATUS "tinyxml2_LIBRARIES = ${tinyxml2_LIBRARIES}") + message(STATUS "tinyxml2_INCLUDE_DIRS = ${tinyxml2_INCLUDE_DIRS}") + endif() endif() message(STATUS) message(STATUS "USE_BOOST = ${USE_BOOST}") if(USE_BOOST) message(STATUS "Boost_FOUND = ${Boost_FOUND}") - message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}") - message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}") - message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}") + if(Boost_FOUND) + message(STATUS "Boost_VERSION_STRING = ${Boost_VERSION_STRING}") + message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}") + message(STATUS "USE_BOOST_INT128 = ${USE_BOOST_INT128}") + endif() endif() message(STATUS) message(STATUS "USE_LIBCXX = ${USE_LIBCXX}") diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d7a94de352e..b826bc0b265 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -12,6 +12,8 @@ function(build_src output filename) set(${output} ${${output}} ${outfile} PARENT_SCOPE) if (USE_MATCHCOMPILER_OPT STREQUAL "Verify") set(verify_option "--verify") + else() + set(verify_option "") endif() add_custom_command( OUTPUT ${outfile} @@ -28,6 +30,7 @@ function(build_src output filename) endfunction() if (NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") + set(srcs_build "") foreach(file ${srcs}) build_src(srcs_build ${file}) endforeach() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0462a65216e..14f3a8eac17 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -79,7 +79,7 @@ if (BUILD_TESTING) set(oneValueArgs PLATFORM NAME) set(multiValueArgs ADD_LIBRARY) - cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(PARSE "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) get_filename_component(LIBRARY ${CFG_TEST} NAME_WE) # TODO: get rid of this if(PARSE_ADD_LIBRARY)