Add CMake add_llvm task to llvm distibution

Hello,

I need a cmake task which will download and install locally prebuilt llvm for building some other project. I need a commit hash as an optional argument. If the prebuilt version is available on github, it should download it from github using something like gh download, otherwise checkout the llvm-project and build the specified version locally.

The intention to include is to cmake is the following. Local developers should be able to use this for their local builds, and local builds are made by means of cmake

Is LLVM project a good place to supply such CMake utility? What are chances the contribution like this is accepted?

I wonder where should I put my code. I see llvm/cmake/modules/AddLLVM.cmake and also cmake/Modules. Which place is better?

Is dependency from gh a bad thing? One can download builds using REST without using gh

Best regards, Alexei

1 Like