Skip to content

Commit 0568da9

Browse files
committed
sca: add coverity as a SCA variant
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent 2a4cebd commit 0568da9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

cmake/sca/coverity/sca.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
find_program(COVERITY_BUILD NAMES cov-build REQUIRED)
3+
find_program(COVERITY_CONFIGURE NAMES cov-configure REQUIRED)
4+
message(STATUS "Found SCA: Coverity (${COVERITY_BUILD})")
5+
6+
7+
zephyr_get(COVERITY_OUTPUT_DIR)
8+
9+
if(NOT COVERITY_OUTPUT_DIR)
10+
set(output_dir ${CMAKE_BINARY_DIR}/sca/coverity)
11+
else()
12+
set(output_dir ${COVERITY_OUTPUT_DIR})
13+
endif()
14+
15+
file(MAKE_DIRECTORY ${output_dir})
16+
17+
set(output_arg --dir=${output_dir})
18+
19+
20+
# ${COV_CONF} --comptype gcc --compiler gcc --template
21+
22+
set(CMAKE_C_COMPILER_LAUNCHER ${COVERITY_BUILD} ${output_arg} CACHE INTERNAL "")
23+
set(CMAKE_CXX_COMPILER_LAUNCHER ${COVERITY_BUILD} ${output_arg} CACHE INTERNAL "")

0 commit comments

Comments
 (0)