Ranguli/Buildling FlightGear on Windows

From FlightGear wiki
Jump to navigation Jump to search
This is a draft.


Deficiencies in the current build workflow

- Reliance on 3rd-party code bundled within the repository (sometimes this is useful for small libraries, especially if they aren't packaged elsewhere, but can quickly get out of hand).

- A major downside of this is that years go by without anyone copy and pasting the new library code into the repository, and the project is built with exceedingly old and likely insecure version of these libraries.

- Reliance on a git repository containing .lib and .dll files (this is icky and makes me cry).

- This has the same downsides as discussed above, but is also a uniquely gross solution given that we're tracking pre-compiled binary objects in a version control system, and using it for distribution and a very weak form of dependency management.

- Reliance on .bat scripts to orchestrate the build system. This really shouldn't be necessary in the large majority of cases if we're doing things correctly.

What the new vcpkg-based approach solves

- Developers don't need to clone or install the windows-3rd-party repo, nor do maintainers need to copy/paste new source code and .dll files into that repository periodically

-

The state of dependencies

Software dependencies required by SimGear
Available in vcpkg? Currently source location on Windows builds Currently source location on Linux builds Assessment
boost Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
crashrpt Yes, but only for Windows From FlightGear's windows-3rd-party repository. N/A - Windows-only dependency This should be added to vcpkg. We can use a platform constraint so it's only pulled in and built on Windows, as it's a Windows-only library.
curl Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
dbus Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
easyxml No Embedded in the SimGear repository Embedded in the SimGear repository Why do we have two XML parsing libraries, neither of which are particularly popular or widely used?
expat Yes, for Windows, Linux, and macOS Embedded in the SimGear repository Embedded in the SimGear repository Why do we have two XML parsing libraries, neither of which are particularly popular or widely used?
ffmpeg Yes, for Windows, Linux, and macOS System package manager Get from vcpkg instead.
freeglut Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
freetype Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
gexttext-libintl Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
libudns Yes, but only for Linux Embedded in the SimGear repository Embedded in the SimGear repository Keep in the SimGear repository
libevent Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
libjpeg-turbo Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
liblzma Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
libpng Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
libtiff No From FlightGear's windows-3rd-party repository. System package manager Can't migrate to vcpkg
nlohmann-json Yes, for Windows, Linux, and macOS Embedded in the SimGear repository Embedded in the SimGear repository Only used by tinygtlf. We don't need to include or manage this dependency if we migrate tinygltf to vcpkg.
openal-soft Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead.
osg Yes, for Windows, Linux, and macOS System package manager Get from vcpkg instead.
plib Yes, but only for Windows and Linux From FlightGear's windows-3rd-party repository. System package manager Get from vcpkg instead. MacOS users will not benefit from this change, but Linux and Windows users will.
tinygltf Yes, for Windows, Linux, and macOS Embedded in the SimGear repository Embedded in the SimGear repository Get from vcpkg instead.
zlib Yes, for Windows, Linux, and macOS From FlightGear's windows-3rd-party repository. System package manager

Installing WinGet

Traditionally, installing software on Windows has required a lot of manual steps (going to a URL, downloading an installer, clicking through all the steps, etc). There are much more modern and ergonomic alternatives available. One of these is WinGet.


Installing Microsoft Visual Studio 2022

Lastly, you will prompted to sign in with a Visual Studio account, and then personalize Visual Studio. These options are purely personal preference and won't have a bearing on the build process.

Installing CMake

https://cmake.org/download/


Version 3.30.3


Windows will prompt you to confirm you would like to allow the CMake Installation to proceed. Select Yes.

Installing Qt6

https://www.qt.io/download-qt-installer-oss

Selecting components

- Ensure that CMake is not selected, as we will download CMake ourselves instead of using the bundled version.