adventuregamestudio / ags

AGS editor and engine source code
Other
697 stars 160 forks source link

Upgrade Windows projects to VS 2019 #2241

Open ivan-mogilko opened 10 months ago

ivan-mogilko commented 10 months ago

VS 2015 free Community Edition is deprecated by Microsoft, and is no longer available for download from their official page (although there are still "unofficial" ways to acquire it).

At the same time the latest VS 2022 does not install on Windows 7, which I still use unfortunately. I might have to upgrade to Win10 or 11 soon, as more and more apps stop supporting it in their updates, but that will take some time.

Therefore I suggest to first move to VS 2019, as a temporary measure. According to this Microsoft's page the VS 2019's lifecycle is scheduled to end in 2029.

As we have a 3.6.1 coming towards a full stable release, I would not like to apply these changes to ags3 branch just yet. Instead I propose to begin with ags4 branch, and apply this change to ags3 only after 3.6.1 is fixed in a separate "release-3.6.1" branch.

The changes to the project might include:

  1. Upgrade the VS solutions and projects.
  2. Fix any new compilation errors and outstanding warnings.
  3. Switch to the newer "VC runtime" dependency, make certain that it runs on Windows 7 at least.
  4. Replace VC runtime dependency in the AGS Editor's installer, readmes etc.
  5. Low priority: check if it's still possible to build engine for Windows XP, using a separate configuration.

Task list, for keeping the record:

ericoporto commented 10 months ago

This has to be done in a PR and not with direct commits, as I believe after it's all done it won't build due to #1508, so once this is upgraded, the Windows Docker has to be changed too.

Questions:

ivan-mogilko commented 7 months ago

I think we might as well move to at least to C++14 already. I would also consider C++17, because it has generic filesystem api, but will have to investigate if all ports will be able to support that, so this may be done later.

ericoporto commented 7 months ago

C++14 is holdback for how old Linux we want to go. We are using Debian 8 (Jessie) and currently the stable release is Debian 12 (Bookworm).

Debian 10 (Buster) which is LTS already includes C++17 support.

In C++17, std::optional requires a polyfill for Apple Clang (which doesn't support it). I used this when I wrote my parsing of acsetup.cfg in my tool agsconfig.

One good thing of having C++14 is the possibility to upgrade Google Test library, we are using two different old versions for specifically working around some issues in it. It appears this issues having been minimized in more recent versions. The other good thing is currently MinGW fails to build our tests due to some issue with the specific googletest we use, MinGW and SDL, and it looks like this error doesn't happen in recent googletest. I am still looking around to actually see if there's something on our code that could fix the specific compile error that happens - this is why I haven't put a CI with MinGW yet, I can build AGS but not the tests.

edmundito commented 3 months ago

FWIW, I've been using 2022/C++ 17 with trivial adjustments and can contribute to the engine and editor without issues. So, the 2019 upgrade is OK with me.

edmundito commented 3 months ago

I pushed my changes for VS 2022 here for reference: https://github.com/adventuregamestudio/ags/compare/master...edmundito:ags:edmundito/vs2022-compat

I just updated the latest version of 2022 (17.10.3) and had to: