From e93ae0a00a3a0ba5a9f09de4f77158bca63f9c49 Mon Sep 17 00:00:00 2001 From: Siyuan Ren Date: Wed, 14 Feb 2024 13:33:23 +0800 Subject: [PATCH] Fix protobuf compilation under MSYS2 Building protobuf on MSYS2 fails on the line 100. Apparently the conan detection of `is_msvc` and `is_clang_cl` is flawed. Work around this by guarding the statement. --- recipes/protobuf/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/protobuf/all/conanfile.py b/recipes/protobuf/all/conanfile.py index f696a27880684..e54d3c70c0314 100644 --- a/recipes/protobuf/all/conanfile.py +++ b/recipes/protobuf/all/conanfile.py @@ -97,7 +97,8 @@ def generate(self): runtime = msvc_runtime_flag(self) if not runtime: runtime = self.settings.get_safe("compiler.runtime") - tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime + if runtime: + tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in runtime if is_apple_os(self) and self.options.shared: # Workaround against SIP on macOS for consumers while invoking protoc when protobuf lib is shared tc.variables["CMAKE_INSTALL_RPATH"] = "@loader_path/../lib"