summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-03-22 15:17:02 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-03-22 14:40:48 +0000
commit890ddd254087da9a6008e9fe5639ffd3a35f1b8b (patch)
treeaaa7a436224fa530c7ce4275ce2fd3d86b4ec8f9
parent5fd30d0a189a956e83e66f19beed61efae757e54 (diff)
Fix AUTOMOC and friends to run only once the tools are built
While building on macOS, AUTOMOC sometimes hanged indefinitely. The problem was that AUTOMOC was executed for the qmacstyle plugin before moc was actually built. Because of an upstream bug in CMake, AUTOMOC was caught in a deadlock without reporting that spawning the moc process failed. Specifically if a libuv spawn() call failed, the condition variable for a waiting thread was not notified, and the thread kept waiting forever for the process launch to finish. Fix the dependency by setting the AUTOGEN_TARGET_DEPENDS property on all targets that have AUTOGEN tools enabled. This makes sure that moc and friends are built before they are used. Also add some special cases to disable autogen tools on certain targets to break cycles between targets. Fixes: QTBUG-74636 Change-Id: I6e689e63cba1962525f169f332a58498d173c0a6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
-rw-r--r--cmake/QtBuild.cmake1
-rw-r--r--src/corelib/CMakeLists.txt2
-rw-r--r--src/tools/uic/CMakeLists.txt2
3 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index dd9d5b1693..bc07da27ba 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -321,6 +321,7 @@ function(qt_autogen_tools target)
PROPERTIES
AUTO${captitalAutogenTool} ON
AUTO${captitalAutogenTool}_EXECUTABLE "$<TARGET_FILE:Qt::${autogen_tool}>")
+ set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS Qt::${autogen_tool})
endforeach()
set_directory_properties(PROPERTIES
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 3484e2b15e..e1d827d0ee 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -242,6 +242,8 @@ add_qt_module(Core
ZLIB::ZLIB
PUBLIC_LIBRARIES # special case:
Qt::Platform
+ DISABLE_AUTOGEN_TOOLS # special case:
+ uic
# ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar"
# ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so"
# ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE"
diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt
index 46826b7d52..15ef92a2b4 100644
--- a/src/tools/uic/CMakeLists.txt
+++ b/src/tools/uic/CMakeLists.txt
@@ -27,6 +27,8 @@ add_qt_tool(uic
QT_UIC_CPP_GENERATOR
INCLUDE_DIRECTORIES
cpp
+ DISABLE_AUTOGEN_TOOLS # special case:
+ uic rcc
# QMAKE_TARGET_DESCRIPTION = "Qt User Interface Compiler"
# _LOADED = "qt_tool"
# _OPTION = "host_build"