Qt Creator Clang Code Model 4.8.1 not working for cross-compile with cmake toolchain file

  • I use a basic QtQuick application with CMakeLists.txt generated by qtcreator.
    I configured a basic desktop kit (specifying C/CXX compiler, Qt version, standard cmake settings).
    This desktop kit works fine for building and the Code Model works as expected.

    I also a crosscompiling kit using a Yocto SDK in which I only set the sysroot (/opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi), debugger and cmake.
    As cmake arguments I have:


    Qtcreator is able to compile with this kit, but the Clang Code model fails to find type_traits.

    By using export QT_LOGGING_RULES=qtc.clang*=true from Qt Creator Clang Code Model, I see that the include path is limited to just:

    #include "..." search starts here:
    #include <...> search starts here:
    End of search list.

    I found a similar topic on code model failure in cross compiling in which the issue is resolved by setting CMAKE_SYSROOT.

    I tried this both in the Project Build settings and by adding it to the toolchain file with either
    set( CMAKE_SYSROOT /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi )

    If I add it in the toolchain file I do not see CMAKE_SYSROOT in the project build settings.
    In both cases I don't see any difference in the code model behavior.

    Could this be a known issue that is resolved in a newer release or does anybody have a clue how to solve this?

Log in to reply