protobuf/protobuf-24.3-upstream-fix-Protobuf_PROTOC_EXECUTABLE.patch

26 lines
944 B
Diff
Raw Permalink Normal View History

From 2e62ef1eaa2e712afc5f87aa2c55d478fe96230d Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Wed, 5 Jul 2023 13:03:11 +0200
Subject: [PATCH] Handle BUILD_TYPE=None in protobuf-module.cmake
Fixes Protobuf_PROTOC_EXECUTABLE being undefined in that case.
---
cmake/protobuf-module.cmake.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in
index 0bb05e38fad..e5b2b2e4b3a 100644
--- a/cmake/protobuf-module.cmake.in
+++ b/cmake/protobuf-module.cmake.in
@@ -153,6 +153,10 @@ if(NOT Protobuf_PROTOC_EXECUTABLE AND TARGET protobuf::protoc)
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_NOCONFIG)
endif()
+ if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+ IMPORTED_LOCATION_NONE)
+ endif()
endif()
# Version info variable