Skip to content

Commit a7e36d3

Browse files
authored
Merge pull request libgit2#4468 from libgit2/cmn/openssl-pc
Make sure to include 'openssl' as a dep when building statically with SHA1DC
2 parents ddd3651 + b21c540 commit a7e36d3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ IF (USE_HTTPS)
184184
LIST(APPEND LIBGIT2_INCLUDES ${OPENSSL_INCLUDE_DIR})
185185
LIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})
186186
LIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})
187+
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
187188
ELSEIF (HTTPS_BACKEND STREQUAL "WinHTTP")
188189
# WinHTTP setup was handled in the WinHTTP-specific block above
189190
ELSE()
@@ -210,7 +211,7 @@ IF(SHA1_BACKEND STREQUAL "OpenSSL")
210211
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
211212
LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
212213
ELSE()
213-
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
214+
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
214215
ENDIF()
215216
ELSEIF(SHA1_BACKEND STREQUAL "CollisionDetection")
216217
ADD_FEATURE_INFO(SHA ON "using CollisionDetection")
@@ -265,7 +266,7 @@ IF(NOT USE_BUNDLED_ZLIB)
265266
LIST(APPEND LIBGIT2_LIBS "z")
266267
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
267268
ELSE()
268-
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
269+
LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
269270
ENDIF()
270271
ADD_FEATURE_INFO(zlib ON "using system zlib")
271272
ELSE()
@@ -439,6 +440,9 @@ IF (SONAME)
439440
SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
440441
ENDIF()
441442
ENDIF()
443+
444+
LIST(REMOVE_DUPLICATES LIBGIT2_PC_REQUIRES)
445+
STRING(REPLACE ";" " " LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES}")
442446
STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")
443447
CONFIGURE_FILE(${libgit2_SOURCE_DIR}/libgit2.pc.in ${libgit2_BINARY_DIR}/libgit2.pc @ONLY)
444448

0 commit comments

Comments
 (0)