Base and child Kotlin libraries

Hello.

I need to have a following structure:

  1. A base Kotlin native library which will have some abstract class Pet. It will target JS, Android, iOS and MacOS. Native apps will do something with these pets.
  2. Then I should be able to create various separate Kotlin Native libraries with custom Pet subclasses - for example Cat, Dog, Horse.
  3. Native apps should be able to use any kind of Pet.

How can this be achieved?
I’ve created a sample library with this wizard https://terrakok.github.io/kmp-web-wizard/ and it seems to work. Unfortunately I have absolutely no clue how to create this library hierarchy which I need. Tried creating separate module with base Pet but getting Gradle circular dependency errors during compilation.