Skip to content

Commit

Permalink
- expose msvs_toolset
Browse files Browse the repository at this point in the history
Signed-off-by: SSE4 <tomskside@gmail.com>
  • Loading branch information
SSE4 committed Jun 2, 2020
1 parent a9a81ae commit 2eea438
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conans/client/build/msbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_command(self, project_file, props_file_path=None, targets=None, upgrade_
build_type = build_type or self._settings.get_safe("build_type")
arch = arch or self._settings.get_safe("arch")
if toolset is None: # False value to skip adjusting
toolset = tools.msvs_toolset(self._settings)
toolset = tools.msvs_toolset(self._conanfile)
verbosity = os.getenv("CONAN_MSBUILD_VERBOSITY") or verbosity or "minimal"
if not build_type:
raise ConanException("Cannot build_sln_command, build_type not defined")
Expand Down
7 changes: 6 additions & 1 deletion conans/client/tools/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ def latest_vs_version_installed(output):
"v80": "8"}


def msvs_toolset(settings):
def msvs_toolset(conanfile):
from conans.model.conan_file import ConanFile
if isinstance(conanfile, ConanFile):
settings = conanfile.settings
else:
settings = conanfile
toolset = settings.get_safe("compiler.toolset")
if not toolset:
vs_version = settings.get_safe("compiler.version")
Expand Down
1 change: 1 addition & 0 deletions conans/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def __init__(self, *args, **kwargs):
SFU = tools_win.SFU
unix_path = tools_win.unix_path
run_in_windows_bash = tools_win.run_in_windows_bash
msvs_toolset = tools_win.msvs_toolset


@contextmanager
Expand Down

0 comments on commit 2eea438

Please sign in to comment.