diff --git a/recipes/imath/all/conanfile.py b/recipes/imath/all/conanfile.py index 79c783b58dc0a..ca052909386af 100644 --- a/recipes/imath/all/conanfile.py +++ b/recipes/imath/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import collect_libs, copy, get, rmdir +from conan.tools.microsoft import is_msvc import os required_conan_version = ">=1.53.0" @@ -49,6 +50,10 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + if is_msvc(self) and self.settings.compiler.get_safe("cppstd"): + # when msvc is working with a C++ standard level higher + # than the default, we need the __cplusplus macro to be correct + tc.variables["CMAKE_CXX_FLAGS"] = "/Zc:__cplusplus" tc.generate() def build(self):