Skip to content

Commit d4da23e

Browse files
simheinnashif
authored andcommitted
sca: Add cmake options file for tool configuration
Add a cmake file which uses the cmake options feature and include it inot the sca.cmake file to set up and describe the options for the ECLAIR tool. Signed-off-by: Simon Hein <[email protected]>
1 parent 22ce16d commit d4da23e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

cmake/sca/eclair/sca.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ message(STATUS "Found eclair_env: ${ECLAIR_ENV}")
88
find_program(ECLAIR_REPORT eclair_report REQUIRED)
99
message(STATUS "Found eclair_report: ${ECLAIR_REPORT}")
1010

11+
if(ECLAIR_OPTIONS_FILE)
12+
if(IS_ABSOLUTE ${ECLAIR_OPTIONS_FILE})
13+
set(ECLAIR_OPTIONS ${ECLAIR_OPTIONS_FILE})
14+
else()
15+
set(ECLAIR_OPTIONS ${APPLICATION_CONFIG_DIR}/${ECLAIR_OPTIONS_FILE})
16+
endif()
17+
include(${ECLAIR_OPTIONS})
18+
else()
19+
include(${CMAKE_CURRENT_LIST_DIR}/sca_options.cmake)
20+
endif()
1121

1222
# ECLAIR Settings
1323
set(ECLAIR_PROJECT_NAME "Zephyr-${BOARD}${BOARD_QUALIFIERS}")

cmake/sca/eclair/sca_options.cmake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
include(CMakeDependentOption)
2+
3+
option(ECLAIR_RULESET_FIRST_ANALYSIS "A tiny selection of the projects coding guideline rules to
4+
verify that everything is correctly working" ON)
5+
6+
option(ECLAIR_RULESET_STU "Selection of the projects coding guidelines, which can be verified
7+
by analysing the single translation units independently." OFF)
8+
9+
option(ECLAIR_RULESET_STU_HEAVY "Selection of complex STU project coding guidelines that
10+
require a significant amount of time" OFF)
11+
option(ECLAIR_RULESET_WP "All whole program project coding guidelines ('system' in MISRA's
12+
parlance)." OFF)
13+
option(ECLAIR_RULESET_STD_LIB "Project coding guidelines about the C Standard Library" OFF)
14+
option(ECLAIR_RULESET_USER "User defined ruleset" OFF)
15+
16+
option(ECLAIR_METRICS_TAB "Metrics in a spreadsheet format" OFF)
17+
option(ECLAIR_REPORTS_TAB "Findings in a spreadsheet format" OFF)
18+
option(ECLAIR_REPORTS_SARIF "Findings in sarif JSON format" ON)
19+
option(ECLAIR_SUMMARY_TXT "Plain textual summary format" OFF)
20+
option(ECLAIR_SUMMARY_DOC "DOC summary format" OFF)
21+
option(ECLAIR_SUMMARY_ODT "ODT summary format" OFF)
22+
option(ECLAIR_FULL_TXT "Detailed plain textual format" ON)
23+
option(ECLAIR_FULL_DOC "Detailed DOC format" OFF)
24+
option(ECLAIR_FULL_ODT "Detailed ODT format" OFF)
25+
26+
cmake_dependent_option(ECLAIR_FULL_DOC_ALL_AREAS "Show all areas in a full doc report"
27+
OFF "ECLAIR_FULL_DOC OR ECLAIR_FULL_ODT" OFF)
28+
cmake_dependent_option(ECLAIR_FULL_DOC_FIRST_AREA "Show only the first area in a full doc report"
29+
ON "ECLAIR_FULL_DOC OR ECLAIR_FULL_ODT" OFF)
30+
31+
cmake_dependent_option(ECLAIR_FULL_TXT_ALL_AREAS "Show all areas in a full text report"
32+
OFF "ECLAIR_FULL_TXT" OFF)
33+
cmake_dependent_option(ECLAIR_FULL_TXT_FIRST_AREA "Show only the first area in a full text report"
34+
ON "ECLAIR_FULL_TXT" OFF)

0 commit comments

Comments
 (0)