Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-141

PCH dependency not added for generated moc_*.cpp files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 0.2
    • 0.2
    • None
    • QBS 926d05d4f4e3cd5939b8d2a48f7cd52f203b0625 (Sept 27th)
      Ubuntu 12.10 Beta 1 x64
      Qt 4.8.3 x64 (from ubuntu repo)
      GCC 4.7.2
    • 6254235df9e2895281a2dea38752db4a9547abc4

    Description

      Enabling precompiled header in a project where some header files need to be moc'ed causes a build failure because the new build rules dynamically added for app -> moc_x.o -> moc_x.cpp -> x.h lack a moc_x.o -> pch_output dependency.

      This usually results in moc_x.cpp files being compiled before/during pch compilation (depending whether doing -j1 or a parallel build), thus resulting in either:

      1) moc_x.cpp compilation failing due to missing PCH
      2) moc_x.cpp compilation failing due to invalid PCH

      In addition, the graph output by "qbs graph" for the same project is very different in the 3 following cases:

      1) $ qbs clean && qbs graph # Graph OK, moc rules not yet present.
      2) $ qbs clean && qbs -j1; qbs graph # New moc rules miss dependency on PCH
      3) $ qbs clean && qbs -j8; qbs graph # ALL .o -> .cpp rules miss dependency on PCH

      I have attached a small project that show all those issues.

      Attachments

        1. qbs_graph_after_clean.png
          28 kB
          Alexandre Cossette-Pacheco
        2. qbs_graph_after_qbs_-j1.png
          32 kB
          Alexandre Cossette-Pacheco
        3. qbs_graph_after_qbs_-j1.png
          32 kB
          Alexandre Cossette-Pacheco
        4. qbs_pch_issue.tar.gz
          80 kB
          Alexandre Cossette-Pacheco
        For Gerrit Dashboard: QBS-141
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            acossette Alexandre Cossette-Pacheco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes