Skip to content

Commit b70b4ce

Browse files
committed
cmake: preserve CMAKE_REQUIRED_DEFINITIONS on BSD
The BSD block used set() to assign CMAKE_REQUIRED_DEFINITIONS, which would silently discard any value already in that variable. Switch to list(APPEND) so the BSD flag is accumulated rather than replacing any pre-existing content. Similarly, use list(APPEND) inside the check_symbol_exists block when prepending the build flags, so the BSD definition set just above is included in the probe compilations rather than overwritten. Signed-off-by: Dan Nechita <dan.nechita@analog.com>
1 parent 72844ac commit b70b4ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ target_compile_definitions(iio PUBLIC
162162

163163
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|DragonFly|OpenBSD|NetBsd")
164164
target_compile_definitions(iio PUBLIC __BSD_VISIBLE)
165-
set(CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1)
165+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1)
166166
endif()
167167

168168
include(GNUInstallDirs)

0 commit comments

Comments
 (0)