Active Target does not allow special or multiple targets
Once the extension has built up its target list it's only possible to select one of the offered targets which are somehow filtered it seems. So I can neither set e.g. ninja folder targets like src/all nor can I give multiple targets to build exactly what I need for my work. If the target is not in the list it should just be accepted as-is and passed to ninja.
Platform and Versions
- Operating System: Win10 Remote WSL Ubuntu 20.04
- CMake Version: 3.17
- VSCode Version: 1.47
- CMake Tools Extension Version: 1.4.1
- Compiler/Toolchain: clang-10
I'm particularly interested in the filtering issue. We've also noticed it strips out folder/all named targets, which we often want to build. The only workaround we've found is to set CMake Tools not to configure on opening a folder, open the target picker which lets you type arbitrary text since it hasn't got a filter list yet, then press build. CMake Tools will pass your arbitrary string to CMake for building - so long as you've picked a folder/all target, it works.
Is there any chance of a quick resolution to it filtering out these targets?
The workaround I'm using is the build using task setting.
Would either of you be able to provide a sample project that has the targets you're talking about? That would make it easier for one of us maintainers or someone in the community to pick up this feature request and implement it.
(This is not a statement that we'll get to it right away. It's just a way to make it more likely that someone can hit the ground running with this and implement it sooner.)
Thanks!
I guess any project with multiple targets generating Ninja files will do.
That's right. The attached is a simple setup with CMake targets defined in two subfolders. CMake generates targets named FolderA/all and FolderB/all for conveniently building all targets in those subfolders, but they aren't picked up by CMake Tools in either the target picker or Project Outline pane.
https://cmake.org/cmake/help/latest/generator/Ninja.html
They are displayed if you generate then run ninja -t targets all from the command line, but there's a lot of other internal gubbins listed there too. I don't know what method CMake Tools uses to discover the target list.
https://ninja-build.org/manual.html#_extra_tools
This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.
Still valid?
Yes, I'm still hopeful for this, as it's not available in the latest CMake Tools. @bobbrow is there enough info to understand what we'd like?
@andrewmcdonald-oxb There does seem to be enough information to investigate this at our soonest availability, thanks for providing a sample project. Based on bandwidth, we will investigate this when we can. Also, we are happy to take open-source contributions for this feature!
That would be a real time saver in large projects. On the UI design side it would make sense to add checkboxes in target picker similar to branch picker in a popular eamodio.gitlens extension.