File: fix-git.patch

package info (click to toggle)
bpfilter 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,076 kB
  • sloc: ansic: 30,397; sh: 1,383; cpp: 959; python: 495; yacc: 385; lex: 194; makefile: 9
file content (24 lines) | stat: -rw-r--r-- 762 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Mark git as optional dependency

Author: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Forwarded: https://github.com/facebook/bpfilter/pull/319
Last-Update: 2025-09-02
---

diff --git a/tools/cmake/GitVersion.cmake b/tools/cmake/GitVersion.cmake
index d414d882..8ec04e7a 100644
--- a/tools/cmake/GitVersion.cmake
+++ b/tools/cmake/GitVersion.cmake
@@ -2,7 +2,11 @@
 # Copyright (c) 2023 Meta Platforms, Inc. and affiliates.
 
 function(get_version_from_git)
-    find_package(Git REQUIRED)
+    find_package(Git)
+    if (NOT Git_FOUND)
+        message(WARNING "Failed to find git, using default version ${DEFAULT_PROJECT_VERSION}")
+        return()
+    endif ()
 
     execute_process(
         COMMAND ${GIT_EXECUTABLE} describe --tags --always