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

PRE_TARGETDEPS generating a file to be compiled fails in parallel builds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.7.2
    • Build System
    • None

    Description

      I have a Python script that generates a source file to be compiled. I use QMAKE_EXTRA_TARGETS/PRE_TARGETDEPS to tell QMake that this script must be executed before files are compiled. So I do, in my pro file:

      CONFIG += ordered

      generated_file.target = my_custom_target
      generated_file.commands = echo "Generating..." && d:/dev/vobs_ext_2015/tools_ext/python/Python34_light/python.exe $$PWD/pyc_res_generator.py -o $$PWD/generated/generated.cpp && echo "Generated!"
      generated_file.depends = FORCE

      QMAKE_EXTRA_TARGETS += generated_file

      PRE_TARGETDEPS += my_custom_target

      SOURCES += generated/generated.cpp

       

      But when I ask to compile the project with parallel builds enabled (MAKEFLAGS set to -j8), "Generated" is displayed after generated.cpp is compiled. The system should wait for the custom command to be completed before generating its target, it's not the case.

      See https://stackoverflow.com/questions/50584019/pre-targetdeps-fails-when-using-parallel-builds for more information.

      Attachments

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

        Activity

          People

            buddenha Oswald Buddenhagen
            jpo38 Jean Porcherot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes