Code::Blocks

User forums => Using Code::Blocks => Topic started by: fruitCode on November 15, 2019, 04:13:20 pm

Title: errors not clickable for cmake generated project using ninja or make
Post by: fruitCode on November 15, 2019, 04:13:20 pm
Hello,

I have a project that is set-up for cmake. Cmake offers the possibility to generate a project file for codeBlocks.
When I generate a project file and open it I see my project files in the Projects workspace tree.
I can also trigger a project compilation by hitting CTRL-F9, it works like a charm.
I get some build errors in the "Build log" window in the bottom of the screen but I cannot click them. I expect that I can click them and that codeBlocks will open that specific file at the line where the error is reported.
I tried this using ninja and make as a build tool, both result in errors not being clickable.
An error looks like this:
"D:\Sources\git-repos\g0046-acu-mh_firmware_acm_2\03_Modules\01_CU_PlatForm\03_Implementation\include\ghdr\Compiler.h",27  Error[Pe020]:
          identifier "__huge" is undefined
  extern __huge U8BIT *CUBaseAddress;


I've used codeBlocks quite a lot in the past and I remembered this was working. Am I wrong? Are there any settings involved that can screw this up?

I tried using codeBlocks 17.12 and 13.12, both the portable version.

thanks

My question is: is
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: fruitCode on November 15, 2019, 05:45:05 pm
I see my post was cut-off somehow..
So my question is: should it work? (clickable errors) and are there any settings related that can influence this behavior? (incorrect settings screwing this up)
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: stahta01 on November 15, 2019, 07:51:34 pm
Are you using a normal CB project or a custom makefile cb project?

I believe that feature is not supported with custom makefile cb projects.

Tim S.
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: osdt on November 15, 2019, 08:33:17 pm
AFAIK this feature was never implemented for the "Build log". Use the "Build messages" tab to have CB show the file/line in question.

Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: oBFusCATed on November 16, 2019, 10:55:54 am
What is the compiler which you're using? The errors/warnings are detected using regular expressions. Most probably none of the regexs matches the line you've posted.
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: fruitCode on November 18, 2019, 10:47:21 am
Are you using a normal CB project or a custom makefile cb project?

I believe that feature is not supported with custom makefile cb projects.

Tim S.

I use a CB project file that is generated by the cmake utility so I guess its a custom one. I use cmake because I build for different targets (PC host for unit and integration tests and a simulator application) and an embedded target running on an ARM processor. Cmake is a great utility to assist in these kind of setups besides that it offers out of source building.
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: fruitCode on November 18, 2019, 10:48:51 am
AFAIK this feature was never implemented for the "Build log". Use the "Build messages" tab to have CB show the file/line in question.

In doesn't work in that tab either
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: fruitCode on November 18, 2019, 10:54:49 am
What is the compiler which you're using? The errors/warnings are detected using regular expressions. Most probably none of the regexs matches the line you've posted.

I am porting code from V850 to ARM, I use an IAR compiler but as an alternative path I also use the GCC ARM compiler (as cmake makes it really easy to have these different setups with fi different compilers for same project - yes I am a fan of it)
Your comment made me think so I tried with the GCC ARM compiler and yes, there it works like a charm. Thanks for hinting!

My conclusion is that the regex don't seem to match the IAR syntax
Title: Re: errors not clickable for cmake generated project using ninja or make
Post by: oBFusCATed on November 18, 2019, 07:44:36 pm
You can add a IAR compiler and then you can tell cmake to use it as the compiler for your project. See https://cmake.org/cmake/help/v3.16/variable/CMAKE_CODEBLOCKS_COMPILER_ID.html

If you make a IAR setup we'll be happy to review and accept a patch. :)