If I use gcc, my toolchain file has those lines amongst others:
When I want to use clang, those lines change to:
Building process works in both cases without any visible issues in both QtCreator and by manually launching cmake with proper arguments (cmake -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE=arm_(gcc|clang).cmake). However, if I inspect code model in QtCreator, the version with clang doesn't add the following include directories:
Manually adding the mentioned directories is possible only for the first four as adding the last one has no effect on code model.
The effect is that clang code model cannot find stdlib headers and, for instance, finds incorrect boost headers (from /usr/include/boost instead of CMAKE_SYSROOT/usr/include/boost)
Kits have rather standard options with only one cmake variable CMAKE_TOOLCHAIN_FILE (as CMAKE_<LANG>_COMPILER are defined inside CMAKE_TOOLCHAIN_FILE) pointing to various toolchain files (either gcc which works find or clang which doesn't).
So basically, cross compiling with clang that uses non standard gcc location (so --gcc-toolchain parameter must be set) works but clang code model doesn't cope with it.
Is there any workaround for this problem?