Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 1 | From 3d20210d84f61ee2189927e2d9de9ce3e5a0a9c5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Matteo Croce <mcroce@microsoft.com> |
| 3 | Date: Mon, 20 Sep 2021 18:44:52 +0200 |
| 4 | Subject: [PATCH] CMakeList.txt: Don't download libbpf source when system |
| 5 | library is used |
| 6 | |
| 7 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=3d20210d84f61ee2189927e2d9de9ce3e5a0a9c5] |
| 8 | |
| 9 | The build system always download the libbpf submodule, regardless if |
| 10 | we're using the embedded or the system version. |
| 11 | Download the libbpf source only if we're using the embedded one. |
| 12 | |
| 13 | Signed-off-by: Matteo Croce <mcroce@microsoft.com> |
| 14 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
| 15 | --- |
| 16 | CMakeLists.txt | 2 +- |
| 17 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 18 | |
| 19 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 20 | index 8523bce..2ab66e4 100644 |
| 21 | --- a/CMakeLists.txt |
| 22 | +++ b/CMakeLists.txt |
| 23 | @@ -65,7 +65,7 @@ find_package(Python3 QUIET) |
| 24 | |
| 25 | # make sure git submodule(s) are checked out |
| 26 | find_package(Git QUIET) |
| 27 | -if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") |
| 28 | +if(LIBBPF_EMBEDDED AND GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") |
| 29 | # Update submodules as needed |
| 30 | option(GIT_SUBMODULE "Check submodules during build" ON) |
| 31 | if(GIT_SUBMODULE) |
| 32 | -- |
| 33 | 2.31.1 |
| 34 | |