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

Enable Visual Studio 2019 build by default #3138

Merged
merged 8 commits into from Sep 18, 2020
Merged

Conversation

hekota
Copy link
Member

@hekota hekota commented Sep 16, 2020

This PR is switching the default build of DXC to Visual Studio 2019.
The build script hctbuild.cmd will error when VS2019 is not installed. Use -vs2017 option to build with VS2017.
VS2015 is no longer supported.

Removes cmake version checking from hctstart.cmd
Fixes cmake detection in Visual Studio installations
Fixes DIA SDK lookup - use CMAKE_GENERATOR to detect VS version used and select the corresponding DIA SDK
Use environment variable instead of c:\Program Files

Fix cmake detection from Visual Studio installations (cmake.exe on PATH always takes precedence)
Use CMAKE_GENERATOR to detect VS version used and select the corresponding DIA SDK
Fix c:\Program Files paths to use environment variable
Copy link
Member

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a welcome improvement that does all it says it does. I've added some comments about other things that you may choose to do now or not. With or without those changes, I think this is ready to go.

OUTPUT_VARIABLE VSWHERE_LATEST
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Find the DIA SDK path, it will typically look something like this.
# C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\DIA SDK\include
# C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\DIA SDK\include
# C:\Program Files (x86)\Microsoft Visual Studio 14.0\DIA SDK\include
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the removal of the top two comments and leaving the others made in error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

rem If only VS 2019 is available, pick that by default.
if "%BUILD_VS_VER%"=="2017" (
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2017" (
echo Visual Studio 2017 not available, setting up build for Visual Studio 2019.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this results from a user specifying 2017, it might be more accurate to say "trying to set up build" since it might well fail since they might have specified 2017 since they don't have 2019.

I'm not sure I would find this behavior helpful. Covertly getting 2019 when I specified 2017 might confuse and ultimately frustrate me more than being told it wasn't available and I'd have to use 2019.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll fix that.


if "%BUILD_VS_VER%"=="2019" (
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019" (
echo Visual Studio 2019 not available. Use hctbuild -vs2017 to build with Visual Studio 2017.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case and the 2017 case, I think it would be useful if the error message included the path it failed to find which led to this conclusion. If someone installed VS somewhere bizarre, they would at least immediately know the cause.

I remember someone having that problem with an unconventional VS installation location.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too.

utils/hct/hctstart.cmd Show resolved Hide resolved
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@hekota hekota merged commit bf5d585 into microsoft:master Sep 18, 2020
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.

None yet

3 participants