Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions .github/workflows/CI-unixish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ jobs:

strategy:
matrix:
image: ["ubuntu:24.04", "ubuntu:25.10"]
include:
- image: "ubuntu:24.04"
with_gui: true
full_build: true
- image: "ubuntu:25.10"
with_gui: true
full_build: true
- image: "alpine:3.23"
with_gui: false # it appears FindQt6.cmake is not provided by any package
full_build: false # FIXME: test-signalhandler.cpp fails to build since feenableexcept() is missing
fail-fast: false # Prefer quick result

runs-on: ubuntu-22.04
Expand All @@ -45,9 +54,15 @@ jobs:
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev

- name: Install missing software (gui) on latest ubuntu
if: contains(matrix.image, 'ubuntu')
run: |
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev

- name: Install missing software on Alpine
if: contains(matrix.image, 'alpine')
run: |
apk add cmake make g++ pcre-dev

# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
Expand All @@ -57,9 +72,10 @@ jobs:

- name: Run CMake
run: |
cmake -S . -B cmake.output -Werror=dev -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 -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=${{ matrix.with_gui }} -DWITH_QCHART=On -DBUILD_TRIAGE=${{ matrix.with_gui }} -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

- name: CMake build (with GUI)
- name: CMake build
if: matrix.full_build
run: |
cmake --build cmake.output -- -j$(nproc)

Expand All @@ -71,7 +87,7 @@ jobs:

strategy:
matrix:
image: ["ubuntu:24.04", "ubuntu:25.10"]
image: ["ubuntu:24.04", "ubuntu:25.10", "alpine:3.23"]
fail-fast: false # Prefer quick result

runs-on: ubuntu-22.04
Expand All @@ -90,21 +106,28 @@ jobs:
apt-get update
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev

- name: Install missing software on Alpine
if: contains(matrix.image, 'alpine')
run: |
apk add make g++ pcre-dev bash python3 libxml2-utils

# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.workflow }}-${{ matrix.image }}

# /usr/lib/ccache/bin - Alpine Linux

- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror"

- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) HAVE_RULES=yes CXXOPTS="-Werror" testrunner

- name: Run test
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include(cmake/compilerCheck.cmake)
include(cmake/versions.cmake)
include(cmake/findDependencies.cmake)
include(cmake/compileroptions.cmake)
include(cmake/includechecks.cmake)
include(cmake/compilerDefinitions.cmake)
include(cmake/buildFiles.cmake)
if(BUILD_GUI)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ else ifneq ($(HAVE_RULES),)
$(error invalid HAVE_RULES value '$(HAVE_RULES)')
endif

HAVE_EXECINFO_H=$(shell echo "\#include <execinfo.h>" | $(CXX) -c -xc - 2> /dev/null && echo "1" || echo "0")
override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)

override CXXFLAGS += $(CXXOPTS)
override CPPFLAGS += $(CPPOPTS)
override LDFLAGS += $(LDOPTS)
Expand Down
1 change: 0 additions & 1 deletion cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
file(GLOB mainfile "main.cpp")
Expand Down
4 changes: 4 additions & 0 deletions cmake/compilerDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ if(NO_WINDOWS_SEH)
add_definitions(-DNO_WINDOWS_SEH)
endif()

if(NOT MSVC)
add_definitions(-DHAVE_EXECINFO_H=${HAVE_EXECINFO_H})
endif()

if(FILESDIR_DEF)
file(TO_CMAKE_PATH "${FILESDIR_DEF}" _filesdir)
add_definitions(-DFILESDIR="${_filesdir}")
Expand Down
8 changes: 8 additions & 0 deletions cmake/includechecks.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(CheckIncludeFileCXX)

if(NOT MSVC)
check_include_file_cxx(execinfo.h HAVE_EXECINFO_H)
if(NOT HAVE_EXECINFO_H)
set(HAVE_EXECINFO_H 0)
endif()
endif()
3 changes: 3 additions & 0 deletions cmake/printInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ message(STATUS "C++ flags (RelWithDebInfo) = ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
message(STATUS "C++ flags (Debug) = ${CMAKE_CXX_FLAGS_DEBUG}")
message(STATUS "CMAKE_EXE_LINKER_FLAGS = ${CMAKE_EXE_LINKER_FLAGS}")
message(STATUS "CPPCHK_GLIBCXX_DEBUG = ${CPPCHK_GLIBCXX_DEBUG}")
if(DEFINED HAVE_EXECINFO_H)
message(STATUS "HAVE_EXECINFO_H = ${HAVE_EXECINFO_H}")
endif()
get_directory_property(DirCompileDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
message(STATUS "COMPILE_DEFINITIONS (global) = ${DirCompileDefs}")
get_directory_property(DirCompileOptions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_OPTIONS)
Expand Down
8 changes: 7 additions & 1 deletion lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,15 @@
#define USE_WINDOWS_SEH
#endif

#if !defined(NO_UNIX_BACKTRACE_SUPPORT) && defined(__GNUC__) && !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__SVR4) && !defined(__QNX__) && !defined(_AIX)
#if !defined(NO_UNIX_BACKTRACE_SUPPORT)
#if defined(HAVE_EXECINFO_H)
#if HAVE_EXECINFO_H
#define USE_UNIX_BACKTRACE_SUPPORT
#endif
#elif defined(__GNUC__) && !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__SVR4) && !defined(__QNX__) && !defined(_AIX)
#define USE_UNIX_BACKTRACE_SUPPORT
#endif
#endif

#if !defined(NO_UNIX_SIGNAL_HANDLING) && defined(__GNUC__) && !defined(__MINGW32__) && !defined(__OS2__)
#define USE_UNIX_SIGNAL_HANDLING
Expand Down
4 changes: 4 additions & 0 deletions tools/dmake/dmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,10 @@ int main(int argc, char **argv)
<< " $(error invalid HAVE_RULES value '$(HAVE_RULES)')\n"
<< "endif\n\n";

// the # needs to be escaped on older make versions
fout << "HAVE_EXECINFO_H=$(shell echo \"\\#include <execinfo.h>\" | $(CXX) -c -xc - 2> /dev/null && echo \"1\" || echo \"0\")\n"
<< "override CPPFLAGS += -DHAVE_EXECINFO_H=$(HAVE_EXECINFO_H)\n\n";

fout << "override CXXFLAGS += $(CXXOPTS)\n";
fout << "override CPPFLAGS += $(CPPOPTS)\n";
fout << "override LDFLAGS += $(LDOPTS)\n\n";
Expand Down
Loading