Compiling with IAR

已回答

Hello,

I'm successful implemented a unsupported compiler by setting up a custom toolchain.
It compiles and all, but code competition does not work, in particular seem like include() from CMakeList are ignored, while they work if I choose a "default" toolchain.

When I set up my custom toolchain i get the following error, which in my opinion prevent the correct setup of the code analisis (please note compilation and resulting file works fine)

Cannot get compiler information:
    Compiler exited with error code 2: C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin\iccarm.exe -xc -IXXXX -IXXXX -IXXX -IXXX --cpu Cortex-M3 --c++ -Ohs -r -D STM32F10X_MD -e -fpch-preprocess -v -dD -E
    Command line error: Unable to open the command file "pch-preprocess"

 

it seems to me it is testing the compiler by running the option "-fpch-preprocess" that is seen from my toolchain as trying to compile the file "pch-preprocess", and of course the error is file not found.

Is there a way to avoid such test? or to manipulate the option so i can get compatible with my toolchain?

0

Hi! CLion supports only GCC/GCC-based, Clang and MSVC compilers. Some unsupported compilers still can successfully work in CLion, but, unfortunately, it looks like your compiler is not from those. Feel free to create a feature request in our tracker: https://youtrack.jetbrains.com/issues/CPP

0

Hello anna,

The compiler works, is just "clang tidy" that get confused and does not "see" the include_directory() from the CMakeList.txt.

I'll open a bug, but is there a way to temporally stop clion to test for compiler option?

0

I'm not sure whether the fact that code analysis doesn't work correctly with an unsupported compiler can be considered as a bug. More like a feature request to support it.

Unfortunately, there is no such option.

 

0

请先登录再写评论。