Skip to content

Commit

Permalink
protobuf: use is_msvc_static_runtime()
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jan 17, 2024
1 parent 1a253a3 commit b0e6e09
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions recipes/protobuf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.files import copy, rename, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir, rm
from conan.tools.microsoft import msvc_runtime_flag, is_msvc, is_msvc_static_runtime
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
from conan.tools.scm import Version

import os
Expand Down Expand Up @@ -124,10 +124,7 @@ def generate(self):
tc.cache_variables["protobuf_BUILD_LIBPROTOC"] = self.settings.os != "tvOS"
tc.cache_variables["protobuf_DISABLE_RTTI"] = not self.options.with_rtti
if is_msvc(self) or self._is_clang_cl:
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
tc.cache_variables["protobuf_MSVC_STATIC_RUNTIME"] = is_msvc_static_runtime(self)
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"
Expand Down

0 comments on commit b0e6e09

Please sign in to comment.