-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake ignores Cflags.private #14641
Labels
Comments
Yeah, the Find modules (including those with not-only-hint support for FindGSS is the only one which does. Something to be implemented. |
@Andarwinux Can you make a test if this patch improves things for you?: --- a/CMake/FindLibssh.cmake
+++ b/CMake/FindLibssh.cmake
@@ -33,6 +33,8 @@
# LIBSSH_FOUND System has libssh
# LIBSSH_INCLUDE_DIRS The libssh include directories
# LIBSSH_LIBRARIES The libssh library names
+# LIBSSH_LIBRARY_DIRS The libssh library directories
+# LIBSSH_CFLAGS Required compiler flags
# LIBSSH_VERSION Version of libssh
if(CURL_USE_PKGCONFIG AND
@@ -43,10 +45,7 @@ if(CURL_USE_PKGCONFIG AND
endif()
if(LIBSSH_FOUND)
- if(NOT DEFINED LIBSSH_LINK_LIBRARIES)
- set(LIBSSH_LINK_LIBRARIES ${LIBSSH_LIBRARIES}) # Workaround for some systems (seen on Old Linux CI)
- endif()
- set(LIBSSH_LIBRARIES ${LIBSSH_LINK_LIBRARIES})
+ string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (Found version \"${LIBSSH_VERSION}\")")
else()
find_path(LIBSSH_INCLUDE_DIR NAMES "libssh/libssh.h")
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1071,6 +1071,10 @@ if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
list(APPEND CURL_LIBS ${LIBSSH_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh")
include_directories(${LIBSSH_INCLUDE_DIRS})
+ link_directories(${LIBSSH_LIBRARY_DIRS})
+ if(LIBSSH_CFLAGS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBSSH_CFLAGS}")
+ endif()
set(USE_LIBSSH ON)
endif()
endif() |
Yeah, that fixes the build. |
I'll make this a PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did this
build curl with cmake -DCURL_USE_PKGCONFIG=ON
I expected the following
curl cmake should apply
Cflags.private: -DLIBSSH_STATIC
from dependency pkgconfig (libssh.pc), but it doesn't, causing the build to fail.curl/libcurl version
master
operating system
linux
The text was updated successfully, but these errors were encountered: