I had a hell of a time trying to build the Tracktion Engine examples on Windows. A lot of the issues are highlighted in this post: Tracktion Engine - compilation errors and demo example problems on Windows
Some of the issues stemmed from the fact that, like the above poster, I was also trying to build for Visual Studio 2019 and not 2017 (which was hard-coded into the build .bat files and project PIP files).
I noticed that as of this commit on the develop branch - 66446804289950bc49830578c50f89d04dddf24f, the platform-specific build scripts have been removed in favor of a single CMake solution. It seems like this is an improved approach, as it looks like generating and building example projects for the target platform and build environment will be much more dynamic, especially on Windows where everything was previously hard-coded into .bat files (including Visual Studio version and MSBuild paths, etc.). However, I am admittedly completely new/unfamiliar with CMake. I’ve installed it on Windows, but the two build script files (‘generate_examples’ and ‘build’) are bash script files.
Examining the build scripts seems to indicate it should be possible to call them from Windows, but it’s not obvious how one would execute a bash script under something like Windows Terminal or PowerShell. This article gives some hints, but not anything that really helps in this scenario it would seem.
I do have the Windows Subsystem for Linux installed, and I can run a bash shell, however when I drop into a bash shell and attempt to run the
build scripts directly I get the following error/output:
: invalid option
It seems like executing this build script from WSL is not the intention, because the $OSTYPE is
linux-gnu and not the build script’s intended value of ‘msys’. Do I need to run this under something else like MinGW instead? I’m super confused because it looks like the intention is for the build script to support Windows, but there is really no guidance in the README.md on how to run the build script on Windows with CMake, and further more, the hard-coded .bat files, which didn’t work out-of-the-box before, but could be hacked to work, are now removed from the repo.
I feel like getting up and running with the examples on Windows is, and has been, quite dysfunctional and under-supported that it is going to turn a lot of interested Windows developers away from using Tracktion Engine, which is unfortunate.
I personally wouldn’t mind trying to clean this up and offer a pull request, but I need a little guidance first. Are the bash scripts
build supposed to run on Windows, and if so, what is the intended solution to accomplish this?
Also, can we please add some support for more than just Visual Studio 2017 seeing as how we are now on Visual Studio 2022? The new build script still only works with Visual Studio 2017.
Thanks for any help with this, I’m hoping there is just a key piece of info that is missing from the README that is causing my hang up!
Update: I tried running the build script with the MinGW64 Git Bash that installs with Git for Windows and that worked! Adding this detail to the Tracktion Engine README.md would be a great addition to avoid confusion when building examples on Windows.
I still had to manually edit the
build script to target Visual Studio 2019, perhaps the script could be updated to either use an interactive prompt to let the user select with version they want to target, or it could just use a series of if/fi that attempt to auto-detect the available version starting with the latest versions and falling back to older versions if the path to MSBuild doesn’t exist.