Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ conan.conf
#Generated certificate file
cacert.pem

#linux backup files
#linux backup and vim files
*~
.*.swp
.*.sw?
Session.vim

#Pyinstaller generated binaries
/pyinstaller
Expand Down
5 changes: 5 additions & 0 deletions conan/tools/microsoft/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ def vcvars_arch(conanfile):
'x86_64': 'x86_amd64',
'armv7': 'x86_arm',
'armv8': 'x86_arm64'}.get(arch_host)
elif arch_build == 'armv8':
arch = {'x86': 'arm64_x86',
'x86_64': 'arm64_x64',
'armv7': 'arm64_arm',
'armv8': 'arm64'}.get(arch_host)

if not arch:
raise ConanException('vcvars unsupported architectures %s-%s' % (arch_build, arch_host))
Expand Down
5 changes: 5 additions & 0 deletions conans/client/tools/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,11 @@ def vcvars_command(conanfile=None, arch=None, compiler_version=None, force=False
'x86_64': 'x86_amd64',
'armv7': 'x86_arm',
'armv8': 'x86_arm64'}.get(arch_setting)
elif arch_build == 'armv8':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is modifying only the legacy tool from conans
This should be done as a secondary thing, as a backport, but this should be addressed first in from conan space.

Also some unittest would be necessary, please ask for guidance if you need it.
Thanks for contributing to Conan!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pointers. I've added the same code also for non-legacy from conan.

I've also updated the only unit test I found that deals with testing the vcvars, but it also works with the legacy from conans. Also, how to run just this single test? I've run python3 -m tox -e full as described in the documentation and more than 1400 tests have failed, most of them completely unrelated to my change. Are they supposed to fail?

vcvars_arch = {'x86': 'arm64_x86',
'x86_64': 'arm64_x64',
'armv7': 'arm64_arm',
'armv8': 'arm64'}.get(arch_setting)

if not vcvars_arch:
raise ConanException('unsupported architecture %s' % arch_setting)
Expand Down
11 changes: 11 additions & 0 deletions conans/test/functional/tools/old/vcvars/vcvars_arch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ def test_arch(self):
settings.arch = 'x86'
self.assert_vcvars_command(settings, "amd64_x86")

settings.arch_build = 'armv8'
settings.arch = 'armv8'

self.assert_vcvars_command(settings, "arm64")

settings.arch = 'x86'
self.assert_vcvars_command(settings, "arm64_x86")

settings.arch = 'x86_64'
self.assert_vcvars_command(settings, "arm64_x64")

def test_arch_override(self):
settings = Settings.loads(get_default_settings_yml())
settings.compiler = 'Visual Studio'
Expand Down