Libssh-0.10.4 cannot be compiled anymore on CYGWIN

Commit 8cf9c816 "Do not force GNU_SOURCE during build to fix #141" has broken support for CYGWIN.
The build hangs with this error message:

libssh-0.10.4/src/config.c: In function ‘local_parse_glob’:
libssh-0.10.4/src/config.c:252:25: error: ‘GLOB_TILDE’ undeclared (first use in this function)
  252 |     rt = glob(fileglob, GLOB_TILDE, NULL, &globbuf);
      |                         ^~~~~~~~~~

I think that it would be better to re-add it, by using target_compile_definitions() rather than target_compile_options(), which is more appropriate in my opinion.

Signed-off-by: Carlo Bramini carlo_bramini@users.sourceforge.net
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 37deed27d6)
This commit is contained in:
Carlo Bramini
2022-09-14 09:40:45 +00:00
committed by Andreas Schneider
parent 0d52be0f5b
commit 5d26b0967d

View File

@@ -348,6 +348,9 @@ endif (WITH_SYMBOL_VERSIONING AND HAVE_LD_VERSION_SCRIPT AND ABIMAP_FOUND)
# This gets built as a static library, if -DBUILD_SHARED_LIBS=OFF is passed to
# cmake.
add_library(ssh ${libssh_SRCS})
if (CYGWIN)
target_compile_definitions(ssh PRIVATE _GNU_SOURCE)
endif ()
target_include_directories(ssh
PUBLIC
$<BUILD_INTERFACE:${libssh_SOURCE_DIR}/include>
@@ -404,6 +407,9 @@ install(EXPORT libssh-config
if (BUILD_STATIC_LIB)
add_library(ssh-static STATIC ${libssh_SRCS})
if (CYGWIN)
target_compile_definitions(ssh-static PRIVATE _GNU_SOURCE)
endif ()
target_include_directories(ssh-static
PUBLIC