Closed compnerd closed 3 years ago
@jgm this is a follow up from the discussion that occurred in #392. By bumping the CMake version, we can ensure that the compiler is properly used by the build.
Are there associated changes you'd make if the version is bumped? Maybe they should be added here? Otherwise I don't see why we should gratuitously bump the version; that just makes it not work for certain users without providing any advantage to anyone.
No, the desired change is already in the tree here: https://github.com/commonmark/cmark/blob/master/CMakeLists.txt#L17-L19
Id say that we could bump to 3.1 if you prefer, but it seems unnecessarily low. I would actually suggest that we should bump to 3.18 and then roll back to the more declarative based CMake with generator expressions. However, this change conservatively bumps the version to ensure that the compiler flags for the language version are setup properly.
got it, thanks
Bump the minimum required CMake to 3.7. CMake 3.1 is required for the
CMAKE_C_STANDARD
andCMAKE_C_STANDARD_REQUIRED
options to take effect. Relying on CMake to control the compiler this way allows us to avoid having to rebuild the logic for detecting the appropriate flags and ensuring that the compiler is able to support the necessary language version.