Skip to content

Commit faf619f

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [make] "prebuild" simplified.
* Redundant call to cmake removed * "Export compile commands" moved to config file * cppcheck exhaustive mode enabled.
1 parent 7911451 commit faf619f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
1111
include(CTest)
1212

1313
set(CMAKE_CXX_STANDARD 17)
14-
set(CMAKE_CXX_STANDARD_REQUIRED on)
15-
set(VCPKG_MANIFEST_INSTALL OFF)
14+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
15+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

1717
SET(GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0")
1818
SET(GCC_COVERAGE_LINK_FLAGS "--coverage")

CMakePresets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"generator": "Unix Makefiles",
1212
"binaryDir": "${sourceDir}/build/default"
13-
1413
}
1514
]
1615
}

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ clean:
5555
touch ./coverage/.gitkeep
5656
sh -c "rm -fr -v ./vcpkg_installed" || true
5757

58-
build: dependencies
59-
cmake --preset debug -B build && \
60-
cmake --preset debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 build && \
58+
prebuild: dependencies
59+
cmake --preset debug -B build
60+
61+
build: prebuild
6162
cmake --build build --verbose
6263

6364
dependencies:
@@ -72,17 +73,18 @@ lint/yaml:
7273

7374
lint: lint/markdown lint/yaml test/styling test/static
7475

75-
test/static:
76+
test/static: prebuild
7677
cppcheck \
78+
--project=build/compile_commands.json \
7779
--enable=all \
80+
--check-level=exhaustive \
7881
--std=c++17 \
7982
--library=posix \
8083
--inconclusive \
8184
--inline-suppr \
8285
--error-exitcode=13 \
8386
--suppress=missingIncludeSystem \
84-
--showtime=summary \
85-
src/
87+
--showtime=summary
8688

8789
test/styling:
8890
clang-format --dry-run --Werror $(FILES)

0 commit comments

Comments
 (0)