Skip to content
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

fix detection strategy for MSVC/VS2017+ #228

Merged
merged 2 commits into from
Oct 14, 2018
Merged

Conversation

rivy
Copy link
Contributor

@rivy rivy commented Oct 14, 2018

fix detection strategy for MSVC/VS2017+

Discussion

MSVC/VS versions >= 15.0 will no longer be setting registry entries for tool location purposes. But vswhere (included with MSVC/VS versions >= 15.2, and placed in a guaranteed location) can instead be used to find the needed path.

os.runv(...) is used as the tool to gather vswhere output instead of ($shell ...) in order to avoid some ($shell ...) limitations. Commands containing white space and/or special characters (eg, '[', ')') are difficult or impossible to pass through the current ($shell ...) implementation, causing application exceptions. Both white space and the noted special characters are needed to construct the required vswhere command.

ref: https://github.com/Microsoft/vswhere/blob/master/README.md @@ https://archive.is/mEmdu

* fixes the MSVC/VS 2017 detection problem discussed within <xmake-io#225>

.# Discussion

MSVC/VS versions >= 15.0 will no longer be setting registry entries for tool location
purposes. But `vswhere` (included with MSVC/VS versions >= 15.2, and placed in a
guaranteed location) can instead be used to find the needed path.

`os.runv(...)` is used as the tool to gather `vswhere` output instead of `($shell ...)`
in order to avoid some `($shell ...)` limitations. Commands containing white space and/or
special characters (eg, '[', ')') are difficult or impossible to pass through the current
`($shell ...)` implementation, causing application exceptions. Both white space and the
noted special characters are needed to construct the required `vswhere` command.

ref: <https://github.com/Microsoft/vswhere/blob/master/README.md> @@ <https://archive.is/mEmdu>
@waruqi waruqi merged commit dc71ced into xmake-io:dev Oct 14, 2018
@waruqi
Copy link
Member

waruqi commented Oct 14, 2018

Thanks! 👍

@rivy rivy deleted the fix.find_vstudio branch October 15, 2018 02:50
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.

2 participants