Qt Creator + IAR



  • Hi. I have a project on IAR and basically I want to use Qt for editing and building the project. IAR have a custom compiler and linker. It's CR16 platform, so my case is really unusual. How to archive this goal?

    I tried already qbs and it's not working. As I understood it works with gcc compiler only and I don't know how to configure it. I also configured a compiler https://drive.google.com/file/d/0BxgcZhMUJY8_NHh1SlduZENkTFk/view and made a kit https://drive.google.com/file/d/0BxgcZhMUJY8_dFp3dFlRSnJnMm8/view

    On this point I don't need debugger support, only building, support of build configuration there I can include or exclude files from build, and see an errors from build.

    I tried to import generic project but it's not what I need, it just a code editor with some strange syntax errors (I have no such errors in IAR). So I thought I need qbs or cmake project and import everything in it.

    Thanks



  • I tried already qbs and it's not working.

    You should use QBS for this case. But do not configure your compiler from QtCreator pages. You need to write your own Rules and so on in the QBS project file directly instead.

    As example, you can see on this : http://habrahabr.ru/post/258467/
    (but you need translate it from russian :) )



  • @kuzulis No problem, Russian is my first language :)
    I've read the post on habra and it clarifies a bit, but as I've seen it people did it only with gcc compilers. I've read from here http://qbs.qt-project.narkive.com/OgnPBsYP/how-to-setup-an-custom-profile-without-qt that you have to create some profilers for qbs and I tried it but in vain.



  • I've read from here

    It I asked this question there. :)

    you have to create some profilers for qbs

    No, this will not work with the custom compilers (like IAR, Keil and so on), because the QBS internally knows pre-defined toolchain types like, Clang, GCC, MinGW, MSVC only... If I am not mistaken.

    BTW: I used similar approach (with the custom rules) for the Keil compiler... So, it is possible to do. ;)



  • @kuzulis Ok, that's why it shows me an error "...cpp\genericunix-gcc.qbs:34: error: TypeError: Result of expression 'qbs.toolchain' [undefined] is not an object." and piece of the code:
    UnixGCC {
    condition: !qbs.toolchain.contains('mingw') && !qbs.targetOS.contains('darwin') && !qbs.targetOS.contains('linux') && qbs.toolchain.contains('gcc')
    }

    I was afraid of that and it's frustrating. Is it possible to use cmake instead?

    BTW: I used similar approach (with the custom rules) for the Keil compiler... So, it is possible to do. ;)
    So how you did it then? Keil have a gcc compiler or you did some hack for qbs?



  • Is it possible to use cmake instead?

    I don't know.

    So how you did it then? Keil have a gcc compiler or you did some hack for qbs?

    I created the new 'Keil' module, similar to modules from 'qbs\share\qbs\modules\cpp' as 'qbs\share\qbs\modules\keil'
    In this module I specified the paths to the Keil compiler, linker and so on, and modified appropriate Rules.

    And then instead of using:

    Depends { name: "cpp" }

    need just use:

    Depends { name: "keil" }

    for the Keil projects.



  • @kuzulis Right... If you still have it can you share with your module please? I'll modify it for IAR.



  • No, sorry. I have not it now.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.