Simplify Windows build
This PR includes several steps to simplify the build of MultiMarkdown under windows, largely by removing dependencies that are not necessary for building. Specifically, this:
- Uses greg's CMake build system, removing Make as a required part of the build (before this, one step of the generated Visual Studio files would attempt to invoke greg's Makefile, which would run into issues if Make is not installed.)
- Use wingetopt which is included as part of the greg build, as opposed to relying on the MINGW implementation.
- Removes references to
libgen.h, which are present in MINGW and POSIX, but not Windows. Instead, the Windows equivalent functions and definitions are used. - Using Window's
strtok_sinstead ofstrtok_r, which fixes a potential buffer overflow bug in Windows.
Using these changes, I'm able to build MultiMarkdown using the Visual Studio build system, without MINGW and Cygwin installed.
I'm going to have to think about this one. I worry that it might cause too much divergence between Windows and non-Windows code.
I understand the need to consider for a bit - this took a fair bit of time for me to wrap my head around, and I'm certainly open to feedback if there are ways to make the contributions more streamlined.
At least three of the commits cause no divergence between the two platforms, and using greg's cmake build particularly simplifies the build system independent of making the build simpler under Windows. The rest came from attempting to build MMD for inclusion in a python module, where the build can be fully automated in a python command (see here).