yashi / module-sample

A sample Zephyr module
17 stars 4 forks source link

Compulsory addition of Kconfig Fragment #2

Closed waseemR02 closed 1 year ago

waseemR02 commented 1 year ago

I was adding libcanard as a module and following your template. One thing I noticed was that the library was not getting included even though I added add_subdirectory(.. build) to CMakelists.txt under zephyr directory. I tested out yours and it was working as I could see it in build.ninja. After removing bits of your CMakelists.txt like conditional statement and Kconfig did it give me some error while building. Only when Kconfig is defined under zephyr/ and is included in prj.conf does it build the module. I dont know the specific reason. Why does it happen?

Also I had another query regarding using libcanard. Will macros like CANARD_ASSERT which is basically assert() create any problems and should i change it to something similar to zephyr's implementation of assert?

yashi commented 1 year ago

Hi,

I don't use libcanard but tried to modularized it. Here is my outcome.

https://github.com/yashi/libcanard

waseemR02 commented 1 year ago

Thanks @yashi for the quick help. I was talking about this libcanard but this example was helpful. This is my forked repo which compiles fine now from the guidelines of your example module-sample just that I needed to include Kconfig.