Skip to content

Commit

Permalink
Detect strlcpy on the fly (musl libc)
Browse files Browse the repository at this point in the history
Detect strlcpy on the fly, as was done in falcosecurity/libs#110.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
  • Loading branch information
mstemm committed Nov 9, 2021
1 parent 9d039fa commit fe32af7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/modules/falcosecurity-libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,15 @@ set(USE_BUNDLED_JSONCPP ON CACHE BOOL "")

list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")

include(CheckSymbolExists)
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
if(HAVE_STRLCPY)
message(STATUS "Existing strlcpy found, will *not* use local definition by setting -DHAVE_STRLCPY.")
add_definitions(-DHAVE_STRLCPY)
else()
message(STATUS "No strlcpy found, will use local definition")
endif()

include(libscap)
include(libsinsp)

0 comments on commit fe32af7

Please sign in to comment.