0001-CMakeLists.txt-protobuf-is-only-needed-for-tests.patch 1005 B

1234567891011121314151617181920212223242526272829303132333435
  1. From 1c16d3ffccd9e415c6ea3681f23231cd5184043c Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 16 Feb 2022 00:11:38 +0100
  4. Subject: [PATCH] CMakeLists.txt: protobuf is only needed for tests
  5. Don't check for protobuf if tests are disabled. As a side effect, this
  6. will avoid a build failure if clang-tidy and protobuf are found but
  7. tests are disabled
  8. Fix #109
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. [Upstream status: https://github.com/mapbox/protozero/pull/110]
  11. ---
  12. CMakeLists.txt | 4 +++-
  13. 1 file changed, 3 insertions(+), 1 deletion(-)
  14. diff --git a/CMakeLists.txt b/CMakeLists.txt
  15. index b975d49..df2ca15 100644
  16. --- a/CMakeLists.txt
  17. +++ b/CMakeLists.txt
  18. @@ -52,7 +52,9 @@ endif()
  19. #
  20. #-----------------------------------------------------------------------------
  21. -find_package(Protobuf)
  22. +if(BUILD_TESTING)
  23. + find_package(Protobuf)
  24. +endif()
  25. #-----------------------------------------------------------------------------
  26. --
  27. 2.34.1