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

qmake does not add cpp files to SOURCES / OBJECTS sections in Makefile, when the same cpp file is included into another cpp file.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.0.0
    • Build tools: qmake
    • None
    • Linux/Mac
    • macOS

    Description

      WebKit is using so called *AllInOne.cpp files for including several other cpp files. This is done to build a single object file for several cpp files and by this reducing the static library size. For the QtWebKit port we need to ifdef out a few of these included cpp files but we can't delete them, because they are required for other pors.

      The problem is, that whenever such an include statement contains a filename that is also part of the SOURCES list in the pro file, the file will be removed from the SOURCES list in the generated Makefile.

      Please see the attached project:

      • Just untar it and execute qmake.
      • check the SOURCES and the OBJECTS sections in the Makefile.
        Unable to render embedded object: File (The attached sample is not supposed to compile, it only serves the purpose of showing the bug in qmake) not found.

      I understand that this behavior might have been added on purpose as an optimization.
      But i consider it rather harmful, because qmake does not respect ifdef statements. And therefore will remove a file from the SOURCES section, even if it is "ifdefed out" in the cpp file.

      Attachments

        Issue Links

          Activity

            People

              qtbuildsystem Qt Build System Team
              albisser Zeno Albisser
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: