diasurgical / devilutionX

Diablo build for modern operating systems
Other
7.99k stars 781 forks source link

CMake 3.12 really necessary? #47

Closed grepwood closed 5 years ago

grepwood commented 5 years ago

I wanted to compile this project on Gentoo Linux and got a message saying my stable CMake is too old :)

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.12 or higher is required.  You are running version 3.9.6

Further investigation shows CMake versions across various distributions considered stable.

System  Version   CMake
Gentoo  2.2       3.9.6
Ubuntu  18.04.2   3.10.2
Debian  9.8.0     3.7.2
FreeBSD 12.0      3.13.4

Fedora and Arch were not taken into account due to them being cutting-edge distros that are expected to have latest packages. CentOS was not taken into account because it's antiquated and a new release is coming soon.

Bottom line - is such a version of CMake really necessary? After reducing the minimum version to 3.7, I only got this error:

CMake Error at CMakeLists.txt:196 (target_link_libraries):
  Object library target "devilution" may not link to anything.

-- Configuring incomplete, errors occurred!

When in fact, that's not really correct. The offending line says

target_link_libraries(devilution PUBLIC Threads::Threads)

Any ideas?

AJenbo commented 5 years ago

The requirement comes from the Windows build. We build the releases on Debian-backports (CMake 3.13). Prior to adding Windows support the CMake requirement was 3.7.

We are currently looking in to ways of bringing down the requirement to something like 3.10, or maybe even 3.7. Thanks for the version overview.

grepwood commented 5 years ago

@AJenbo What specifically about the Windows build warranted this change? I can crosscompile OpenJK for Windows just fine with CMake 3.9.

AJenbo commented 5 years ago

The requirment has now been lowered to 3.7 for most platforms, technically it works all the way back to and including 3.3. But using older versions then 3.7 for continuous testing seems more of a hassle then it's worth, and it's preferable that we can detect if there is a change in requirements.

For Windows-builds the limit is 3.10 since older versions fail during the pthread lookup.

https://github.com/diasurgical/devilutionX/pull/50