What is the most idiomatic way to find Windows SDK tools? #7647
Unanswered
usernameak
asked this question in
Q&A
Replies: 2 comments 2 replies
This involves just a small snippet of code; why is your implementation so complex? |
1 reply
|
I don't have a Windows environment, but opt.envs should contain vs envs if it's compiled for the Windows platform. xmake f -c
xmake -rvyou can debug it. xmake/xmake/toolchains/msvc/load.lua Line 53 in ee1256b xmake/xmake/core/tool/toolchain.lua Line 587 in ee1256b |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What is the most idiomatic way to find Windows SDK tools? Right now I am doing this:
However, this seems very verbose (and is duplicating a lot of code from xmake's own codebase - this is derived from https://github.com/xmake-io/xmake/blob/master/xmake/modules/detect/tools/find_midl.lua code). Besides, xmake itself doesn't seem to have consistent behavior around this -
find_midlandfind_rcdo it throughenv(which doesn't always seem to work), andfind_dxcdoes something else. Whatever I wrote here seems to be the most reliable way regardless of the environment. Though DXC is a special case because you generally don't want the one from Windows SDK if another version from a different source exists, as the Windows SDK version is generally somewhat outdated. This does not, however, apply to FXC, as that tool only appears in Windows SDK currently (as well as the legacy DirectX SDK, but that one is deprecated).Just directly calling find_program without preparing paths doesn't work very well -- it expects Windows SDK to be in the user's PATH (which it might not be if
xmakeis not invoked from VC developer command prompt).What is the best way to do this?
also:
private.utils.toolchainseems to have a lot of nice tools for toolchain detection, but it's not a public API unfortunately...All reactions