Skip to content

Commit e72577e

Browse files
committed
Merge branch 'main' into template-deduce-loop
2 parents acac729 + 55ae8c4 commit e72577e

75 files changed

Lines changed: 2151 additions & 211 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI-unixish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
- name: Run CMake install
151151
run: |
152152
cmake --build cmake.output --target install
153+
# TODO: validate the installed files
153154
154155
- name: Run CMake on ubuntu (no CLI)
155156
if: matrix.os == 'ubuntu-22.04'

.github/workflows/CI-windows.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,26 @@ jobs:
5151
- name: Run CMake
5252
run: |
5353
rem TODO: enable rules?
54-
rem specify Release build so matchcompiler is used
55-
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!
54+
cmake -S . -B build -Werror=dev --warn-uninitialized -DCMAKE_BUILD_TYPE=Debug -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_TESTING=Off -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DBUILD_ONLINE_HELP=On -DISABLE_DMAKE=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DCMAKE_COMPILE_WARNING_AS_ERROR=On || exit /b !errorlevel!
5655
57-
- name: Build GUI release
56+
- name: Build GUI
5857
run: |
59-
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
58+
cmake --build build --config Debug --target cppcheck-gui || exit /b !errorlevel!
6059
60+
# TODO: can this be done in CMake?
6161
- name: Deploy GUI
6262
run: |
63-
windeployqt build\bin\Release || exit /b !errorlevel!
64-
del build\bin\Release\cppcheck-gui.ilk || exit /b !errorlevel!
65-
del build\bin\Release\cppcheck-gui.pdb || exit /b !errorlevel!
63+
windeployqt --no-translations build\bin\Debug || exit /b !errorlevel!
64+
del build\bin\Debug\cppcheck-gui.pdb || exit /b !errorlevel!
6665
6766
# TODO: run GUI tests
6867

6968
- name: Run CMake install
7069
run: |
71-
cmake --build build --target install
70+
rem TODO: the Qt DLLs are not being installed
71+
cmake --build build --config Debug --target install
72+
rem TODO: validate the installed files
73+
rem TODO: the structure does not match an actual Windows installation
7274
7375
build_cmake_cxxstd:
7476
strategy:

.github/workflows/selfcheck.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,25 @@ jobs:
121121
122122
- name: Self check (unusedFunction / no test / no gui)
123123
run: |
124-
supprs="--suppress=unusedFunction:lib/errorlogger.h:198 --suppress=unusedFunction:lib/importproject.cpp:1671 --suppress=unusedFunction:lib/importproject.cpp:1695"
125-
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr $supprs
124+
echo '<?xml version="1.0"?>
125+
<suppressions>
126+
<suppress>
127+
<id>unusedFunction</id>
128+
<fileName>lib/errorlogger.h</fileName>
129+
<symbolName>verboseMessage</symbolName>
130+
</suppress>
131+
<suppress>
132+
<id>unusedFunction</id>
133+
<fileName>lib/importproject.cpp</fileName>
134+
<symbolName>selectVsConfigurations</symbolName>
135+
</suppress>
136+
<suppress>
137+
<id>unusedFunction</id>
138+
<fileName>lib/importproject.cpp</fileName>
139+
<symbolName>getVSConfigs</symbolName>
140+
</suppress>
141+
</suppressions>' > supprs.xml
142+
./cppcheck -q --template=selfcheck --error-exitcode=1 --library=cppcheck-lib -D__CPPCHECK__ -D__GNUC__ --enable=unusedFunction,information --exception-handling -rp=. --project=cmake.output.notest_nogui/compile_commands.json --suppressions-list=.selfcheck_unused_suppressions --inline-suppr --suppress-xml=supprs.xml
126143
env:
127144
DISABLE_VALUEFLOW: 1
128145
UNUSEDFUNCTION_ONLY: 1

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Felipe Pena
133133
Felix Faber
134134
Felix Geyer
135135
Felix Passenberg
136+
Felix Patschkowski
136137
Felix Wolff
137138
Florian Mueller
138139
Florin Iucha

