Page 1 of 1

How to compile with Visual Studio 2019 ?

Posted: 02 Jul 2020 08:34
by MagicBuzz
Hello,

I used to compile OpenTTD myself (to get lastest source code, test my own patches, or try other patches) with Visual Studio 2019.

There were solution and projects files, but they were removed a few ago.

How can I open it now in Visual Studio and compile it ?

Re: How to compile with Visual Studio 2019 ?

Posted: 02 Jul 2020 10:31
by jfs
Make sure you have the CMake tools support installed, just enable it in the VS installer tool.
Then use File > Open > Open Folder to open your checkout copy.

After that you'll want to find CMakeLists.txt in the folder browser view, right click and open the CMake Settings from there. Maybe add a Release configuration.
Most importantly, you'll probably need to add/change the CMake variable named VCPKG_TARGET_TRIPLET to "x64-windows-static" (or "x86-windows-static" for 32 bit builds) so it can find your installed dependencies.

Re: How to compile with Visual Studio 2019 ?

Posted: 02 Jul 2020 13:20
by MagicBuzz
Thank you jfs, it worked :bow:

I was trying to build it directly from CMake with no success. Using VS helped me to find the problems :)