Skip to content

Conversation

@ankurvdev
Copy link

Support msvc(portable) by using a separate triplet that avoid a vswhere based search by specifying set(VCPKG_CMAKE_SYSTEM_NAME "Windows")
in the triplet file.

Support msvc(portable) by using a separate triplet that avoid a `vswhere` based search by specifying
`set(VCPKG_CMAKE_SYSTEM_NAME "Windows")`
in the triplet file.
@ankurvdev
Copy link
Author

@BillyONeal . Can you please review and start a build ?

@BillyONeal
Copy link
Member

Can you describe what this fixes? Empty string == Windows has been widespread CMake behavior for a long time.

@ankurvdev
Copy link
Author

ankurvdev commented Nov 3, 2025

The scenario here is probably a little unofficial but I'm using portable-msvc method to download the vs header, libraries and toolchains without actually installing visual studio
There's lots of instructions that explain how to do that like these
https://github.com/Data-Oriented-House/PortableBuildTools
https://gist.github.com/mmozeiko/7f3162ec2988e81e56d5c4e22cde9977
I have my own little python toolchain downloader here

The main benefit of this is that I don't need to install as admin and also helps avoid unnecessary cruft and I can pick and choose multiple versions SxS.
VSCode is easily able to pick it up using just the envvars and so it works for the most part.

The problem with vcpkg is that its actually not the empty == "windows" that is the problem. The issue is if its empty vcpkg-tool uses vswhere to determine where to find the VS installation and simply complains that I dont have visual studio installed.
In this scenario I dont have vswhere installed
Now if I actually pass "Windows" then it simply skips the vswhere detection and I am able to pass across envvars for the rest.

There might be a better way to do this but given that this was a cheap fix I figured I'd try to see if it'd be ok

@ankurvdev
Copy link
Author

To clarify my earlier comment its actually the filters not working that is the problem.
So some ports for eg will have dependencies that say !windows and without this the vcpkg-tool does not consider that platform to be windows when I use portable msvc

@Neumann-A
Copy link
Contributor

https://learn.microsoft.com/en-us/vcpkg/users/triplets#vcpkg_load_vcvars_env ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants