diff --git a/news/20200929160957.misc b/news/20200929160957.misc new file mode 100644 index 00000000..7065d3b2 --- /dev/null +++ b/news/20200929160957.misc @@ -0,0 +1 @@ +Don't emit _PRESENT macros. Depend on Mbed OS to define these from CMake. diff --git a/src/mbed_tools/build/_internal/config/config.py b/src/mbed_tools/build/_internal/config/config.py index 8a99f565..450bfd63 100644 --- a/src/mbed_tools/build/_internal/config/config.py +++ b/src/mbed_tools/build/_internal/config/config.py @@ -104,6 +104,14 @@ def from_sources(cls, sources: Iterable[Source]) -> "Config": config = Config() for source in sources: for key, value in source.config.items(): + # If the config item is about a certain component or feature + # being present, avoid adding it to the mbed_config.cmake + # configuration file. Instead, applications should depend on + # the feature or component with target_link_libraries() and the + # component's CMake flle (in the Mbed OS repo) will create + # any necessary macros or definitions. + if key.endswith(".present"): + continue _create_config_option(config, key, value, source) for key, value in source.overrides.items(): if key in IGNORED_OVERRIDE_KEYS_IN_SOURCE: