Author Topic: errors not clickable for cmake generated project using ninja or make  (Read 3720 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12898
    • Travis build status
Re: errors not clickable for cmake generated project using ninja or make
« Reply #15 on: December 19, 2019, 08:39:29 pm »
Is it capable of processing multiple lines?
I don't think this is possible. The compiler output is processed line by line. Generally GCC and Clang also have moved to multiline error message, so we'll have to tackle this problem sooner or later.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline fruitCode

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: errors not clickable for cmake generated project using ninja or make
« Reply #16 on: December 20, 2019, 09:37:06 am »
Allright, no multi-line processing yet.

To complete this post for later reference; I could not find references for CMAKE_CODEBLOCKS_COMPILER_ID in the manual. But they are just sequence numbers from the compiler list that you see in codeBlocks when selecting a compiler for your project. In my case "IAR ARM Compiler" is the 29th entry in the list so I added the following line to my CMakeLists,txt and that works like a charm!

SET(CMAKE_CODEBLOCKS_COMPILER_ID 28)

(Note: entry number is 28 because list count starts at 0)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12898
    • Travis build status
Re: errors not clickable for cmake generated project using ninja or make
« Reply #17 on: December 20, 2019, 09:41:39 am »
Hm, this is bad. It should be the short string as stored in the project file.
« Last Edit: December 20, 2019, 10:49:26 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline fruitCode

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: errors not clickable for cmake generated project using ninja or make
« Reply #18 on: January 02, 2020, 11:13:20 am »
You are right, I was mistaken.
What you have to add to your cmake file is:

SET(CMAKE_CODEBLOCKS_COMPILER_ID "iararm" CACHE STRING "Preferred codeblocks compiler ID")

This will generate a codeblocks project file where the compiler is set as IAR ARM

Offline fruitCode

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: errors not clickable for cmake generated project using ninja or make
« Reply #19 on: January 02, 2020, 11:18:52 am »
Another update here for future reference. I had a look at the sources of codeblocks, it seems that error regex parsing is done per line. So to my opinion its not a quick fix to have multi-line regex processing as it takes quite some edits..

In the meantime I found a work-around, the IAR ARM compiler (iccarm) has an option --no_wrap_diagnostics that forces the error messages to be one line. The corresponding regex is then:
"(.*)",([0-9]+)[ \t]+Error\[(.*)\]:[ \t]*(.*)

Where the sub-expression indices are:
Message: 3
Additional message: 4
Filename: 1
Line: 2

Hope this helps others while configuring for IAR ARM