From 4c572445b62b189c66f2d5bc3edff18ac5ab06ba Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 19 Aug 2022 17:31:43 -0500 Subject: [PATCH] Fix preprocessor definitions --- recipes/gtest/all/test_package/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/gtest/all/test_package/conanfile.py b/recipes/gtest/all/test_package/conanfile.py index 5bc0861f3f7c3..7e7b3f4ebb387 100644 --- a/recipes/gtest/all/test_package/conanfile.py +++ b/recipes/gtest/all/test_package/conanfile.py @@ -1,8 +1,8 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain class TestPackageConan(ConanFile): @@ -20,11 +20,11 @@ def generate(self): with_gmock = bool(self.dependencies[self.tested_reference_str].options.build_gmock) tc.cache_variables['WITH_GMOCK'] = with_gmock - tc.preprocessor_definitions['WITH_GMOCK'] = with_gmock + tc.preprocessor_definitions['WITH_GMOCK'] = 1 if with_gmock else 0 with_main = not self.dependencies[self.tested_reference_str].options.no_main tc.cache_variables['WITH_MAIN'] = with_main - tc.preprocessor_definitions['WITH_MAIN'] = with_main + tc.preprocessor_definitions['WITH_MAIN'] = 1 if with_main else 0 tc.generate()