colcon / colcon-cmake

Extension for colcon to support CMake packages
http://colcon.readthedocs.io
Apache License 2.0
16 stars 25 forks source link

Add support for `Ninja Multi-Config` #106

Closed KazNX closed 2 years ago

KazNX commented 2 years ago

The Ninja Multi-Config generator was introduced as part of CMake 3.17 supporting debug and release artefacts under the same build directory, like Xcode or Visual Studio. This change allows colcon to recognise Ninja Multi-Config as a mult-config generator and as a Ninja generator.

Note that in practice this change does not support an apt-get install of CMake on versions of current Ubuntu LTS releases - Unbutu 20.04 (latest current LTS) provided CMake version 3.16.

Change summary:

KazNX commented 2 years ago

Checking failures. Not sure how to enforce these locally. I am running a linter.

KazNX commented 2 years ago

I don't think the flake8 failures are due to code I've introduced in the PR. Please advise.

KazNX commented 2 years ago

PR has been rebased onto master fixing the CI check failures.

hidmic commented 2 years ago

@dirk-thomas thoughts before merging?

KazNX commented 2 years ago

Note that in practice this change does not support an apt-get install of CMake on versions of current Ubuntu LTS releases - Unbutu 20.04 (latest current LTS) provided CMake version 3.16.

Hmm, IIUC the change should be transparent for earlier versions -- the generator simply won't ever match.

This was something I was thinking about. The explicitly check for Ninja Multi-Config is fine because we only want to report this explicit generator as being a multi-condig ninja generator.

The compatibility issue is more to make sure Ninja Multi-Config is recognised as also being Ninja.

When I was looking, I found this line (pre-existing this PR).

Note the check is if 'Ninja' in generator and not a straight equality test, so this will match both.

That said, in reviewing your comment I found this line is an equality test. Will fix.