Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: Don't emit _PRESENT macros #78

Merged
merged 1 commit into from
Oct 12, 2020

Conversation

Patater
Copy link
Contributor

@Patater Patater commented Sep 29, 2020

Description

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.

This should be merged immediately before the Mbed OS companion PR is ready. Then, we should merge this PR, do a tools release, merge Mbed OS example PRs, and merge the Mbed OS PR. Without Mbed OS having updated CMake files, these tool changes will break some builds.

Test Coverage

  • This change is covered by existing or additional automated tests.
  • Manual testing has been performed (and evidence provided) as automated testing was not feasible.
  • Additional tests are not required for this change (e.g. documentation update).

@@ -47,7 +47,7 @@ def _render_mbed_config_cmake_template(
"""
env = jinja2.Environment(loader=jinja2.PackageLoader("mbed_tools.build", str(TEMPLATES_DIRECTORY)),)
template = env.get_template(TEMPLATE_NAME)
options = list(config.options.values())
options = [x for x in config.options.values() if not x.key.endswith(".present")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to apply this filtering where we create the config "options" here

for key, value in source.config.items():
? If not could we at least have a comment as to why we filter this and maybe a TODO to remove this when we refactor the mbed config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what refactoring of mbed config you have in mind here. Perhaps we should raise a GitHub issue for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant refactoring of the mbed configuration system to remove these macros from the mbed_lib.json files.

@Patater Patater force-pushed the dev/Patater/no-present-macros branch from 3e28dba to d2e6418 Compare October 7, 2020 15:04
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.
@Patater Patater force-pushed the dev/Patater/no-present-macros branch from d2e6418 to 9ffb7db Compare October 7, 2020 15:09
@Patater Patater changed the title WIP configure: Don't emit _PRESENT macros configure: Don't emit _PRESENT macros Oct 7, 2020
Copy link
Contributor

@rwalton-arm rwalton-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Patater Patater merged commit 231dbc4 into master Oct 12, 2020
@Patater Patater deleted the dev/Patater/no-present-macros branch October 12, 2020 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants