OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

CMake 4.0 removed compatibility for versions older than 3.5

Open thokkat opened this issue 8 months ago • 3 comments

Using cmake 4.0 results in a build error:

 CMake Error at lib/edd-dbg/CMakeLists.txt:1 (cmake_minimum_required):
   Compatibility with CMake < 3.5 has been removed from CMake.
 
   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
   to tell CMake that the project requires at least <min> but has been updated
   to work with policies introduced by <max> or earlier.
 
   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features

Created a separate issue for Zenkit https://github.com/GothicKit/ZenKit/issues/103.

thokkat avatar Apr 15 '25 15:04 thokkat

I've checked modules that we have so far:

  • lib/edd-dbg - can fix locally. Long term we can move to std::stacktrace.
  • bullet3 - even on their github it still 2.4.3
  • squish/zlib in Tempest
  • multiple entries in ZenKit

Try avatar Apr 20 '25 19:04 Try

We could add DCMAKE_POLICY_VERSION_MINIMUM=3.5 like Zenkit does now or add a comment to readme about it.

https://github.com/GothicKit/ZenKit/commit/215c6f8f5b2ee8a7895b12a888639173f86c60d2

thokkat avatar Apr 22 '25 19:04 thokkat

I've updated most of third-party dependencies of Tempest and OpenGothic. TODO:

  • ZenKit (https://github.com/GothicKit/ZenKit/issues/103)
  • Tempest/thirdparty/libpng - they have it fixed in newest version, but it fails to compile into static-library

We could add DCMAKE_POLICY_VERSION_MINIMUM=3.5 like Zenkit does now or add a comment to readme about it.

I do not see much benefit in adding this into Readme, probably it's best to have a real fix

Try avatar Jun 21 '25 22:06 Try

ZenKit's issue is now resolved. Can you bump the submodule now please?

azahi avatar Oct 12 '25 16:10 azahi

Hi, @azahi !

I'll update submodule later this week or in beginning of next one

Try avatar Oct 13 '25 20:10 Try

Tested new ZenKit today:

C:/Programming/OpenGothic/lib/ZenKit/include/zenkit/Stream.hh:220:47: error: implicit conversion changes signedness: 'ssize_t' (aka 'long long') to 'unsigned long long' [-Werror,-Wsign-conversion]
  220 |                         auto len = static_cast<ssize_t>(w->tell()) - size_off - sizeof(uint32_t);
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ ~
C:/Programming/OpenGothic/lib/ZenKit/include/zenkit/Stream.hh:223:12: error: implicit conversion changes signedness: 'unsigned long long' to 'ssize_t' (aka 'long long') [-Werror,-Wsign-conversion]
  223 |                         w->seek(len, Whence::CUR);
      |                            ~~~~ ^~~
2 errors generated.

@lmichaelis can you add cast of sizeof(uint32_t) to ssize_t ?

Try avatar Oct 14 '25 20:10 Try

Hey @Try, I've added the requested change (https://github.com/GothicKit/ZenKit/commit/8c4edf75ebdda1fa27c863f5fae81b3744f7187f) but am unable to verify if it will work for you. Could you tell me which compiler/version this happens on?

lmichaelis avatar Oct 19 '25 15:10 lmichaelis

@lmichaelis Commit https://github.com/GothicKit/ZenKit/commit/8c4edf75ebdda1fa27c863f5fae81b3744f7187f) works, thanks!

Could you tell me which compiler/version this happens on?

I'm using at the moment LLVM-MinGW 17.0.6 64-bit - one that comes bundled with QtCreator, on windows. I principle any MinGW/GCC has similar warning for mixing sign and unsigned types. And, ofc OpenGothic compiled with -WError.

@azahi Sumbmodule is updated now.

Try avatar Oct 19 '25 19:10 Try