summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorEdward Thomson <edward.thomson@vercel.com>2023-02-15 10:26:50 +0000
committerEdward Thomson <ethomson@vercel.com>2023-03-03 09:45:12 +0000
commit462dbe21d0edc3817d53900702e68d666c303600 (patch)
tree379edf4f3e33344aad40170f66a7bb23dcf0258c /cmake
parentaf12fc11c520b58fe548a5ff736812462c269685 (diff)
downloadlibgit2-462dbe21d0edc3817d53900702e68d666c303600.tar.gz
xdiff: move xdiff to 'deps'
xdiff is a dependency (from git core) and more properly belongs in the 'deps' directory. Move it there, and add a stub for cmake to resolve xdiff from the system location in the future. (At present, bundled xdiff remains hardcoded.)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SelectXdiff.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/SelectXdiff.cmake b/cmake/SelectXdiff.cmake
new file mode 100644
index 000000000..9ab9f3f4f
--- /dev/null
+++ b/cmake/SelectXdiff.cmake
@@ -0,0 +1,9 @@
+# Optional external dependency: xdiff
+if(USE_XDIFF STREQUAL "system")
+ message(FATAL_ERROR "external/system xdiff is not yet supported")
+else()
+ add_subdirectory("${PROJECT_SOURCE_DIR}/deps/xdiff" "${PROJECT_BINARY_DIR}/deps/xdiff")
+ list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/xdiff")
+ list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:xdiff>")
+ add_feature_info(xdiff ON "xdiff support (bundled)")
+endif()