

This could be an additional parameter of the Kit (like "visualStudioArchitecture") but controlling the SDK version that is passed to vcvarsall.bat as its 3rd (or 2nd if no platform type is specified) argument, maybe something like "visualStudioWinSDKVersion". Contribute to rpavlik/cmake-modules development by creating an account on GitHub.

So at this point I might as well get rid of the MSVC specific setup (using vcvars) and create the whole environment, replicating the result of calling vcvars with the correct option.Īfter looking at this in more details, maybe I'm missing something but I've come to the conclusion that the proper way of doing this would be to pass the windows SDK version as a parameter to vcvarsall.bat as it's intended to work that way. The Windows SDK (1) for Windows 11, Version 22H2 provides the latest headers, libraries, metadata, and tools for building Windows applications. However this seems like in internal variable, subject to change, and feels kind of hackish to me.īeing able to override the environment variables set by the script, as you mentioned, could be an idea but the SDK version is present in many variables and highly intertwined with the toolset version etc. Returning to the problem at hand, after some digging in the scripts, I found another environment variable that I could set prior to calling vcvars to control the windows SDK version: _VSCMD_ARG_WINSDK. Maybe you guys have more insights into this than I do.
#CMAKE WINDOWS SDK TRIAL#
I have no idea why this works in Visual Studio as this seems to be a totally undocumented and maybe unintended "feature" which I just happened to find by trial and error. Now I truly don't understand how my settings work in Visual Studio 2019 since having WindowsSDKVersion=8.1 in my CMakeSettings.json correctly sets all environment variables to the 8.1 SDK as if I'd passed the correct option to vcvars This led me to (incorrectly) believe that setting the environment variable before calling the script should work. As you said the script overrides any previously set value of WindowsSDKVersion. I've made some more tests on my side today to better understand how the Windows SDK version can be controlled when running vcvars.

#CMAKE WINDOWS SDK INSTALL#
Hi Bob, sorry for the late reply I was out-of-office last week. Prerequisites Set up your dev kit on a Windows PC Install the Azure Sphere SDK Install Visual Studio and the Azure Sphere extension Next steps To start using an Azure Sphere dev kit on Windows, you need to set up the dev kit, install the SDK, and install any additional software required for your development environment.