cfg/gtk.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<define name="G_LIKELY(expr)" value="(expr)"/>
9393
<define name="G_UNLIKELY(expr)" value="(expr)"/>
9494
<define name="G_DEPRECATED" value="__attribute__((__deprecated__))"/>
95+
<define name="G_DEPRECATED_FOR(f)" value="__attribute__((__deprecated__(&quot;Use '&quot; #f &quot;' instead&quot;)))"/>
9596
<define name="G_STMT_START" value="do"/>
9697
<define name="G_STMT_END" value="while (0)"/>
9798
<define name="_G_TYPE_CIC(ip, gt, ct)" value="((ct*) ip)"/>
@@ -126,6 +127,7 @@
126127
<define name="g_try_new(struct_type, n_structs)" value="_G_NEW (struct_type, n_structs, try_malloc)"/>
127128
<define name="g_try_new0(struct_type, n_structs)" value="_G_NEW (struct_type, n_structs, try_malloc0)"/>
128129
<define name="g_try_renew(struct_type, mem, n_structs)" value="_G_RENEW (struct_type, mem, n_structs, try_realloc)"/>
130+
<define name="G_ENCODE_VERSION(major, minor)" value="((major) &lt;&lt; 16 | (minor) &lt;&lt; 8)"/>
129131
<define name="GTK_BUTTON(obj)" value="((GtkButton*)(obj))"/>
130132
<define name="GTK_BOX(obj)" value="((GtkBox*)(obj))"/>
131133
<define name="GTK_CONTAINER(obj)" value="((GtkContainer*)(obj))"/>

cfg/microsoft_gsl.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<def>
3+
<define name="Expects(x)" value=""/>
4+
<define name="Ensures(x)" value=""/>
5+
<define name="GSL_SUPPRESS(x)" value=""/>
6+
<podtype name="gsl::index" sign="s"/>
7+
<podtype name="gsl::byte" sign="u" size="1"/><!-- Deprecated in GSL -->
8+
<container id="gslSpan" startPattern="gsl :: span" inherits="stdSpan">
9+
</container>
10+
<smart-pointer class-name="gsl::owner"/>
11+
<smart-pointer class-name="gsl::not_null"/>
12+
<smart-pointer class-name="gsl::unique_ptr"><!-- Deprecated in GSL -->
13+
<unique/>
14+
</smart-pointer>
15+
<smart-pointer class-name="gsl::shared_ptr"/><!-- Deprecated in GSL -->
16+
<smart-pointer class-name="gsl::strict_not_null"/><!-- non-existing in C++ Core Guidelines -->
17+
</def>

cli/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,32 @@ if (BUILD_CLI)
4040
endif()
4141

4242
install(TARGETS cppcheck
43-
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
43+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
4444
COMPONENT applications)
4545

4646
install(PROGRAMS ${CMAKE_SOURCE_DIR}/htmlreport/cppcheck-htmlreport
47-
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
47+
DESTINATION ${CMAKE_INSTALL_BINDIR}
4848
COMPONENT applications)
4949

50+
# TODO: leverage CMAKE_INSTALL_DATAROOTDIR (share)?
51+
5052
install(FILES ${addons_py}
51-
DESTINATION ${FILESDIR_DEF}/addons
53+
DESTINATION ${FILESDIR_INSTALL}/addons
5254
COMPONENT headers)
5355

5456
install(FILES ${addons_json}
55-
DESTINATION ${FILESDIR_DEF}/addons
57+
DESTINATION ${FILESDIR_INSTALL}/addons
5658
COMPONENT headers)
5759

5860
install(FILES ${cfgs}
59-
DESTINATION ${FILESDIR_DEF}/cfg
61+
DESTINATION ${FILESDIR_INSTALL}/cfg
6062
COMPONENT headers)
6163

