Halide icon indicating copy to clipboard operation
Halide copied to clipboard

Upgrade CMake to 3.24 and refactor FetchContent usage

Open alexreinking opened this issue 1 year ago • 5 comments

WIP -- still to-do is to audit our packaging rules (and maybe add some GHA tests, hmm) and update the READMEs.

This PR replaces all usage of FetchContent inside our build with find_package. When Halide is the top-level project, i.e. not being included into another project via FetchContent (or add_subdirectory), it will load the new cmake/dependencies.cmake. This file contains a series of FetchContent calls that hook find_package. Some dependencies, like wabt and flatbuffers do not play nicely with FetchContent, and so some patches must be injected. We should consider opening issues/PRs upstream to enable us to remove these hacks down the line. (Unfortunately, this is difficult for me to do).

FetchContent can be disabled wholesale by setting -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="" on the CMake command line. This should avoid issues like #5092 resurfacing.

This also makes progress toward #7611 by deferring to the including project's dependency management strategy.

Fixes #7757

alexreinking avatar Aug 22 '23 14:08 alexreinking

Looks like the first step is getting 3.24 installed on all the bots -- I'll attend to that this morning.

We should consider opening issues/PRs upstream to enable us to remove these hacks down the line. (Unfortunately, this is difficult for me to do).

If you can provide guidance on this I can see about making this happen.

steven-johnson avatar Aug 22 '23 15:08 steven-johnson

You should probably sync to main (again) to eliminate false build failures on OSX

steven-johnson avatar Aug 25 '23 20:08 steven-johnson

I realize this is still WIP, just wanted to check in and see where the plans are

steven-johnson avatar Nov 28 '23 15:11 steven-johnson

I'm going to pick this back up soon now that I'm at Adobe. I took one step in #8265

alexreinking avatar Jun 21 '24 20:06 alexreinking

Should target CMake 3.28 now that it's the version on Ubuntu 24.04 LTS

alexreinking avatar Jun 21 '24 20:06 alexreinking