-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for settable VS_INSTALLATION_PATH - enabling eWDK #74
Conversation
You can now use the EWDK to build with this toolchain instead of a pre-installed VS version.
Updated to fix an issue with the github actions windows environment used for testing. |
Thanks for the contribution, @kaloth, but I'm a bit conflicted. To use the EWDK you have to run - say - 'C:\EWDK\BuildEnv\SetupBuildEnv.cmd', which sets/updates a bunch of environment variables to implicitly configure the compiler. That's what this Toolchain is trying to avoid - I don't like having to launch a Visual Studio Developer Prompt to build, since the compiler toolchain is described in the environment and not in the CMake domain. |
Hey, @MarkSchofield. Thanks for taking a look at the change. I think I understand your point but I remain hopefull that this could go in as it's so trivial. Sadly there's no cmake-friendly way to search for the EWDK automatically as the user is free to install it anywhere they like and there's no registry entries or anything to check. A user could even have multiple EWDKs in different folders scattered around their system. If you dislike the environment variable check I can remove that and have the user specify CMAKE_WINDOWS_KITS_10_DIR in the cmake command? That would keep it more in-line with the existing code. |
I left a couple of comments. One thing that makes me nervous is that when launching an eWDK prompt, it sets the host and target - if I launch a prompt it sets environment variables that appear to default to an x86 host and an x86 target. If WindowsToolchain defaults to a x64 target, then the linker would be provided with a mix of paths for the two architectures. I think that:
I wonder if the Toolchain should also defer the to eWDK's environment for |
I've had an idea. At the minute this PR does a couple of things;
If this change were to just scope to (2) - i.e. ensure that |
Hey! Just read your last comment and I totally agree! I'll drop the environment stuff entirely and focus on the ability to manually override VS_INSTALLATION_PATH. That should keep things simple. |
This avoids situations where WindowsSdkDir is set in the environment but we want to select a specific version via the pre-existing mechanisms in thie toolchain. It's better to require EWDK users to explicitly state what they want by setting CMAKE_WINDOWS_KITS_10_DIR via cmake cache vars on the commandline.
With these changes it's now possible to use the EWDK to build with this toolchain instead of a pre-installed VS version.
To use the EWDK follow the following steps..
This was nessecary for my use case where I'm building a Windows driver project on an automated remote VM with no pre-existing visual studio installation.
Hopefully it's useful to someone else here!