Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.7.2
-
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.