Skip to content
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

tidy-html5 fails to build with CMake 4.0 #1139

Open
renodr opened this issue Apr 2, 2025 · 0 comments · May be fixed by #1140
Open

tidy-html5 fails to build with CMake 4.0 #1139

renodr opened this issue Apr 2, 2025 · 0 comments · May be fixed by #1140

Comments

@renodr
Copy link

renodr commented Apr 2, 2025

CMake 4.0 was released on March 28th, and is a lot more strict than previous versions. Because of the changes, it has broken the build process of tidy. A lot of things that were previously warnings are now no longer allowed.

When trying to build this package with CMake 4.0, the first error that you'll see is:

CMake Error at CMakeLists.txt:20 (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.


-- Configuring incomplete, errors occurred!

To fix this, I changed Line 20 of CMakeLists.txt to read "cmake_minimum_required (VERSION 2.8.12...4.0)"

After this though, it still failed to build:

-- Detecting CXX compile features - done
-> TIDY_SO_VERSION = 58. This is an EVEN (stable) release.
-- *** Debug Logging is NOT enabled.
-- *** Building support for runtime configuration files.
-- *** Also building DLL library SHARED, version 5.8.0, date 2021.07.10
-- *** Generating man tidy.1 custom commands...
CMake Error at CMakeLists.txt:530 (add_custom_command):
  Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.


CMake Error at CMakeLists.txt:538 (add_custom_command):
  Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.


CMake Error at CMakeLists.txt:546 (add_custom_command):
  The following keywords are not supported when using
  add_custom_command(TARGET): DEPENDS


-- Configuring incomplete, errors occurred!

I've fixed this locally and will send in a PR shortly. I can confirm that my patch works with CMake 4.0 and CMake 3.30.x.

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

Successfully merging a pull request may close this issue.

1 participant