Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41917

Precompiled header generation for Visual studio

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0
    • 4.8.6, 5.3.0
    • Build tools: qmake
    • None
    • reproducible in QT 4.8.6 or QT 5.3.0 with both VisualStudio 2008 and 2013
    • dc612acdc6577594c8f61345cea2de549d7aae34

    Description

      If one want to put header and body of precompiled headers files in separate folder, Visual Studio compilation will fail. In fact, qmake do not generate visual studio project well.

      PrecompiledHeaderFile attribute of precompiled body item in visual studio project is filled with file name only. It should take full path.

      Both choice to resolve this issue :

      • put your .h and .cpp in the same folder
      • or modify qmake; replace this line in QMake qmake/generators/win32/msvc_objectmodel.cpp file :
       
      CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompHFilename : QString("$(NOINHERIT)"));

      by

       
      CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompH : QString("$(NOINHERIT)"));

      I have attached an example project.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jbornema Joerg Bornemann
              quentin.brun Quentin Brun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes