Skip to content

Commit 882568b

Browse files
committed
Cmake/Coverity: Force coverity to check _everything_
The current Cmake logic is set so that if things (like avahi) are not installed, it doesn't build or link against it. On normal systems this make sense. I recently noticed that coverity builds (which happen on the coverity servers, not on the Travis-CI servers), don't have external libraries installed, and then a few options don't get configured/added, and therefore, don't get checked. Add an option to the Cmake which blindly adds things (which is fine, since coverity doesn't actually compile/link things); so all backends and options get checked. Signed-off-by: Robin Getz <[email protected]>
1 parent c68c16f commit 882568b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ matrix:
4141
- COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
4242
- COVERITY_SCAN_BRANCH_PATTERN="master"
4343
- COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]"
44-
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="mkdir build && cd build && cmake -DWITH_EXAMPLES=ON .."
44+
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="mkdir build && cd build && cmake -DCOVERITY_BUILD=ON -DWITH_EXAMPLES=ON .."
4545
- COVERITY_SCAN_BUILD_COMMAND="make"
4646
# The COVERITY_SCAN_TOKEN
4747
- secure: "QQt2l9IVo0xXWLx7Xqgz/4Iezj7YroY3MKfmG+OhtzkMRx4prhx32/07JMNAcYx6mQrccyZkBNzpYuXlfIZjFL3xDxDj5+iKv5XXpJbRFQGhc5xZtAlzOIqHNMcFc0Aj8J2mZwKfSaDnBdf+nMgKcmn46pYbpJOmPe9iEfeLvvg="

CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,34 @@ if (WIN32)
352352
configure_file(properties.rc.cmakein ${LIBIIO_RC} @ONLY)
353353
endif()
354354

355+
option(COVERITY_BUILD "Turn on things for Coverity Builds" OFF)
356+
if (COVERITY_BUILD)
357+
# Make sure everything gets turned on
358+
list(APPEND LIBIIO_CFILES local.c
359+
./libini/libini.c
360+
usb.c
361+
serial.c
362+
network.c
363+
dns_sd_avahi.c
364+
dns_sd.c
365+
xml.c
366+
lock.c
367+
iiod-client.c
368+
)
369+
# turn on optional code paths
370+
set(WITH_USB_BACKEND ON)
371+
set(WITH_NETWORK_BACKEND ON)
372+
set(WITH_LOCAL_BACKEND ON)
373+
set(WITH_SERIAL_BACKEND ON)
374+
set(WITH_XML_BACKEND ON)
375+
set(WITH_IIOD ON)
376+
set(SKIP_INSTALL_ALL ON)
377+
set(ENABLE_IPV6 ON)
378+
set(WITH_LOCAL_CONFIG ON)
379+
# in case something was already turned on, remove it
380+
list(REMOVE_DUPLICATES LIBIIO_CFILES)
381+
endif()
382+
355383
add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS} ${LIBIIO_EXTRA_HEADERS} ${LIBIIO_RC})
356384
set_target_properties(iio PROPERTIES
357385
VERSION ${VERSION}

0 commit comments

Comments
 (0)