Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[boost] For Visual Studio, pass some values of settings.compiler.toolset to B2 #5119

Merged
merged 4 commits into from
Oct 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from conans.errors import ConanInvalidConfiguration
import glob
import os
import re
import sys
import shlex
import shutil
Expand Down Expand Up @@ -814,7 +815,10 @@ def build(self):
full_command += ' --debug-configuration --build-dir="%s"' % self.build_folder
self.output.warn(full_command)

with tools.vcvars(self.settings) if self._is_msvc else tools.no_op():
# If sending a user-specified toolset to B2, setting the vcvars
# interferes with the compiler selection.
use_vcvars = self._is_msvc and not self.settings.compiler.get_safe("toolset", default="")
with tools.vcvars(self.settings) if use_vcvars else tools.no_op():
with tools.chdir(sources):
# To show the libraries *1
# self.run("%s --show-libraries" % b2_exe)
Expand Down Expand Up @@ -1224,13 +1228,10 @@ def create_library_config(deps_name, name):
@property
def _toolset_version(self):
if self._is_msvc:
compiler_version = str(self.settings.compiler.version)
if Version(compiler_version) >= "16":
return "14.2"
elif Version(compiler_version) >= "15":
return "14.1"
else:
return "%s.0" % compiler_version
toolset = tools.msvs_toolset(self)
match = re.match(r'v(\d+)(\d)$', toolset)
if match:
return "%s.%s" % (match.group(1), match.group(2))
return ""

@property
Expand Down