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

cli_TEST: Fix compatibility with CLI11 2.0 #60

Merged
merged 1 commit into from
May 17, 2022

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented May 13, 2022

🦟 Bug fix

Fixes compatibility with CLI11 2.0

Summary

If IGN_UTILS_VENDOR_CLI11 is set to OFF and CLI11 >= 2.0 was used, the compilation failed with:

2022-05-13T06:56:23.1223336Z [ 87%] Building CXX object cli/src/CMakeFiles/UNIT_cli_TEST.dir/cli_TEST.cc.o
2022-05-13T06:56:25.1811635Z /home/conda/feedstock_root/build_artifacts/libignition-utils1_1652424878233/work/cli/src/cli_TEST.cc: In function 'std::shared_ptr<TestOptions> addFlags(CLI::App&)':
2022-05-13T06:56:25.1816895Z /home/conda/feedstock_root/build_artifacts/libignition-utils1_1652424878233/work/cli/src/cli_TEST.cc:89:40: error: no matching function for call to 'CLI::App::add_option(const char [16], float&, const char [26], bool)'
2022-05-13T06:56:25.1817859Z    89 |       "Option with default value", true);
2022-05-13T06:56:25.1818289Z       |                                        ^
2022-05-13T06:56:25.1819571Z In file included from /home/conda/feedstock_root/build_artifacts/libignition-utils1_1652424878233

This is due to the the following change described in the changelog ( https://github.com/CLIUtils/CLI11/blob/main/CHANGELOG.md#version-20-simplification ):

The final "defaulted" bool has been removed, use ->capture_default_str() instead. Use app.option_defaults()->always_capture_default() to set this for all future options. CLIUtils/CLI11#597

Fortunatly, the suggested change works fine also with the vendored copy of CLI11, so we can just switch to that version to be future proof.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@traversaro traversaro requested a review from azeey as a code owner May 13, 2022 15:13
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label May 13, 2022
Signed-off-by: Silvio <silvio@traversaro.it>
@chapulina chapulina merged commit 64fea9a into gazebosim:ign-utils1 May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants