xmos / fwk_io

I/O Framework
Other
2 stars 10 forks source link

Add XCommon CMake support for I/O modules #94

Closed danielpieczko closed 7 months ago

danielpieczko commented 7 months ago

Added lib_build_info.cmake to I/O modules so that they support XCommon CMake. The I2C module has had this for a while on my fork and Alberto has been using it in lib_camera, but we want this in the xmos org on a feature branch for fwk_io (maybe it could go onto develop, but one step at a time).

I've added the same support for I2S, SPI and UART, tested with a simple application to confirm that all the sources are compiled into object files; I've ignored mic_array and xud because these are submodules and if anyone wants XCommon CMake support for them, then the submodules should be changed to point to a changeset in the standalone lib which has this support.

Also, for each module, the lib is named eg. i2c rather than lib_i2c: this is to avoid a warning from xcommon_cmake that the directory name doesn't match the library name. This will also make the potential future switchover to standalone libraries clearer as the dependency list will change from i2c to lib_i2c. For now, fwk_io has to be fetched using FetchContent rather than automatically by xcommon_cmake, and dependency directory paths need to be explicitly set: this is working in lib_camera.

xross commented 7 months ago

Seems like a sensible intermediate step.