Skip to content

Commit

Permalink
do not build strlcat.c if HAVE_STRLCAT is true
Browse files Browse the repository at this point in the history
  • Loading branch information
upa committed Feb 6, 2024
1 parent a7f8ad9 commit 76892a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ endif()

# Symbol check
check_symbol_exists(strlcat string.h HAVE_STRLCAT)
if (NOT HAVE_STRLCAT)
list(APPEND OPENBSD_COMPAT_SRC src/openbsd-compat/strlcat.c)
endif()

# generate config.h in build dir
configure_file(
Expand All @@ -96,7 +99,7 @@ list(APPEND MSCP_BUILD_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include)
# libmscp.a
set(LIBMSCP_SRC
src/mscp.c src/ssh.c src/fileops.c src/path.c src/platform.c src/message.c
src/openbsd-compat/strlcat.c)
${OPENBSD_COMPAT_SRC})
add_library(mscp-static STATIC ${LIBMSCP_SRC})
target_include_directories(mscp-static
PRIVATE ${MSCP_BUILD_INCLUDE_DIRS} ${mscp_SOURCE_DIR}/include)
Expand Down

0 comments on commit 76892a6

Please sign in to comment.