Skip to content

Commit

Permalink
Allow disabling autodetection of subunit library
Browse files Browse the repository at this point in the history
It can be useful to avoid linking to subunit when we are building the check
library for the host, e.g. in a buildroot recipe, where the built check is
linked into other applications which are used on the host to build images.

These applications are built with the host's cross-compiler and can use
the host's pkgconfig to determine if libraries are available. When check
is linked against other libraries, it can fail this check for subunit.

Allow disabling the autodetection of subunit with a configure flag
-DENABLE_SUBUNIT_EXT=OFF

Signed-off-by: Christopher Obbard <[email protected]>
  • Loading branch information
obbardc committed Jun 13, 2024
1 parent 11970a7 commit 195d2dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,13 @@ if (HAVE_LIBRT)
ADD_DEFINITIONS(-DHAVE_LIBRT=1)
endif (HAVE_LIBRT)

check_library_exists(subunit subunit_test_start "" HAVE_SUBUNIT)
# Allow disabling subunit
IF(ENABLE_SUBUNIT_EXT)
check_library_exists(subunit subunit_test_start "" HAVE_SUBUNIT)
ELSE(ENABLE_SUBUNIT_EXT)
set(HAVE_SUBUNIT, false)
ENDIF(ENABLE_SUBUNIT_EXT)

if (HAVE_SUBUNIT)
set(SUBUNIT "subunit")
set(ENABLE_SUBUNIT 1)
Expand Down

0 comments on commit 195d2dc

Please sign in to comment.