Skip to content

Commit

Permalink
configure: Don't emit _PRESENT macros
Browse files Browse the repository at this point in the history
Do not put macros like MBED_CONF_FILESYSTEM_PRESENT or
MBED_CONF_EVENTS_PRESENT into the applicaiton's generated
mbed_config.cmake file. We will depend on Mbed OS CMake files for each
of these components to define the _PRESENT macro in a
target_compile_definitions() block for the e.g. filesystem or events
CMake targets.
  • Loading branch information
Patater committed Oct 12, 2020
1 parent 08f8b67 commit 231dbc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/20200929160957.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't emit _PRESENT macros. Depend on Mbed OS to define these from CMake.
8 changes: 8 additions & 0 deletions src/mbed_tools/build/_internal/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 231dbc4

Please sign in to comment.