My goal is to be able to put RPC or HTTP handler code into my C application for debugging and not have to manually comment out code when I remove the RPC and HTTP server from my mos.yml for production.
I have hunted around in the generated code, and it appears a good way to determine if libraries are included is to look for their configuration items (which are compiled into mgos_config.h). For example, to determine if RPC is available, I can
#ifdef MGOS_CONFIG_HAVE_RPC // set up RPC handlers #endif #ifdef MGOS_CONFIG_HAVE_HTTP // set up HTTP handlers #endif
Is this the best/recommended way to do this, or is there a better mechanism?