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

Compiling under Windows - bootstrap.ps1 not compatible with Visual Studios 2019 #906

Open
kheckwrecker opened this issue Nov 13, 2024 · 2 comments
Milestone

Comments

@kheckwrecker
Copy link

When compiling under Windows, using Visual Studios 2019, bootstrap.ps1 fails with:

CMake Error: Could not read presets from D:/VegaStrike-0.9.0/Vega-Strike-Engine-Source-0.9.0/engine: Unrecognized "version" field.

Apparently, this is a known issue with the version of CMake used to compile and VS 2019.

However, build.ps1 expects to find VS 2019. The work-around is to install both VS 2022 and VS 2019 and run the compile through VS 2022.

It would be nice, though, to be able to compile with one Visual Studio or the other.

@royfalk
Copy link
Contributor

royfalk commented Nov 14, 2024

OK. These are actually two issues:

  1. VS2019 has a CMake error.
  2. build.ps1 expects VS2019.

For the first one, can you provide a more full error log, just in case the lines before and after are also relevant.
For the second one, that should be a simple fix.

@kheckwrecker
Copy link
Author

I need to make a correction to the issue I reported. The problem is not with bootstrap.ps1, the problem is with build.ps1. To be clear script/bootstrap.ps1 completes fine with either VS 2019 or VS2022. Sorry for the confusion, I should have kept better notes on where errors originally occurred.

Also, when running script/build.ps1 under the VS 2022 Powershell, I'm not sure build.ps1 actually "uses" VS 2019. I think the build script may fail simply because it expects to find VS 2019, and fails when it does not.

So to clarify, when you launch script/build.ps1 under VS 2019, it fails immediately with the following error:

PS D:\vs9> script/build.ps1
CMake Error: Could not read presets from D:/VS9/engine: Unrecognized "version" field
CMake Error: Could not read presets from D:/VS9/engine: Unrecognized "version" field

And then returns to the command prompt. That's it - there are no other messages.

Out of curiosity, I tried editing CMakePresets.json to change the "version" number to 2. Then you get this error message:

PS D:\vs9> script/build.ps1
CMake Error: Could not read presets from D:/VS9/engine: Invalid preset
CMake Error: Could not read presets from D:/VS9/engine: Invalid preset

So then I tried changing it to 1, and got this error message:

PS D:\vs9> script/build.ps1
CMake Error: Could not read presets from D:/VS9/engine: File version must be 2 or higher for build and test preset support.
CMake Error: Could not read presets from D:/VS9/engine: File version must be 2 or higher for build and test preset support.

Changing it to 4 or higher just gives the same error message as if the "version" is set to 3.

So my next step was to delete VS 2019 and install VS 2022. The script/bootstrap.ps1 ran fine under VS 2022, and build under VS 2022 went much further, but then crashed reporting it could not find VS 2019.

So I installed both VS 2019 and VS 2022, ran script/bootstrap.ps1 and script/build.ps1 under the VS 2022 Powershell and was able to complete the compile.

@BenjamenMeyer BenjamenMeyer added this to the 0.10.x milestone Dec 7, 2024
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

No branches or pull requests

3 participants