Skip to content

[13884] Use a single optionparser header for all tools and examples #2508

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

Merged
merged 7 commits into from
Feb 18, 2022

Conversation

MiguelBarro
Copy link
Contributor

@MiguelBarro MiguelBarro commented Feb 17, 2022

This implies distributing the third-party header as an interface table to allow the examples to be built standalone.
The version of the parser used is this.
Windows installers have been successfully tested already.

@MiguelBarro
Copy link
Contributor Author

@richiprosima please check style

Copy link
Contributor

@JLBuenoLopez JLBuenoLopez left a comment

Choose a reason for hiding this comment

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

LGTM! I have just left a comment regarding the header guard. Let me know what you think. I have tested successfully this PR in Ubuntu Focal.

Comment on lines 20 to 21
#ifndef OPTIONPARSER_HPP_
#define OPTIONPARSER_HPP_
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think there could be any conflict with other external header guards if Fast DDS is integrated in an external project? Maybe we should increase the uniqueness of the header guard with the path or a reference to Fast DDS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. Let's try FASTDDS_OPTIONPARSER_HPP_ to match the target name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In hindsight, you have uncovered an actual issue because the original file guard is OPTION_PARSER_H_ and will be enforced. Thus it's not possible to use our optionparser.hpp with the original optionparser.h in the same source file 🙇‍♂️.

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 miss the simplicity of #pragma once

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are going to apply the workaround of disabling the internal OPTION_PARSER_H_ guard when using the outer one.

@MiguelBarro MiguelBarro force-pushed the feature/one_optionparser_to_rule_them_all branch from 3fbb3b1 to d6ee157 Compare February 17, 2022 14:49
@JLBuenoLopez JLBuenoLopez added this to the v2.5.1 milestone Feb 17, 2022
Copy link
Contributor

@JLBuenoLopez JLBuenoLopez left a comment

Choose a reason for hiding this comment

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

LGTM

@JLBuenoLopez JLBuenoLopez added the ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. label Feb 18, 2022
@MiguelCompany MiguelCompany merged commit e742813 into master Feb 18, 2022
@MiguelCompany MiguelCompany deleted the feature/one_optionparser_to_rule_them_all branch February 18, 2022 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants