Skip to content

Commit 86f29e1

Browse files
authored
VCVars: Fix generation if OS is set to WindowsStore (#17849)
* Fix VCVars generate() for WindowsStore OS * Add newline at the end of file
1 parent 01f0eaa commit 86f29e1

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

conan/tools/microsoft/visual.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def generate(self, scope="build"):
117117
os_ = conanfile.settings.get_safe("os")
118118
build_os_ = conanfile.settings_build.get_safe("os")
119119

120-
if os_ != "Windows" or build_os_ != "Windows":
120+
if (os_ != "Windows" and os_ != "WindowsStore") or build_os_ != "Windows":
121121
return
122122

123123
compiler = conanfile.settings.get_safe("compiler")

test/integration/toolchains/microsoft/vcvars_test.py

+18
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,21 @@ class TestConan(ConanFile):
160160

161161
vcvars = client.load("conanvcvars.bat")
162162
assert 'vcvarsall.bat" amd64 -vcvars_ver=14.33' in vcvars
163+
164+
@pytest.mark.skipif(platform.system() != "Windows", reason="Requires Windows")
165+
def test_vcvars_armv8_windows_store():
166+
client = TestClient(path_with_spaces=False)
167+
168+
conanfile = textwrap.dedent("""
169+
from conan import ConanFile
170+
class TestConan(ConanFile):
171+
generators = "VCVars"
172+
settings = "os", "compiler", "arch", "build_type"
173+
""")
174+
client.save({"conanfile.py": conanfile})
175+
client.run('install . -s:b os=Windows -s compiler="msvc" -s compiler.version=194 '
176+
'-s compiler.cppstd=14 -s compiler.runtime=static -s:h arch=armv8 '
177+
'-s:h os=WindowsStore -s:h os.version=10.0')
178+
179+
vcvars = client.load("conanvcvars.bat")
180+
assert 'vcvarsall.bat" amd64_arm64' in vcvars

0 commit comments

Comments
 (0)