Closed krbvroc1 closed 4 years ago
There is a specific check in the flatcc CMakeList.txt file at line 213 to see if the gcc version is 8.0 or larger. This is because gcc is being obnoxious with warnings as errors that hurt source interoperability with other compilers. This change in CMakeLists.txt is relatively new and probably hasn't been tested with Centos.
I don't know why it fails. Perhaps the CMake version installed does not like the syntax, as suggested by the error code. Unfortunately I'm not an expert on CMake so I can't say why that would be. If you can come up with a fix, I'm open to adopting it. If Centos is running an older gcc, you can try to disable the offending branch in the CMakeList file.
Based on
https://stackoverflow.com/questions/16667017/cmake-express-the-greater-or-equal-statement#16668344
I think VERSION_GREATER_EQUAL was introduced in CMake 3.7 and you probably don't have that.
But it seems that VERSION_LESS is supported in your version since it has executed earlier:
So if you can change line 213 into a NOT VERSION_LESS somehow, it might work.
Perhaps if (NOT (GCC_VERSION VERSION_LESS 8.0))
?
After a quick google search, it appears the VERSION_GREATER_EQUAL operation is not available until a newer verison of cmake (which isn't avail on Centos 7). I see you found that same info while I was typing this.
Yes, changing the line 213 to: if (NOT GCC_VERSION VERSION_LESS 8.0)
does solve the issue.
[EDIT: Centos 7 comes with cmake 2.8.12]
Commited change. Please confirm master branch works for you.
I will not update the CHANGELOG since this was introduced after the last release.
@mikkelfj I refetched master and it compiles now. Thanks for the quick check in.
You are welcome!
Brand new user here.
I am a Centos 7 user. I downloaded and ran './scripts/initbuild.sh make'