Open lightspot21 opened 5 months ago
The solution I have currently in mind:
Package up every Harmony component separately (DFP, CSP, the MHC generator) with Conan recipes. Then, create a "Harmony3" metapackage explicitly depending on specific DFP/CSP/MHC versions. This metapackage will also include a FindHarmony.cmake
script, which will:
find_package(DFP)
/find_package(CSP)
within the Harmony find module.make mcuconfig
which when called, spawns MHC GUI with the appropriate settings. If there is no pre-existing MHC config in the top-level directory, notify the user to run this target first. If exists and make mcuconfig is run, open the existing configuration.Harmony::Peripherals
, Harmony::Config
etc.) for linking.This way, Harmony is contained and constrained to what it can use and how. In case MHC ceases working, users can grab the latest generated files, re-expose the targets and commit them to version control without any needs for the CMakeLists targets to change.
Find a way to generate peripheral drivers and automatically include them as a CMake linkable target, preferably at build generation time. In case the generator (either MCC or MHC) cannot be found, fail the project.
Currently thinking of creating a CMake custom function to do this job behind the scenes.
This is gonna be quite tricky -- since MHC (the old generator) and MCC (what MPLAB now includes) both use the chip's DFP for their generated drivers. The tricky part is that since the DFP must be kept in Conan (for version control purposes), the generator must always use the same version as in Conan. Current ideas:
Also, no undocumented behavior if at all possible.