mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/protozero: fix build with clang-tidy
Fix the following build failure if clang-tidy is found on host (and protobuf is built before protozero) which is raised since tests are disabled in commitbe4869f393: CMake Error at CMakeLists.txt:77 (add_dependencies): The dependency target "writer_tests" of target "clang-tidy" does not exist. Fixes: - http://autobuild.buildroot.org/results/c3ae3b5caf79eb30c8a1786f58abea4f2b41a26e Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> (cherry picked from commite54b82306d) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
a28617d676
commit
90d633e632
@@ -0,0 +1,35 @@
|
|||||||
|
From 1c16d3ffccd9e415c6ea3681f23231cd5184043c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||||
|
Date: Wed, 16 Feb 2022 00:11:38 +0100
|
||||||
|
Subject: [PATCH] CMakeLists.txt: protobuf is only needed for tests
|
||||||
|
|
||||||
|
Don't check for protobuf if tests are disabled. As a side effect, this
|
||||||
|
will avoid a build failure if clang-tidy and protobuf are found but
|
||||||
|
tests are disabled
|
||||||
|
|
||||||
|
Fix #109
|
||||||
|
|
||||||
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||||
|
[Upstream status: https://github.com/mapbox/protozero/pull/110]
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index b975d49..df2ca15 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -52,7 +52,9 @@ endif()
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-find_package(Protobuf)
|
||||||
|
+if(BUILD_TESTING)
|
||||||
|
+ find_package(Protobuf)
|
||||||
|
+endif()
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user