Comments (11)
This is definitely a feature I want to add. It will take a bit of work, as reliably parsing the error output from the different compilers can be difficult. Some compilers (such as Clang) offer machine-parsable output options, so that will be a good place to start.
from vscode-cmake-tools.
Does jump working for now? I remember it used to work. But not now for me.
from vscode-cmake-tools.
I've got it on Windows using a Visual Studio CMake generator.
The tips is to define a custom task in tasks.json that runs cmake --build
and specify '$msCompile' as problemMatcher
{
"version": "0.1.0",
// cmake --build build
"command": "build.bat",
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// no args
"args": [],
// use the standard msCompile problem matcher to find compile problems
// in the output. cmake must use a Microsoft Generator
"problemMatcher": "$msCompile"
}
As you can see, when the task is executed, the output is analyzed and you can navigate to the warnings and errors
For clang or gcc you can define your own problemMatcher based on regexp, you can find an exemple with gcc here
Hope this can help you...
from vscode-cmake-tools.
Thanks for the info! That'll definitely help. I'll play around with it and see what I can make work.
from vscode-cmake-tools.
I've been working on a kind-of solution on the feature/diagnostics-parsing
branch. Rather than make a problem matcher, I parse the build output when running the cmake.build
command.
I wish that it were possible to use a vscode command in place of the "command" on a task, rather than the name of an external program. The cmake.build
command does quite a bit more than simply invoke cmake --build build
, and I'd like to be able to use the problemMatcher functionality in conjunction with the custom command. Any opinions on which design would be better?
Parsing the output of GCC and Clang seems to work pretty well, although I don't have quick access to a Windows machine where I can test the MSVC output parser (but it should work). Any MSVC users available to give it a try?
from vscode-cmake-tools.
I just try it,
It seems there is a little problem in the MSVC Regex, I'll fix it today and send you a PR.
from vscode-cmake-tools.
This should be fixed as of 0.3.0. Thanks for the help!
from vscode-cmake-tools.
Is parsing the output hard-coded into the sources? What if I need to parse an unknown (even non-C) compiler output? When I compile via Run Build Task
, I add an appropriate problem matcher to tasks.json
and everything works. What about CMake tools? Impossible?
from vscode-cmake-tools.
At the moment, there is not, unfortunately.
from vscode-cmake-tools.
I'm quite new to cmake tools, so excuse me for a dumb question: why to invent your own build system (with custom problem parsers etc.) but not just integrate with vscode build tasks?
from vscode-cmake-tools.
Early on I tried to do tasks.json
integration, but there was a strong impedance mismatch between what tasks.json
supported and what CMake required. I haven't taken a look for a while, so that may have changed, but it has in the past not been sufficient to run builds as required.
from vscode-cmake-tools.
Related Issues (20)
- Setting cmake.loadCompileCommands not documented HOT 1
- Supply arguments to debug/launch button from statusbar
- Typo: "unknow" instead of "unknown" HOT 1
- Investigate and track colorized CMake/Build output API dependencies HOT 6
- Display flat list of targets for Project Outline view
- default launch debug attempts to use unsupported debuggers HOT 3
- [Windows][Ninja] "configurePresets.environment" does not apply to Launch or Debug HOT 3
- Updates to CMake Quick Start: v2 HOT 2
- [MacOS 14.5]Why the CMake-Tools extension does not display in English? HOT 10
- compile_command.json is not generated, but cmake has set CMAKE_EXPORT_COMPILE_COMMANDS=ON HOT 2
- [Engineering] Make `getArchitecture` the source of truth for parsing the architecture.
- [Feature] Select root CMakeLists.txt HOT 1
- [feature] CMake output panel does not display color HOT 1
- Environment of sourcing '.bashrc' is not working sometimes in cmake-tools on Linux HOT 16
- No installed `lldb` debugger is automatically discovered on newer macOS versions HOT 2
- Add `onSelectedConfigurationChanged` event to the API
- Compile active file does not work HOT 6
- CMake Quick Start command asks user to browse a CMakeLists.txt HOT 3
- ${workspaceFolder} is not resolved in cmake.debugConfig HOT 9
- Multiple project roots not configured when one root is a subdirectory of the other HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-cmake-tools.