Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 4.9.0
-
None
-
17270366f364e35d1fb98c7e6ce207387874b0cf
Description
I added PCH support to my project. With PCH clang code model can't parse files becouse .gch file compiled with gcc, not clang. Error from qt creator console:
qtc.cpptools.sourceprocessor: Parsing: "/usr/include/qt5/QtCore/qcompilerdetection.h" contents: 50616 bytes Arguments to libclang: -nostdinc -nostdinc++ -g -include /home/taurus/develop/PCHLinkTarget/debug/examples/widgets-qt5/CMakeFiles/widgets-qt5_pch.dir/pch.h -fPIC -std=gnu+11 -fsyntax-only -m64 --target=x86_64-redhat-linux -DQ_CREATOR_RUN -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I /home/taurus/Qt/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders -I /home/taurus/Qt/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore -I /home/taurus/develop/PCHLinkTarget/debug/examples/widgets-qt5 -I /home/taurus/develop/PCHLinkTarget/examples/widgets-qt5 -I /home/taurus/develop/PCHLinkTarget/debug/examples/widgets-qt5/widgets-qt5_autogen/include -I /usr/include/qt5 -I /usr/include/qt5/QtWidgets -I /usr/include/qt5/QtGui -I /usr/include/qt5/QtCore -I /usr/lib64/qt5/mkspecs/linux-g+ -isystem /usr/include/c+/9 -isystem /usr/include/c/9/x86_64-redhat-linux -isystem /usr/include/c/9/backward -isystem /home/taurus/Qt/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/7.0.0/include -isystem /usr/lib/gcc/x86_64-redhat-linux/9/include -isystem /usr/local/include -isystem /usr/include -I /tmp/QtCreator-juPttr/clang-uiheader-honcOc -fmessage-length=0 -fdiagnostics-show-note-include-stack -fretain-comments-from-system-headers -fmacro-backtrace-limit=0 -ferror-limit=1000 -x c+ -Wno-unknown-pragmas -Wno-unknown-warning-option -Wno-documentation-unknown-command -Wpedantic -v /home/taurus/develop/PCHLinkTarget/examples/widgets-qt5/main.cpp ... error: file '/home/taurus/develop/PCHLinkTarget/debug/examples/widgets-qt5/CMakeFiles/widgets-qt5_pch.dir/pch.h.gch' is not a valid precompiled PCH file
Test case here https://github.com/drizt/PCHLinkTarget.
To reproduce:
- Start Qt Creator
- Enable clang code model.
- Open PCHLinkTarget project.
- Open main.cpp source file.
Result. Very simple syntax highlighting, no parsed symbols.