diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 4 | ||||
-rw-r--r-- | src/corelib/doc/src/qtcore-index.qdoc | 2 | ||||
-rw-r--r-- | src/entrypoint/CMakeLists.txt (renamed from src/winmain/CMakeLists.txt) | 10 | ||||
-rw-r--r-- | src/entrypoint/entrypoint.pro | 30 | ||||
-rw-r--r-- | src/entrypoint/qtentrypoint_win.cpp (renamed from src/winmain/qtmain_win.cpp) | 4 | ||||
-rw-r--r-- | src/src.pro | 10 | ||||
-rw-r--r-- | src/winmain/winmain.pro | 31 |
8 files changed, 46 insertions, 47 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78ee63baae..aa4b1b06c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,6 +70,6 @@ if(QT_FEATURE_gui AND QT_FEATURE_widgets) endif() add_subdirectory(plugins) -add_subdirectory(winmain) +add_subdirectory(entrypoint) add_subdirectory(android) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 4a60d61eea..26ab044856 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1370,7 +1370,7 @@ function(_qt_internal_setup_startup_target) set_target_properties("${target}" PROPERTIES "${initialized_prop}" TRUE) endif() - # On Windows this enables automatic linkage to WinMain. + # On Windows this enables automatic linkage to QtEntryPoint. # On iOS this enables automatic passing of a linker flag that will change the default # entry point of the linked executable. set(isExe "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>") @@ -1378,7 +1378,7 @@ function(_qt_internal_setup_startup_target) if(WIN32) set(isWin32 "$<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>") set(isPolicyNEW "$<TARGET_POLICY:CMP0020>") - set(finalGenex "$<$<AND:${isExe},${isWin32},${isNotExcluded},${isPolicyNEW}>:Qt::WinMain>") + set(finalGenex "$<$<AND:${isExe},${isWin32},${isNotExcluded},${isPolicyNEW}>:Qt::EntryPoint>") # Use set_target_properties instead of target_link_libraries because the latter has some # weird additional behavior of checking which project the target belongs to, and might diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc index f904cd774f..5309eb14da 100644 --- a/src/corelib/doc/src/qtcore-index.qdoc +++ b/src/corelib/doc/src/qtcore-index.qdoc @@ -116,7 +116,7 @@ See \l{Qt Licensing} for further details. Executables on Windows potentially link - against \l{The qtmain Library}. This library is available + against \l{The QtEntryPoint Library}. This library is available under commercial licenses and also under the \l{BSD 3-clause "New" or "Revised" License}. diff --git a/src/winmain/CMakeLists.txt b/src/entrypoint/CMakeLists.txt index 3f3e6f0f1c..16c01540dd 100644 --- a/src/winmain/CMakeLists.txt +++ b/src/entrypoint/CMakeLists.txt @@ -4,7 +4,7 @@ if (NOT WIN32) return() endif() -qt_internal_add_module(WinMain +qt_internal_add_module(EntryPoint STATIC NO_SYNC_QT NO_MODULE_HEADERS @@ -22,14 +22,12 @@ if (MSVC) IN_CURRENT_SCOPE) endif() -set_property(TARGET WinMain PROPERTY OUTPUT_NAME qtmain) - -qt_internal_extend_target(WinMain CONDITION - SOURCES qtmain_win.cpp +qt_internal_extend_target(EntryPoint CONDITION WIN32 + SOURCES qtentrypoint_win.cpp LIBRARIES shell32 ) -qt_internal_extend_target(WinMain CONDITION MINGW +qt_internal_extend_target(EntryPoint CONDITION MINGW DEFINES QT_NEEDS_QMAIN ) # special case end diff --git a/src/entrypoint/entrypoint.pro b/src/entrypoint/entrypoint.pro new file mode 100644 index 0000000000..dd0618cd56 --- /dev/null +++ b/src/entrypoint/entrypoint.pro @@ -0,0 +1,30 @@ +# Additional Qt project file for QtEntryPoint lib +!win32:error("$$_FILE_ is intended only for Windows!") + +TARGET = QtEntryPoint + +CONFIG += static no_module_headers +QT = core + +DEFINES += QT_NO_FOREACH + +win32 { + SOURCES = qtentrypoint_win.cpp + CONFIG -= qt + + QMAKE_USE_PRIVATE += shell32 + + msvc { + QMAKE_CFLAGS_DEBUG -= -Zi + QMAKE_CXXFLAGS_DEBUG -= -Zi + QMAKE_CFLAGS_DEBUG *= -Z7 + QMAKE_CXXFLAGS_DEBUG *= -Z7 + } + mingw { + DEFINES += QT_NEEDS_QMAIN + MODULE_DEFINES += QT_NEEDS_QMAIN + LIBS += -lmingw32 + } +} + +load(qt_module) diff --git a/src/winmain/qtmain_win.cpp b/src/entrypoint/qtentrypoint_win.cpp index 5520a447a9..200eb5379d 100644 --- a/src/winmain/qtmain_win.cpp +++ b/src/entrypoint/qtentrypoint_win.cpp @@ -52,8 +52,8 @@ #include <shellapi.h> /* - This file contains the code in the qtmain library for Windows. - qtmain contains the Windows startup code and is required for + This file contains the code in the QtEntryPoint library for Windows. + QtEntryPoint contains the Windows startup code and is required for linking to the Qt DLL. When a Windows application starts, the WinMain function is diff --git a/src/src.pro b/src/src.pro index 91cd6d4558..34fbd9d0f3 100644 --- a/src/src.pro +++ b/src/src.pro @@ -64,9 +64,9 @@ src_tools_qvkgen.target = sub-qvkgen force_bootstrap: src_tools_qvkgen.depends = src_tools_bootstrap else: src_tools_qvkgen.depends = src_corelib -src_winmain.subdir = $$PWD/winmain -src_winmain.target = sub-winmain -src_winmain.depends = sub-corelib # just for the module .pri file +src_entrypoint.subdir = $$PWD/entrypoint +src_entrypoint.target = sub-entrypoint +src_entrypoint.depends = sub-corelib # just for the module .pri file src_corelib.subdir = $$PWD/corelib src_corelib.target = sub-corelib @@ -157,7 +157,9 @@ qtConfig(regularexpression):!qtConfig(system-pcre2):pcre2 { } TOOLS = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qlalr SUBDIRS += src_corelib src_tools_qlalr -win32:SUBDIRS += src_winmain + +win32:SUBDIRS += src_entrypoint + qtConfig(network) { SUBDIRS += src_network src_plugins.depends += src_network diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro deleted file mode 100644 index 19ce9ffa82..0000000000 --- a/src/winmain/winmain.pro +++ /dev/null @@ -1,31 +0,0 @@ -# Additional Qt project file for qtmain lib on Windows -!win32:error("$$_FILE_ is intended only for Windows!") - -TEMPLATE = lib -TARGET = qtmain -DESTDIR = $$QT.core.libs - -CONFIG += static -QT = core - -DEFINES += QT_NO_FOREACH - -qtConfig(debug_and_release): CONFIG += build_all - -msvc: QMAKE_CFLAGS_DEBUG -= -Zi -msvc: QMAKE_CXXFLAGS_DEBUG -= -Zi -msvc: QMAKE_CFLAGS_DEBUG *= -Z7 -msvc: QMAKE_CXXFLAGS_DEBUG *= -Z7 -mingw: DEFINES += QT_NEEDS_QMAIN - -CONFIG -= qt -SOURCES = qtmain_win.cpp -QMAKE_USE_PRIVATE += shell32 - -load(qt_installs) - -TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end - -load(qt_targets) -load(qt_build_paths) -load(qt_common) |