From 4746bb46af0c88790b8eb0bffd804eb61597e14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 5 Feb 2022 11:25:51 +0100 Subject: [PATCH] cmake: export compile commands --- cmake/mainSetup.cmake | 2 ++ doc/readme-pvs-studio.md | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/mainSetup.cmake b/cmake/mainSetup.cmake index 9580d533..1ea9debe 100644 --- a/cmake/mainSetup.cmake +++ b/cmake/mainSetup.cmake @@ -8,6 +8,8 @@ include(CMakeDependentOption) include(cmake/JoinPaths.cmake) include(CTest) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) diff --git a/doc/readme-pvs-studio.md b/doc/readme-pvs-studio.md index 456b6ed6..e54afd84 100644 --- a/doc/readme-pvs-studio.md +++ b/doc/readme-pvs-studio.md @@ -12,9 +12,10 @@ cd buildXXX cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ... # Once the CMake configuration is done, we should obtain a output file 'compile_commands.json' +# NOTE: This option is enabled by default inside our CMake configuration (see cmake/mainSetup.cmake) ``` -The analysis starts with the following commands: +The analysis starts by running the following commands: ```bash export PVS_LICENSE=~/.config/PVS-Studio/PVS-Studio.lic @@ -23,3 +24,8 @@ plog-converter -a GA:1,2 -t tasklist pvsStudio.log -o pvsStudio.tasks plog-converter -a GA:1,2 -t fullhtml pvsStudio.log -o pvsReportHtml plog-converter -a GA:1,2 -d V1042 -t fullhtml pvsStudio.log -o pvsReportHtml ``` + +## CI + +The PVS username & key are configured as secrets in the security settings of the project. Then we make use of such +secrets in the Github workflow named `special_pvsStudio`.