Skip to content

Commit 0de4f8d

Browse files
nvetrinicfriedt
authored andcommitted
sca: eclair: Make ECLAIR project root configurable.
The project root was set unconditionally as the variable ZEPHYR_BASE, but users developing a Zephyr application may wish to override the project root used by ECLAIR as the base directory of their projects, so that all paths processed by the tool are relative to that directory. - A new cmake variable ECLAIR_PROJECT_ROOT is introduced; - additional messages to output this information before the build starts. Signed-off-by: Nicola Vetrini <[email protected]>
1 parent ed8f537 commit 0de4f8d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmake/sca/eclair/eclair.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ foreach(i RANGE ${end_of_options} ${CMAKE_ARGC})
1818
endforeach()
1919

2020
list(APPEND ECLAIR_ARGS +incremental
21-
-project_name=@ECLAIR_PROJECT_NAME@ -project_root=@ZEPHYR_BASE@
21+
-project_name=@ECLAIR_PROJECT_NAME@
22+
-project_root=@ECLAIR_PROJECT_ROOT@
2223
-eval_file=@ECLAIR_ECL_DIR@/analysis.ecl
2324
-eval_file=@ECLAIR_ANALYSIS_ECL_DIR@/analysis_@[email protected]
2425
@ECLAIR_ENV_ADDITIONAL_OPTIONS@)

cmake/sca/eclair/sca.cmake

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ endif()
2424

2525
# ECLAIR Settings
2626
set(ECLAIR_PROJECT_NAME "Zephyr-${BOARD}${BOARD_QUALIFIERS}")
27+
set(ECLAIR_PROJECT_ROOT "${ZEPHYR_BASE}")
2728
set(ECLAIR_OUTPUT_DIR "${CMAKE_BINARY_DIR}/sca/eclair")
2829
set(ECLAIR_ECL_DIR "${ZEPHYR_BASE}/cmake/sca/eclair/ECL")
2930
set(ECLAIR_ANALYSIS_ECL_DIR "${ZEPHYR_BASE}/cmake/sca/eclair/ECL")
@@ -112,12 +113,15 @@ if (ECLAIR_FULL_HTL)
112113
list(APPEND ECLAIR_REPORT_ADDITIONAL_OPTIONS "-full_html=${ECLAIR_OUTPUT_DIR}/report_full_html")
113114
endif()
114115

115-
message(STATUS "ECLAIR outputs have been written to: ${ECLAIR_OUTPUT_DIR}")
116-
message(STATUS "ECLAIR ECB files have been written to: ${ECLAIR_ANALYSIS_DATA_DIR}")
116+
message(STATUS "ECLAIR project name: ${ECLAIR_PROJECT_NAME}")
117+
message(STATUS "ECLAIR project root is: ${ECLAIR_PROJECT_ROOT}")
118+
message(STATUS "ECLAIR outputs will be written to: ${ECLAIR_OUTPUT_DIR}")
119+
message(STATUS "ECLAIR ECB files will be written to: ${ECLAIR_ANALYSIS_DATA_DIR}")
117120

118121
list(APPEND ECLAIR_CLEAN_ARGS
119122
+clean
120-
-project_name=${ECLAIR_PROJECT_NAME} -project_root=${ZEPHYR_BASE}
123+
-project_name=${ECLAIR_PROJECT_NAME}
124+
-project_root=${ECLAIR_PROJECT_ROOT}
121125
-eval_file=${ECLAIR_ECL_DIR}/analysis.ecl
122126
-eval_file=${ECLAIR_ANALYSIS_ECL_DIR}/analysis_${ECLAIR_RULESET}.ecl
123127
${ECLAIR_ENV_ADDITIONAL_OPTIONS})
@@ -142,7 +146,8 @@ set(CMAKE_C_COMPILER_LAUNCHER ${launch_environment} CACHE INTERNAL "")
142146

143147
list(APPEND ECLAIR_PROJECT_ARGS
144148
+project
145-
-project_name=${ECLAIR_PROJECT_NAME} -project_root=${ZEPHYR_BASE}
149+
-project_name=${ECLAIR_PROJECT_NAME}
150+
-project_root=${ECLAIR_PROJECT_ROOT}
146151
-eval_file=${ECLAIR_ECL_DIR}/analysis.ecl
147152
-eval_file=${ECLAIR_ANALYSIS_ECL_DIR}/analysis_${ECLAIR_RULESET}.ecl
148153
${ECLAIR_ENV_ADDITIONAL_OPTIONS})

0 commit comments

Comments
 (0)