iarsystems / iar-vsc-build

Visual Studio Code extension for developing and building IAR projects
https://marketplace.visualstudio.com/items?itemName=iarsystems.iar-build
Mozilla Public License 2.0
38 stars 5 forks source link

problemMatcher not working while using custom build system #25

Closed sbixl closed 2 years ago

sbixl commented 2 years ago

I'm using this extension in combination with an custom build system (CMake based), so i don't use iarbuild.exe or something else.

I would like to use the problem matchers "$iar-cc" and "$iar-linker" in my setup but it does not work (the problem view remains empty) if I set the following in my build task:

"problemMatcher": [
    "$iar-cc",
    "$iar-linker"                    
],

but if i add a custom problemMatcher it works like expected:

"problemMatcher": [
     {
         "owner": "iar-cc",
         "fileLocation": "absolute",
         "pattern": {
             "regexp": "^\"?([^\",]*)\"?,(\\d+)\\s+(Fatal error|Warning|Error)\\[([^\\]]*)\\]:(\\s*.*)$",
             "file": 1,
             "line": 2,
             "severity": 3,
             "code": 4,
             "message": 5
         }
     }, 
 ]

Is there anything else to consider while using this extension with CMake or any custom build system?

PS: I use "--no_wrap_diagnostics" as compiler and linker options.

HampusAdolfsson commented 2 years ago

This is expected behaviour; CMake (or any other build system) can use completely different formatting for warnings/errors. The problem matchers provided by this extension only work for the format used by iarbuild.exe.

Instead of supporting every popular build system with this extension, we generally recommend finding another extension for your specific build system (CMake Tools, for example, usually works well for CMake-based IAR projects).