xmos / xcommon_cmake

6 stars 5 forks source link

Support application sources defined only be SOURCE_FILES_<config> #153

Open danielpieczko opened 4 months ago

danielpieczko commented 4 months ago

If all the APP__SRCS variables are set to empty strings to avoid globbing for sources, and instead all the application sources are specified by SOURCEFILES then cmake configuration fails because there is no source available for the xcc -dumpmachine command.

The motivation for this is an improvement that @xhuw is working on for lib_unity to make it simpler to add unit tests across our libraries and reduce code duplication - but it relies on setting all the sources via SOURCEFILES.

A dummy source file could be created for the determining the architecture, and then deleted. Alternatively, it might be possible to reorder the processing of the configs so that the sources in the SOURCEFILES variable could be used to get the architecture.