I’m working on library X, a feature I would like to add depends on library Y being present; but its presence depends on application developer (user)'s choice
How can I know if library Y is being compiled ?
e.g.:
if (mgos_sys_config_get_libY_enable()) { // if libY is enabled
const char *sf = mgos_sys_config_get_libY_somekey(); // get somekey defined there
}
but the app developer may choose not to include rpc-gcp and those function calls are not available
Ideas:
A mechanism for providing weak stubs ?
Any preprocessor trick ?
Something on the YAML file ? Perhaps defining those config keys myself is a bit too invasive…
Parsing the config file instead ?