summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:47:08 +0000
commit29b5ab554790bb57337a3b6ab9dcd963cf69d22e (patch)
treebe1456d2bc6c1fb078695fad7bc8f6b212062d3c /examples/CMakeLists.txt
parentInitial commit. (diff)
downloadlibgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.tar.xz
libgit2-29b5ab554790bb57337a3b6ab9dcd963cf69d22e.zip
Adding upstream version 1.7.2+ds.upstream/1.7.2+ds
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r--examples/CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
new file mode 100644
index 0000000..8e38c7d
--- /dev/null
+++ b/examples/CMakeLists.txt
@@ -0,0 +1,18 @@
+# examples: code usage examples of libgit2
+
+file(GLOB SRC_EXAMPLES *.c *.h)
+
+add_executable(lg2 ${SRC_EXAMPLES})
+set_target_properties(lg2 PROPERTIES C_STANDARD 90)
+
+# Ensure that we do not use deprecated functions internally
+add_definitions(-DGIT_DEPRECATE_HARD)
+
+target_include_directories(lg2 PRIVATE ${LIBGIT2_INCLUDES} ${LIBGIT2_DEPENDENCY_INCLUDES})
+target_include_directories(lg2 SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
+
+if(WIN32 OR ANDROID)
+ target_link_libraries(lg2 libgit2package)
+else()
+ target_link_libraries(lg2 libgit2package pthread)
+endif()