-
Notifications
You must be signed in to change notification settings - Fork 2
Add support for --ament-cmake-args option #41
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
base: master
Are you sure you want to change the base?
Conversation
| - name: Install and Run pre-commit | ||
| uses: pre-commit/[email protected] | ||
| with: | ||
| extra_args: --all-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you running the pre-commit hooks in the CI?
That would mask any formatting issues that were committed.
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v20.1.4 | ||
| hooks: | ||
| - id: clang-format | ||
| name: Clang Format | ||
| args: [--style=file] | ||
| files: \.(cpp|hpp|h|c|cc)$ | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: cppcheck | ||
| name: Cppcheck | ||
| entry: bash -c "cppcheck --force --quiet --inline-suppr --error-exitcode=1 --language=c++ $(find . -type d -name 'cmake-build-*' -prune -false -o -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c' -o -name '*.cc')" | ||
| language: system | ||
| files: \.(cpp|cc|hpp|h)$ | ||
| pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no and probably never will be any CPP in this repo.
| build_base: str = "build", | ||
| install_base: str = "install", | ||
| cmake_clean_cache: bool = False, | ||
| ament_cmake_args: list[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, your default value is violating the type annotation.
This is also wrong for the mixin arg, though.
| ) | ||
| if ament_cmake_args: | ||
| arguments += ["--ament-cmake-args"] + list( | ||
| map(lambda x: f"{"-D" + x}", ament_cmake_args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be other arguments than -DVAR=VALUE, or is that the only argument allowed to be passed to ament cmake?
And it's a bit weird to use a format string and then just concatenate the string in an expression.
Should be f"-D{x}"
Main use is for setting cmake varaibles i.e. colcon build --ament-cmake-args -DVAR=VALUE
This is currently used for python-cmake packages to rebuild the venv manually by setting: -DSKIP_VENV=OFF
Syntax for hector build would be:
hector build --ament-cmake-args SKIP_VENV=OFF ISOLATED=ON ...
Also includes a small ci update, due to a formatting error from the old version.