From 84ccc3e3411b6a7b26df33dd8db4a6f7c107beb7 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 3 Feb 2025 18:19:54 +0100 Subject: [PATCH] fuzzers|cmake: Check for working protobuf compiler --- expat/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 1e6dcdb7..d021e813 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -786,6 +786,14 @@ if(EXPAT_BUILD_FUZZERS) UPDATE_COMMAND true INSTALL_COMMAND true) + # Check for availability of protobuf compiler to avoid hard-to-understand + # errors from make(1) down the line as seen with CMake 3.25.1 on Debian + if(NOT Protobuf_PROTOC_EXECUTABLE) + message(SEND_ERROR + "The protobuf compiler (protoc) could not be found. " + "Is it installed and working properly?") + endif() + protobuf_generate_cpp(XML_LPM_FUZZER_PROTO_SRCS XML_LPM_FUZZER_PROTO_HDRS fuzz/xml_lpm_fuzzer.proto)