6264
install(FILES ${platforms}
63-
DESTINATION ${FILESDIR_DEF}/platforms
65+
DESTINATION ${FILESDIR_INSTALL}/platforms
6466
COMPONENT headers)
6567

68+
# TODO: install manpage into CMAKE_INSTALL_MANDIR
69+
# TODO: install documentation into CMAKE_INSTALL_DOCDIR?
70+
6671
endif()

cmake/compilerDefinitions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif()
2020
if ((USE_LIBCXX AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
2121
if(CPPCHK_GLIBCXX_DEBUG AND CMAKE_BUILD_TYPE STREQUAL "Debug")
2222
# TODO: determine proper version for AppleClang - current value is based on the oldest version avaialble in CI
23-
if((CMAKE_CXX_COMPILER_ID STREQUALS "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18) OR
23+
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18) OR
2424
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17))
2525
add_definitions(-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)
2626
else()

cmake/options.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,22 @@ set(CMAKE_DISABLE_PRECOMPILE_HEADERS Off CACHE BOOL "Disable precompiled headers
134134
# see https://gitlab.kitware.com/cmake/cmake/-/issues/21219
135135
set(CMAKE_PCH_PROLOGUE "")
136136

137+
# TODO: do we need to set these?
137138
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/include CACHE PATH "Output directory for headers")
138139
set(CMAKE_LIB_DIRS_CONFIGCMAKE ${CMAKE_INSTALL_PREFIX}/lib CACHE PATH "Output directory for libraries")
139140

141+
# TODO: do we need to set these?
140142
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
141143
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
142144
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
143145

144146
string(LENGTH "${FILESDIR}" _filesdir_len)
145147
# override FILESDIR if it is set or empty
148+
# needs to be an absolute path in Cppcheck but a relative one for CMake install
146149
if(FILESDIR OR ${_filesdir_len} EQUAL 0)
147-
# TODO: verify that it is an absolute path?
150+
set(FILESDIR_INSTALL "${FILESDIR}") # TODO: make relative - leverage CMAKE_INSTALL_DATAROOTDIR?
148151
set(FILESDIR_DEF "${FILESDIR}")
149152
else()
150-
set(FILESDIR_DEF ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME} CACHE STRING "Cppcheck files directory")
153+
set(FILESDIR_INSTALL "share/${PROJECT_NAME}")
154+
set(FILESDIR_DEF "${CMAKE_INSTALL_PREFIX}/${FILESDIR_INSTALL}")
151155
endif()

cmake/printInfo.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ message(STATUS "Compiler Version = ${CMAKE_CXX_COMPILER_VERSION}")
88
message(STATUS "Build type = ${CMAKE_BUILD_TYPE}")
99
message(STATUS "CMake C++ Standard = ${CMAKE_CXX_STANDARD}")
1010
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
11+
message(STATUS "CMAKE_INSTALL_BINDIR = ${CMAKE_INSTALL_BINDIR}")
1112
message(STATUS "CMAKE_DISABLE_PRECOMPILE_HEADERS = ${CMAKE_DISABLE_PRECOMPILE_HEADERS}")
1213
message(STATUS "C++ flags (General) = ${CMAKE_CXX_FLAGS}")
1314
message(STATUS "C++ flags (Release) = ${CMAKE_CXX_FLAGS_RELEASE}")
@@ -109,6 +110,7 @@ message(STATUS)
109110
message(STATUS "USE_LIBCXX = ${USE_LIBCXX}")
110111
message(STATUS)
111112
message(STATUS "FILESDIR = ${FILESDIR}")
113+
message(STATUS "FILESDIR_INSTALL = ${FILESDIR_INSTALL}")
112114
message(STATUS "FILESDIR_DEF = ${FILESDIR_DEF}")
113115
message(STATUS)
114116

0 commit comments

Comments
 (0)