Skip to content

Commit b85548e

Browse files
committed
cmake: treat LIBGIT2_PC_REQUIRES as a list
It is indeed a list of dependencies for those which include the static archive. This is in preparation for adding two possible places where we might add openssl as a dependency.
1 parent ddd3651 commit b85548e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ IF(SHA1_BACKEND STREQUAL "OpenSSL")
210210
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
211211
LIST(APPEND LIBGIT2_PC_LIBS "-lssl")
212212
ELSE()
213-
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl")
213+
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
214214
ENDIF()
215215
ELSEIF(SHA1_BACKEND STREQUAL "CollisionDetection")
216216
ADD_FEATURE_INFO(SHA ON "using CollisionDetection")
@@ -265,7 +265,7 @@ IF(NOT USE_BUNDLED_ZLIB)
265265
LIST(APPEND LIBGIT2_LIBS "z")
266266
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
267267
ELSE()
268-
SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib")
268+
LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
269269
ENDIF()
270270
ADD_FEATURE_INFO(zlib ON "using system zlib")
271271
ELSE()
@@ -439,6 +439,9 @@ IF (SONAME)
439439
SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
440440
ENDIF()
441441
ENDIF()
442+
443+
LIST(REMOVE_DUPLICATES LIBGIT2_PC_REQUIRES)
444+
STRING(REPLACE ";" " " LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES}")
442445
STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}")
443446
CONFIGURE_FILE(${libgit2_SOURCE_DIR}/libgit2.pc.in ${libgit2_BINARY_DIR}/libgit2.pc @ONLY)
444447

0 commit comments

Comments
 (0)