Fast math is not required, but it speeds up some calculations at the expense of accuracy. There are some functions like dtMathIsfinite that use floating point functions that become undefined behavior when compiled with fast-math, so we need to conditionally short-circuit these functions when compiled with that flag.
-Wnan-infinity-disabled is complaining about the isfinite call in dtMathIsfinite.
This also sets the linux runner explicitly to Ubuntu 24.04, since ubuntu-latest defaults to 22.04 for some reason. This also updates gcc and clang to the latest versions in apt and logs their version to the run output. We need at least clang18 to disable the -Wnan-infinity-disabled warning for Catch.
Finally, this also removes some unused code that was throwing a warning (and thus an error) on newer compiler versions.
* Ignore cmake intermediate build dir
* Fix C++ language version in cmake build scripts
* Set a default SDL2_ROOT_DIR value for macOS in cmake scripts
* Fixed macOS SDL framework linking in cmake scripts
* Added macos-cmake target for CI builds in github workflows
* Use C++17 for building Tests instead of 20, since we build them with VS2019 in some jobs
The goal here is to replace the current (slightly broken) Travis + Appveyor setup with something that covers more cases and is a bit better supported and easier to maintain. This hopefully helps us catch cross-platform issues quicker. For example, the linux and clang compilation issues that have existed for a while could have been caught if we were building those targets in CI.
This adds a build script that builds the following configurations for every repo commit and PR:
macOS, premake, Debug
macOS, premake, Release
linux, premake, gcc, Debug
linux, premake, gcc, Release
linux, premake, clang, Debug
linux, premake, clang, Release
linux, cmake, Debug
linux, cmake, Release
windows, premake, vs2019, Debug
windows, premake, vs2019, Release
windows, premake, vs2022, Debug
windows, premake, vs2022, Release
windows, cmake, vs2019, Debug
windows, cmake, vs2019, Release
windows, cmake, vs2022, Debug
windows, cmake, vs2022, Release
It also builds and runs the catch tests executable in the following configurations. A failed test will fail the build.
macOS, premake, Debug
linux, premake, clang, Debug
windows, premake, vs2022, Debug
It doesn't currently build cmake on macOS because there is a one blocker there (#577). We could also add additional builds like cmake with both clang and gcc on linux, but for now this is much better coverage than we have currently.