[llvm] [LLVM] Add `LLVM_<proj>_RUNTIME_TARGETS` to set targets per-project (PR #81557)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 09:37:53 PST 2024


jhuber6 wrote:

> > > Right now the suggested method would be.
> > > ```
> > > -DLLVM_ENABLE_RUNTIMES="libc;libc++;openmp"
> > > -DLLVM_RUNTIMES_TARGETS="default;amdgcn-amd-amdhsa"
> > > -DRUNTIMES_amdgcn-amd-amdhsa_ENABLE_RUNTIMES='libc'
> > > ```
> > > 
> > > 
> > >     
> > >       
> > >     
> > > 
> > >       
> > >     
> > > 
> > >     
> > >   
> > > This would have the desired behavior of making the `libc` project compile under the AMDGPU triple. But it would still make it present under the `default` target, which is not the desired behavior.
> > 
> > 
> > If you don't want `libc` being present in the `default` target, why not simply omit it from `LLVM_ENABLE_RUNTIMES`?
> > ```
> > -DLLVM_ENABLE_RUNTIMES="libc++;openmp"
> > -DLLVM_RUNTIMES_TARGETS="default;amdgcn-amd-amdhsa"
> > -DRUNTIMES_amdgcn-amd-amdhsa_ENABLE_RUNTIMES="libc"
> > ```
> 
> This is a little broken right now with the current logic, since we use things like `if ("libc" IN_LIST LLVM_ENALBE_RUNTIMES")` in various places. That could possible be fixed if we check through all the runtime targets then.

Also I somewhat like all the used targets being present somewhere up front. Maybe we could just add a
```
-DRUNTIMES_default_DISABLE_RUNTIMES="libc"
```
or something.

https://github.com/llvm/llvm-project/pull/81557


More information about the llvm-commits mailing list