Fix multi-thread GNU make build

Add the timestamp file creation for configure-time executables.
GNU make treats the custom command artifacts as 'dirty' when one of
the expected outputs is missing. It displays the following disclaimer

  Deleting primary custom command output ... because another output
  ... does not exist.

which leads to the configure-time executable rebuild. The removal
and rebuild is not in sync with the dependency lookup for other
targets(thanks to GNU make) so targets that depend on the
configure-time executables simply miss the dependency at build time.
This happens to syncqt and '_sync_headers' targets. So creating
the timestamp file at configure time indicates to GNU make that
there is no need of removing the syncqt executable and the build
process doesn't fail because of missing dependency.

Fixes: QTBUG-112018
Fixes: QTBUG-111163
Pick-to: 6.5
Change-Id: I6c1e8cae522104cf50d0376fa2b5653a6770f9ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2023-04-04 13:16:49 +02:00
parent 65d79fb5f3
commit db705d0794

View File

@ -470,6 +470,7 @@ function(qt_internal_add_configure_time_executable target)
OUTPUT_VARIABLE try_compile_output
)
file(WRITE "${timestamp_file}" "")
if(NOT result)
message(FATAL_ERROR "Unable to build ${target}: ${try_compile_output}")
endif()