Skip to content

Commit

Permalink
Fix preprocessor definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers committed Aug 19, 2022
1 parent 55b5a59 commit 4c57244
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions recipes/gtest/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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()

Expand Down

0 comments on commit 4c57244

Please sign in to comment.