<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/137018>137018</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLVM_RUNTIME_TARGETS option
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ye-luo
      </td>
    </tr>
</table>

<pre>
    `LLVM_` prefix makes it sounds like global in the whole LLVM build.
Searching the code base
https://github.com/search?q=repo%3Allvm%2Fllvm-project%20LLVM_RUNTIME_TARGETS&type=code
indicates that is an option per runtime.

If I'm building 3 runtime `-DLLVM_ENABLE_RUNTIMES="a;b;c"`
however, if `a` only supports `arch1` and `arch2`, `b` only support `arch3`, `c` supports `arch1` and `arc3`,
I'm not sure how I should use `LLVM_RUNTIME_TARGETS` option
and what happens if I put `-DLLVM_RUNTIME_TARGETS="arch1;arch2;arch3"`

https://github.com/llvm/llvm-project/pull/136729 mentioned additional variables to control the resolution
```
 -DLLVM_RUNTIME_TARGETS='default;amdgcn-amd-amdhsa;nvptx64-nvidia-cuda' \
    -DRUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTIMES=openmp \
 -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=openmp
```
I found it cumbersome.

Instead, I'd like to see
```
 -DLLVM_ENABLE_RUNTIMES=openmp \
 -DRUNTIME_openmp_TARGETS="nvptx64-nvidia-cuda" # to select a subset if added
```
In short, I prefer the runtime name as the primary key rather than its supported targets in the user facing CMake options.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE1v4zYQ_TX0ZWBDJvURH3RQ1nFhINnDJu01GIljiw1Fqvxw1v--oBQ3WzebtoANS-Rw5r3n94jeq6Mhqllxy4rtAmPoravPtNTRLlorzzUrs_v73x6eWZnB6OigvsOAL-RBBfA2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