Skip to content

Commit

Permalink
Use toolchain variables instead of cache_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers committed Aug 22, 2022
1 parent ff11b2a commit 5a34721
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions recipes/gtest/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,20 @@ def generate(self):
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"

if self.settings.build_type == "Debug":
tc.cache_variables["CUSTOM_DEBUG_POSTFIX"] = str(self.options.debug_postfix)
tc.variables["CUSTOM_DEBUG_POSTFIX"] = str(self.options.debug_postfix)
if is_msvc(self) or self._is_clang_cl:
tc.cache_variables["gtest_force_shared_crt"] = "MD" in msvc_runtime_flag(self)
tc.variables["gtest_force_shared_crt"] = "MD" in msvc_runtime_flag(self)

try:
check_min_vs(self, "191")
except ConanInvalidConfiguration:
tc.preprocessor_definitions["GTEST_LANG_CXX11"] = 1
tc.preprocessor_definitions["GTEST_HAS_TR1_TUPLE"] = 0

tc.cache_variables["BUILD_GMOCK"] = bool(self.options.build_gmock)
tc.variables["BUILD_GMOCK"] = bool(self.options.build_gmock)
if self.settings.os == "Windows" and self.settings.compiler == "gcc":
tc.cache_variables["gtest_disable_pthreads"] = True
tc.cache_variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols)
tc.variables["gtest_disable_pthreads"] = True
tc.variables["gtest_hide_internal_symbols"] = bool(self.options.hide_symbols)
tc.generate()

def build(self):
Expand Down

0 comments on commit 5a34721

Please sign in to comment.