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

    <tr>
        <th>Summary</th>
        <td>
            Provide a way to get path to the right LLVM shared library in the CMake scripts within the SDK in order to link trd-party out-of-tree projects to it.
        </td>
    </tr>

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

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

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

<pre>
    Currently the docs in [`Embedding LLVM in your project`](https://github.com/llvm/llvm-project/blob/main/llvm/docs/CMake.rst) result in the target being linked against LLVM static libs. This make results enormous in size and waste RAM and disk i/o. While some people may want to get their program working even if LLVM was removed, I'd prefer the software to be broken when LLVM package is removed or updated with an incompatible version, but to keep disk and memory footprint minimal and automatically get all the improvements within LLVM without recompilation.

After researching how the projects using CMake as a build system are linking LLVM, I found that they reinvent wheel by locating `cmake-config` via a heuristics (`find_program` + naming convention) and calling it, all of this in CMake code within their projects.

I think that LLVM CMake SDK (`llvm-17-dev` package in Debian currently (2023-05-22)) should provide a way.

Also I think that LLVM static libs shouldn't be a part of `llvm-17-dev`, but a separate package. People usually need to link the LLVM shared lib since they need that anyway for such things like GPU drivers.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM2S4zYPfBr6grJLov8PPszOfP6ytbvJVn6PKUiEJMQUqSIpu5SnT4GyZ2azp1xsSSSA7kYDGCO3juikth_U9mWBY-p8OH366fPTjx-ff1hU3kyn5zEEcslOkDoC4-sI7EAidsX_-oqMYdfC58-_f5Hvkx8DDMH_RXVSu0JtX5Q-dCkNUa2flD4rfW45dWO1qn2v9Nna6-Nv-QjT58r6Sulzj-ze7khppc_PX_BCqxCT0kcIFEebpLCASxhaSlCRILLsLmQAW2QX0wwwJkxcg-UqruDXjiP0eKF7lgjkfOj9mAlG_psAnYEbxkTw89OX_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