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

    <tr>
        <th>Summary</th>
        <td>
            LLVM_EXPERIMENTAL_TARGETS_TO_BUILD - CMake Error: could not find TARGET 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          thetemplar
      </td>
    </tr>
</table>

<pre>
    I want to add a new backend/target:
[https://github.com/TriDis/llvm-tricore/tree/tricore/lib/Target/TriCore](https://github.com/TriDis/llvm-tricore/tree/tricore/lib/Target/TriCore)

Since the code above is for a very old version, I want to merge it into the current master branch.

Reading the documentation at [https://llvm.org/docs/WritingAnLLVMBackend.html#preliminaries](https://llvm.org/docs/WritingAnLLVMBackend.html#preliminaries) it says adding `-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=TriCore` should be sufficient, but I get the following error:

```
.....
-- Targeting SystemZ
-- Targeting VE
-- Targeting WebAssembly
-- Targeting X86
-- Targeting XCore-- Targeting XCore
-- Targeting TriCore
CMake Error at cmake/modules/LLVM-Build.cmake:42 (get_property):
  get_property could not find TARGET TriCore.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  lib/CMakeLists.txt:65 (LLVMBuildGenerateCFragment)


CMake Error at cmake/modules/LLVM-Build.cmake:43 (get_property):
  get_property could not find TARGET TriCore.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  lib/CMakeLists.txt:65 (LLVMBuildGenerateCFragment)

````


Going further to [https://llvm.org/docs/WritingAnLLVMBackend.html#target-registration](https://llvm.org/docs/WritingAnLLVMBackend.html#target-registration) it says `For more information, see “[llvm/Target/TargetRegistry.h](https://llvm.org/doxygen/TargetRegistry_8h-source.html)”.`, but the link is dead.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlVUtv4zgM_jX2R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