summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-04-16 12:49:16 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-04-16 14:40:12 +0000
commit51b7fbb62647226d4527f9bc695d8df2a7b194d2 (patch)
tree4197d355a78b570fe0866ee94738afe254872184
parent6630937e63ae5797487b86743a7733c8ae5cc42c (diff)
Work around issue of missing Windows qtmain static library
Applications that have the WIN32_EXECUTABLE property set, must have a WinMain function. In qmake's case, this function is provided by the qtmain static library. Until that is implemented in CMake land, disable the property on Windows for all qt executables. This fixes the linker issues while building examples. Task-number: QTBUG-75195 Change-Id: I323d4dd899f716cd6b9b7f4b5ecb76b22f462fc4 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--cmake/QtBuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 84769a4eb8..f881c3eabd 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -852,6 +852,12 @@ function(add_qt_executable name)
MACOSX_BUNDLE "${arg_GUI}"
)
+ if(WIN32)
+ # Workaround for not having ported the winmain / qtmain static library
+ # which is always linked in by qmake.
+ set_target_properties("${name}" PROPERTIES WIN32_EXECUTABLE 0)
+ endif()
+
if(NOT arg_NO_INSTALL)
install(TARGETS "${name}"
RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}"