File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,6 @@ IF(DEBUG_POOL)
33ENDIF ()
44ADD_FEATURE_INFO(debugpool GIT_DEBUG_POOL "debug pool allocator" )
55
6- # Add the features.h file as a dummy. This is required for Xcode
7- # to successfully build the libgit2 library when using only
8- # object libraries.
9- SET (LIBGIT2_OBJECTS "${CMAKE_CURRENT_BINARY_DIR} /git2/sys/features.h" )
10-
116# This variable will contain the libraries we need to put into
127# libgit2.pc's Requires.private. That is, what we're linking to or
138# what someone who's statically linking us needs to link to.
@@ -404,6 +399,13 @@ SET(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
404399SET (LIBGIT2_LIBS ${LIBGIT2_LIBS} PARENT_SCOPE)
405400SET (LIBGIT2_LIBDIRS ${LIBGIT2_LIBDIRS} PARENT_SCOPE)
406401
402+ IF (XCODE_VERSION )
403+ # This is required for Xcode to actually link the libgit2 library
404+ # when using only object libraries.
405+ FILE (WRITE ${CMAKE_CURRENT_BINARY_DIR} /dummy.c "" )
406+ LIST (APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR} /dummy.c)
407+ ENDIF ()
408+
407409# Compile and link libgit2
408410LINK_DIRECTORIES (${LIBGIT2_LIBDIRS} )
409411ADD_LIBRARY (git2 ${WIN_RC} ${LIBGIT2_OBJECTS} )
You can’t perform that action at this time.
0 commit comments