Skip to content

Commit b08fe71

Browse files
committed
cmake: export libraries needed to compile against libgit2
If users are using us as a direct dependency (via `add_subdirectory`) then they may want to know the libraries to link to; tell them.
1 parent 1327dbc commit b08fe71

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ if(BUILD_FUZZERS)
131131
endif()
132132

133133

134+
# Export for people who use us as a dependency
135+
136+
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
137+
set(LIBGIT2_DEPENDENCY_OBJECTS ${LIBGIT2_DEPENDENCY_OBJECTS} PARENT_SCOPE)
138+
set(LIBGIT2_SYSTEM_LIBS ${LIBGIT2_SYSTEM_LIBS} PARENT_SCOPE)
139+
endif()
140+
141+
134142
# Summary
135143

136144
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")

0 commit comments

Comments
 (0)