Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cmake build on windows. (#34214)
This fixes several minor issues: - platform_win.h needs to be included before SDL stuff, otherwise you get seemingly unrelated errors. This happened to work in VS solution because it force-includes stdafx.h everywhere. However stdafx.h should only be used as an optimization measure, and not to guarantee correctness - The binary currently does not use SDL2main helper, and instead defines all initialization in WinMain itself. I didn't try searching for the specific commit, but according to comments in Makefile, this is a deliberate change. VS solution defines USE_WINMAIN unconditionally, so let's use it in cmake as well. - WinMain, as defined currently, has its arguments unused, which makes g++ complain, and fail due to -Werror. Removed the comments - Mostly unrelated, and not strictly necessary: the "idiomatic" way to require a C++ standard in cmake is `SET(CMAKE_CXX_STANDARD 14)`, which is very slightly preferred over `SET(CMAKE_CXX_FLAGS -std=c++14)` due to cross-platform considerations. The option is present since at least CMake 3.1.3, released in february 2015. This is only 3 months later than C++14 release, so the version bump should not be problematic.
- Loading branch information