conan.tools.microsoft.visual

check_min_vs

check_min_vs(conanfile, version)

This is a helper method to allow the migration of 1.X -> 2.0 and VisualStudio -> msvc settings without breaking recipes. The legacy “Visual Studio” with different toolset is not managed, not worth the complexity.

Parameters:
  • conanfile< ConanFile object > The current recipe object. Always use self.
  • versionstr Visual Studio or msvc version number.

Example:

def validate(self):
    check_min_vs(self, "192")

msvc_runtime_flag

msvc_runtime_flag(conanfile)

Gets the MSVC runtime flag given the compiler.runtime value from the settings.

Parameters:conanfile< ConanFile object > The current recipe object. Always use self.
Returns:str runtime flag.

is_msvc

is_msvc(conanfile, build_context=False)

Validates if the current compiler is msvc.

Parameters:
  • conanfile< ConanFile object > The current recipe object. Always use self.
  • build_context – If True, will use the settings from the build context, not host ones
Returns:

bool True, if the host compiler is msvc, otherwise, False.

is_msvc_static_runtime

is_msvc_static_runtime(conanfile)

Validates when building with Visual Studio or msvc and MT on runtime.

Parameters:conanfile< ConanFile object > The current recipe object. Always use self.
Returns:bool True, if msvc + runtime MT. Otherwise, False.

conan.tools.microsoft.subsystems

unix_path

unix_path(conanfile, path, scope='build')