CMakeList.txt: Don't download libbpf source when system library is used

The build system always download the libbpf submodule, regardless if
we're using the embedded or the system version.
Download the libbpf source only if we're using the embedded one.

Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Matteo Croce 2021-09-20 18:44:52 +02:00 committed by Arnaldo Carvalho de Melo
parent 38fad22d66
commit 3d20210d84
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ find_package(Python3 QUIET)
# make sure git submodule(s) are checked out
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
if(LIBBPF_EMBEDDED AND GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Update submodules as needed
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)