# Allow library build as cmake project

**URL:** <https://yosyshq.discourse.group/t/allow-library-build-as-cmake-project/174>\
**Category:** Developers\
**Created:** [October 20, 2026, 7:51am UTC](https://yosyshq.discourse.group/t/allow-library-build-as-cmake-project/174 "2026-10-20T07:51:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![towoe](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@towoe](https://yosyshq.discourse.group/u/towoe)\
**Post date:** [October 20, 2026, 7:51am UTC](https://yosyshq.discourse.group/t/allow-library-build-as-cmake-project/174/1 "2026-10-20T07:51:06Z")

</div>

Hi,

my plan is to be able to import Yosys as a library from another project. Now that Yosys is using cmake for the build system that makes it fairly easy. However some small adjustments and modifications are needed, but those should all have no impact on how the config and build of Yosys is working currently.

So from an external perspective a cmake config have something like this:

```auto
find_package(Yosys)
target_link_libraries(... Yosys::libyosys)

```

This requires a package config file.

I started with one adjustment in [PR 6371](https://github.com/YosysHQ/yosys/pull/6371) so that building with `-fno-rtti`is possible.

Another fix in preparation for this was in [PR 6294](https://github.com/YosysHQ/yosys/pull/6294).

Would be interested to know if someone is interested in this? Or if there are potential problems which I should consider.

Thanks,

Tobias

---

<div class="post-metadata">

**Author:** ![KrystalDelusion](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@KrystalDelusion](https://yosyshq.discourse.group/u/KrystalDelusion)\
**Post date:** [October 21, 2026, 9:03am UTC](https://yosyshq.discourse.group/t/allow-library-build-as-cmake-project/174/2 "2026-10-21T09:03:13Z")

</div>

We already have the infrastructure for `libyosys`, and `pyosys` is able to be included in other projects; so I think this is desirable to have.
