Skip to content

Prepare LE to build with cmake 4.0.0 #9916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
heitbaum opened this issue Mar 28, 2025 · 5 comments · Fixed by #9918
Closed

Prepare LE to build with cmake 4.0.0 #9916

heitbaum opened this issue Mar 28, 2025 · 5 comments · Fixed by #9918

Comments

@heitbaum
Copy link
Contributor

heitbaum commented Mar 28, 2025

Upstream repo already in repo

Upstream patches raised

TBA

Local patch

@fuzzard
Copy link

fuzzard commented Mar 28, 2025

You may or may not be aware of https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html

It allows to set a "minimum" that will override what a cmake project has its min version at
Adding a define to a configure command will then "avoid" the cmake 4 failure

-DCMAKE_POLICY_VERSION_MINIMUM=3.5

Essentially avoiding having to patch for projects that arent actively maintained (lzo2 is a prime example from kodi perspective).

Cmake state the following in their pre release notes about the new variable

The “CMAKE_POLICY_VERSION_MINIMUM” variable was added to help
packagers and end users try to configure existing projects that have
not been updated to work with supported CMake versions.

Do be aware, cmake devs have stated they intend to make further breaking changes from the 3.x branch (deprecated removals), so setting the minimum to 3.5 in the example above, may need to be revisited in future cmake 4 version bumps if they drop deprecated features in > 3.5

@heitbaum
Copy link
Contributor Author

You may or may not be aware of https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html

It allows to set a "minimum" that will override what a cmake project has its min version at Adding a define to a configure command will then "avoid" the cmake 4 failure

-DCMAKE_POLICY_VERSION_MINIMUM=3.5

Essentially avoiding having to patch for projects that arent actively maintained (lzo2 is a prime example from kodi perspective).

Cmake state the following in their pre release notes about the new variable

The “CMAKE_POLICY_VERSION_MINIMUM” variable was added to help
packagers and end users try to configure existing projects that have
not been updated to work with supported CMake versions.

Do be aware, cmake devs have stated they intend to make further breaking changes from the 3.x branch (deprecated removals), so setting the minimum to 3.5 in the example above, may need to be revisited in future cmake 4 version bumps if they drop deprecated features in > 3.5

I did think about it. I’m regretting not patching some of the gcc-12,13,14… workarounds I had made when we bumped previously, as remembering to clean them up / or revisiting the CFLAGS. So have been on the upstream patch bandwagon for both the gcc15 and now the cmake4.

Some of the patches I have written are 3.10 targeted, which seems to be the not yet deprecated version. When there has been inconsistencies in the version (aka gmmlib and media-driver) then I have just been updating to the consistent.

@fuzzard
Copy link

fuzzard commented Mar 28, 2025

All good. Internally in kodi for other platforms i'll just be using the override for things like lzo.

Just wanted to make sure it was known about a way so you dont have to patch things that are abandoned (or less maintained) upstream and then carry more patches for good

@heitbaum
Copy link
Contributor Author

All good. Internally in kodi for other platforms i'll just be using the override for things like lzo.

Just wanted to make sure it was known about a way so you dont have to patch things that are abandoned (or less maintained) upstream and then carry more patches for good

You are right. Once we get down to the patches that are/will be accepted, then agree will be time to use the CMAKE_POLICY_VERSION_MINIMUM override

@heitbaum
Copy link
Contributor Author

@fuzzard - 29 patches required - so not to bad, pretty much all upstreamed, most were simple patches, a couple required rework of the CMakeLists.txt. Let’s see how much traction we get on the upstream merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants