contrib: update qtbase to 6.6.2

This commit is contained in:
Fatih Uzunoglu 2024-01-09 21:38:11 +02:00 committed by Steve Lhomme
parent b98425a122
commit 3377bb4f3b
23 changed files with 2041 additions and 526 deletions

View File

@ -0,0 +1,399 @@
From 2285a32c5ed2fe874ef13e9828e5f31d1c067001 Mon Sep 17 00:00:00 2001
From: Alexandru Croitor <alexandru.croitor@qt.io>
Date: Mon, 17 Apr 2023 13:36:27 +0200
Subject: [PATCH 1/8] CMake: Place resources into static libraries, not object
libraries
Take 2.
Re-land previously reverted commit, due to not handling resource names
that are not valid c++ identifiers. Now we sanitize the resource names
just like rcc does by replacing non-alphanumeric characters with
underscores.
Original commit message.
During the Qt 5 -> Qt 6 and qmake -> CMake porting time frame, it was
decided to keep resources in an object file (object library), rather
than putting them directly into a static library when doing a static
Qt build, so that the build system can take care of linking the
object file directly into the executable and thus not forcing
project developers to manually initialize resources with
the Q_INIT_RESOURCE() macro in project code.
This worked for most qmake and cmake projects, but it created
difficulties for other build systems, in the sense that these projects
would have to manually link to the resource object files, otherwise
they would get link time errors about undefined resource symbols,
assuming they kept the Q_INIT_RESOURCE() calls.
If the project code didn't contain Q_INIT_RESOURCE calls, the
situation would be even worse, the linker would not error out,
and the missing resources would only be discovered at runtime.
It's also an issue in CMake projects that try to link to the
library files directly instead of using the library target names,
which means the object files would not be automatically linked in.
Many projects try to do that because we don't yet offer a convenient
way to install libraries and reuse them in other projects (the SDK
case), so projects end up shipping only the libraries, without the
resource object files.
We can improve the situation by moving the resources back into their
associated static libraries, and only keeping a static initializer as
a separate object file / object library, which references the actual
resource initializer symbol, to ensure it does not get discarded
during linking.
This way, projects that link using targets get no behavior difference,
whereas projects linking to static libraries directly can still
successfully build as long as their sources have all the necessary
Q_INIT_RESOURCE calls.
To ensure the resource symbols do not get discarded, we use a few new
private macros. We declare the resource init symbols we want to keep as
extern symbols and then assign the symbol addresses to volatile
variables.
This prevents discarding the symbols with the compilers / linkers we
care about.
It comes at the cost of an additional static initializer per resource,
but we would get the same + a bigger performance hit if we just used
Q_INIT_RESOURCE twice (once in the object lib and once in project
code), which internally needs to traverse a linked list of all
resources to check if a resource was initialized or not.
For GHS / Integrity, we also need to use a GHS-specific pragma to keep
the symbols, which we currently use in qtdeclarative to ensure qml
plugin symbols are not discarded.
The same macros will be used in a qtdeclarative change to prevent
discarding of resources when linking to static qml plugins.
A cmake-based test case is added to verify that linking to static
libraries directly, without linking to the resource initializer
object libraries, works fine as long as the project code calls
Q_INIT_RESOURCE for the relevant resource.
This reverts commit bc88bb34caf1185a25eda77ee022843c0ca988b0.
Fixes: QTBUG-91448
Task-number: QTBUG-110243
Change-Id: Idce69db0cf79d3e32916750bfa61774ced977a7e
---
src/corelib/CMakeLists.txt | 2 +
src/corelib/Qt6CoreMacros.cmake | 50 +++++++++++++-
src/corelib/Qt6CoreResourceInit.in.cpp | 14 ++++
src/corelib/global/qtsymbolmacros.h | 65 +++++++++++++++++++
tests/auto/cmake/CMakeLists.txt | 1 +
.../CMakeLists.txt | 33 ++++++++++
.../helper_lib.cpp | 4 ++
.../test_resource_without_obj_lib/main.cpp | 28 ++++++++
.../resource.txt | 1 +
9 files changed, 195 insertions(+), 3 deletions(-)
create mode 100644 src/corelib/Qt6CoreResourceInit.in.cpp
create mode 100644 src/corelib/global/qtsymbolmacros.h
create mode 100644 tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt
create mode 100644 tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp
create mode 100644 tests/auto/cmake/test_resource_without_obj_lib/main.cpp
create mode 100644 tests/auto/cmake/test_resource_without_obj_lib/resource.txt
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 1296ff0408..dff023581c 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -89,6 +89,7 @@ qt_internal_add_module(Core
global/qtpreprocessorsupport.h
global/qtrace_p.h
global/qtresource.h
+ global/qtsymbolmacros.h
global/qttranslation.h
global/qttypetraits.h
global/qtversionchecks.h
@@ -345,6 +346,7 @@ qt_internal_add_module(Core
EXTRA_CMAKE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/Qt6CTestMacros.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/Qt6CoreConfigureFileTemplate.in"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Qt6CoreResourceInit.in.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Qt6CoreDeploySupport.cmake"
"${config_build_dir}/QtInstallPaths.cmake"
${corelib_extra_cmake_files}
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index e082e586a6..95dfc045fb 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1749,16 +1749,29 @@ function(__qt_propagate_generated_resource target resource_name generated_source
math(EXPR resource_count "${resource_count} + 1")
set_target_properties(${target} PROPERTIES _qt_generated_resource_target_count ${resource_count})
+ __qt_internal_generate_init_resource_source_file(
+ resource_init_file ${target} ${resource_name})
+
set(resource_target "${target}_resources_${resource_count}")
- add_library("${resource_target}" OBJECT "${generated_source_code}")
+ add_library("${resource_target}" OBJECT "${resource_init_file}")
set_target_properties(${resource_target} PROPERTIES
AUTOMOC FALSE
AUTOUIC FALSE
AUTORCC FALSE
)
+ # Needed so that qtsymbolmacros.h and its dependent headers are already created / syncqt'ed.
+ if(TARGET Core_sync_headers)
+ set(headers_available_target "Core_sync_headers")
+ else()
+ set(headers_available_target "${QT_CMAKE_EXPORT_NAMESPACE}::Core")
+ endif()
+ add_dependencies(${resource_target} ${headers_available_target})
target_compile_definitions("${resource_target}" PRIVATE
"$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Core,INTERFACE_COMPILE_DEFINITIONS>"
)
+ target_include_directories("${resource_target}" PRIVATE
+ "$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Core,INTERFACE_INCLUDE_DIRECTORIES>"
+ )
_qt_internal_set_up_static_runtime_library("${resource_target}")
# Special handling is required for the Core library resources. The linking of the Core
@@ -1777,7 +1790,7 @@ function(__qt_propagate_generated_resource target resource_name generated_source
# .rcc/qrc_qprintdialog.cpp
file(RELATIVE_PATH generated_cpp_file_relative_path
"${CMAKE_CURRENT_BINARY_DIR}"
- "${generated_source_code}")
+ "${resource_init_file}")
set_property(TARGET ${resource_target} APPEND PROPERTY
_qt_resource_generated_cpp_relative_path "${generated_cpp_file_relative_path}")
@@ -1791,8 +1804,39 @@ function(__qt_propagate_generated_resource target resource_name generated_source
set(${output_generated_target} "${resource_target}" PARENT_SCOPE)
else()
set(${output_generated_target} "" PARENT_SCOPE)
- target_sources(${target} PRIVATE ${generated_source_code})
endif()
+
+ target_sources(${target} PRIVATE ${generated_source_code})
+endfunction()
+
+function(__qt_internal_sanitize_resource_name out_var name)
+ # The sanitized output should match RCCResourceLibrary::writeInitializer()'s
+ # isAsciiLetterOrNumber-based substituion.
+ # MAKE_C_IDENTIFIER matches that, it replaces non-alphanumeric chars with underscores.
+ string(MAKE_C_IDENTIFIER "${name}" sanitized_resource_name)
+ set(${out_var} "${sanitized_resource_name}" PARENT_SCOPE)
+endfunction()
+
+function(__qt_internal_generate_init_resource_source_file out_var target resource_name)
+ set(template_file "${__qt_core_macros_module_base_dir}/Qt6CoreResourceInit.in.cpp")
+
+ # Gets replaced in the template
+ __qt_internal_sanitize_resource_name(RESOURCE_NAME "${resource_name}")
+ set(resource_init_path "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qrc_${resource_name}_init.cpp")
+
+ configure_file("${template_file}" "${resource_init_path}" @ONLY)
+
+ set(scope_args "")
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
+ set(scope_args TARGET_DIRECTORY ${target})
+ endif()
+ set_source_files_properties(${resource_init_path} ${scope_args} PROPERTIES
+ SKIP_AUTOGEN TRUE
+ SKIP_UNITY_BUILD_INCLUSION TRUE
+ SKIP_PRECOMPILE_HEADERS TRUE
+ )
+
+ set(${out_var} "${resource_init_path}" PARENT_SCOPE)
endfunction()
# Make file visible in IDEs.
diff --git a/src/corelib/Qt6CoreResourceInit.in.cpp b/src/corelib/Qt6CoreResourceInit.in.cpp
new file mode 100644
index 0000000000..0234ec8232
--- /dev/null
+++ b/src/corelib/Qt6CoreResourceInit.in.cpp
@@ -0,0 +1,14 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: BSD-3-Clause
+
+// This file was generated by the qt_add_resources command.
+
+#include <QtCore/qtsymbolmacros.h>
+
+QT_DECLARE_EXTERN_RESOURCE(@RESOURCE_NAME@);
+
+namespace {
+ struct resourceReferenceKeeper {
+ resourceReferenceKeeper() { QT_KEEP_RESOURCE(@RESOURCE_NAME@); }
+ } resourceReferenceKeeperInstance;
+}
diff --git a/src/corelib/global/qtsymbolmacros.h b/src/corelib/global/qtsymbolmacros.h
new file mode 100644
index 0000000000..18cdc85f72
--- /dev/null
+++ b/src/corelib/global/qtsymbolmacros.h
@@ -0,0 +1,65 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef QTSYMBOLMACROS_H
+#define QTSYMBOLMACROS_H
+
+#if 0
+# pragma qt_sync_stop_processing
+#endif
+
+// For GHS symbol keeping.
+#include <QtCore/qcompilerdetection.h>
+#include <QtCore/qtpreprocessorsupport.h>
+
+// For handling namespaced resources.
+#ifdef QT_NAMESPACE
+# define QT_RCC_MANGLE_NAMESPACE0(x) x
+# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+ QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+# define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+// GHS needs special handling to keep a symbol around.
+#if defined(Q_CC_GHS)
+# define Q_GHS_KEEP_REFERENCE(S) QT_DO_PRAGMA(ghs reference S ##__Fv)
+#else
+# define Q_GHS_KEEP_REFERENCE(S)
+#endif
+
+// Macros to ensure a symbol is not dropped by the linker even if it's not used.
+#define QT_DECLARE_EXTERN_SYMBOL(NAME, RETURN_TYPE) \
+ extern RETURN_TYPE NAME(); \
+ Q_GHS_KEEP_REFERENCE(NAME)
+
+#define QT_DECLARE_EXTERN_SYMBOL_INT(NAME) \
+ QT_DECLARE_EXTERN_SYMBOL(NAME, int)
+
+#define QT_DECLARE_EXTERN_SYMBOL_VOID(NAME) \
+ QT_DECLARE_EXTERN_SYMBOL(NAME, void)
+
+#define QT_KEEP_SYMBOL_VAR_NAME(NAME) NAME ## _keep
+
+#define QT_KEEP_SYMBOL_HELPER(NAME, VAR_NAME) \
+ volatile auto VAR_NAME = &NAME; \
+ Q_UNUSED(VAR_NAME)
+
+#define QT_KEEP_SYMBOL(NAME) \
+ QT_KEEP_SYMBOL_HELPER(NAME, QT_KEEP_SYMBOL_VAR_NAME(NAME))
+
+
+// Similar to the ones above, but for rcc resource symbols specifically.
+#define QT_GET_RESOURCE_INIT_SYMBOL(NAME) \
+ QT_RCC_MANGLE_NAMESPACE(qInitResources_ ## NAME)
+
+#define QT_DECLARE_EXTERN_RESOURCE(NAME) \
+ QT_DECLARE_EXTERN_SYMBOL_INT(QT_GET_RESOURCE_INIT_SYMBOL(NAME))
+
+#define QT_KEEP_RESOURCE(NAME) \
+ QT_KEEP_SYMBOL(QT_GET_RESOURCE_INIT_SYMBOL(NAME))
+
+#endif // QTSYMBOLMACROS_H
+
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 975cc6fc7d..1ce6f8a020 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -222,6 +222,7 @@ _qt_internal_test_expect_pass(test_multiple_find_package)
_qt_internal_test_expect_pass(test_add_resources_delayed_file)
_qt_internal_test_expect_pass(test_add_binary_resources_delayed_file BINARY test_add_binary_resources_delayed_file)
_qt_internal_test_expect_pass(test_qt_add_resources_rebuild)
+_qt_internal_test_expect_pass(test_resource_without_obj_lib BINARY test_resource_without_obj_lib)
if(NOT NO_GUI)
_qt_internal_test_expect_pass(test_private_includes)
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt b/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt
new file mode 100644
index 0000000000..16563141f4
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.16)
+
+project(test_resource_without_obj_lib)
+
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+find_package(Qt6 REQUIRED
+ COMPONENTS Core Test
+ HINTS ${Qt6Tests_PREFIX_PATH}
+)
+
+qt6_add_library(helper_lib STATIC helper_lib.cpp)
+qt6_add_resources(helper_lib "helper_res" FILES resource.txt PREFIX "/")
+
+# Link to Core, to ensure both the helper_lib and the main executable
+# inherit the QT_NAMESPACE if it is set, otherwise we get undefined
+# linker errors due to the mismatch in symbol names.
+target_link_libraries(helper_lib PRIVATE Qt6::Core)
+
+set(CMAKE_AUTOMOC ON)
+
+qt6_add_executable(test_resource_without_obj_lib main.cpp)
+target_link_libraries(test_resource_without_obj_lib PRIVATE Qt6::Core Qt6::Test)
+
+# Link against the library file and not the target, so that we can confirm
+# the ability to manually initialize the resource via Q_INIT_RESOURCE.
+target_link_libraries(test_resource_without_obj_lib PRIVATE $<TARGET_FILE:helper_lib>)
+
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp b/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp
new file mode 100644
index 0000000000..18371786a9
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/helper_lib.cpp
@@ -0,0 +1,4 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+void nothing() {}
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/main.cpp b/tests/auto/cmake/test_resource_without_obj_lib/main.cpp
new file mode 100644
index 0000000000..29ea0f7272
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/main.cpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
+#include <QtCore/qtresource.h>
+#include <QtTest/QtTest>
+
+class TestManualResourceInit : public QObject
+{
+ Q_OBJECT
+private slots:
+ void initTestCase();
+ void resourceExistsAfterManualInit();
+};
+
+void TestManualResourceInit::initTestCase()
+{
+ // Manually initialize the resource like we used to do it in qt5 + qmake times.
+ Q_INIT_RESOURCE(helper_res);
+}
+
+void TestManualResourceInit::resourceExistsAfterManualInit()
+{
+ QVERIFY(QFile::exists(":/resource.txt"));
+}
+
+QTEST_MAIN(TestManualResourceInit)
+#include "main.moc"
+
diff --git a/tests/auto/cmake/test_resource_without_obj_lib/resource.txt b/tests/auto/cmake/test_resource_without_obj_lib/resource.txt
new file mode 100644
index 0000000000..7804a324a4
--- /dev/null
+++ b/tests/auto/cmake/test_resource_without_obj_lib/resource.txt
@@ -0,0 +1 @@
+Test resource
--
2.43.1

View File

@ -1,22 +0,0 @@
--- qt/src/corelib/tools/qsimd.cpp.mingw32 2020-01-24 06:54:31.000000000 +0100
+++ qt/src/corelib/tools/qsimd.cpp 2020-03-11 07:59:52.182784800 +0100
@@ -621,7 +621,7 @@ void qDumpCPUFeatures()
puts("");
}
-#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
+#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) && 0 // mingw32 32-bits crash
# ifdef Q_PROCESSOR_X86_64
# define _rdrandXX_step _rdrand64_step
--- qt/src/corelib/tools/qsimd_p.h.mingw32 2020-01-24 06:54:31.000000000 +0100
+++ qt/src/corelib/tools/qsimd_p.h 2020-03-11 07:59:43.086627000 +0100
@@ -346,7 +346,7 @@ extern Q_CORE_EXPORT QBasicAtomicInteger
#endif
Q_CORE_EXPORT void qDetectCpuFeatures();
-#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) && !defined(QT_BOOTSTRAPPED)
+#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) && !defined(QT_BOOTSTRAPPED) && 0 // mingw32 32-bits crash
Q_CORE_EXPORT qsizetype qRandomCpu(void *, qsizetype) noexcept;
#else
static inline qsizetype qRandomCpu(void *, qsizetype) noexcept

View File

@ -1,27 +0,0 @@
From f76248e9c67927d3a403b43ff941f72117e427f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
Date: Fri, 15 Jun 2018 09:59:42 +0300
Subject: [PATCH 2/2] Windows QPA: Disable systray notification sounds
---
src/plugins/platforms/windows/qwindowssystemtrayicon.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
index 901d132ea5..c30fa0e76d 100644
--- a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
+++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
@@ -279,6 +279,10 @@ void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &me
}
tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);
}
+
+ // Never play audio on notifications.
+ tnd.dwInfoFlags |= NIIF_NOSOUND;
+
tnd.hWnd = m_hwnd;
tnd.uTimeout = msecsIn <= 0 ? UINT(10000) : UINT(msecsIn); // 10s default
tnd.uFlags = NIF_INFO | NIF_SHOWTIP;
--
2.15.2 (Apple Git-101.1)

View File

@ -0,0 +1,26 @@
From d05eac31981d69c4b29aaf38f9f0addb2b549fae Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Tue, 9 Jan 2024 20:59:45 +0200
Subject: [PATCH 2/8] Windows Tray Icon Set NOSOUND
---
src/plugins/platforms/windows/qwindowssystemtrayicon.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
index acad849a3d..fae00c2081 100644
--- a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
+++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
@@ -214,6 +214,9 @@ void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &me
qStringToLimitedWCharArray(message, tnd.szInfo, 256);
qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
+ // No audio:
+ tnd.dwInfoFlags |= NIIF_NOSOUND;
+
tnd.uID = q_uNOTIFYICONID;
const auto size = icon.actualSize(QSize(256, 256));
--
2.43.1

View File

@ -0,0 +1,30 @@
From d9d290432bfc482ba970bf215f1dcec59fa7da01 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Mon, 8 Jan 2024 21:52:41 +0200
Subject: [PATCH 3/8] Try to generate pkgconfig pc files in static build
---
cmake/QtPkgConfigHelpers.cmake | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmake/QtPkgConfigHelpers.cmake b/cmake/QtPkgConfigHelpers.cmake
index dbe736c438..caacd4e8ed 100644
--- a/cmake/QtPkgConfigHelpers.cmake
+++ b/cmake/QtPkgConfigHelpers.cmake
@@ -26,9 +26,10 @@ function(qt_internal_generate_pkg_config_file module)
AND NOT MINGW OR CMAKE_VERSION VERSION_LESS "3.20" OR ANDROID)
return()
endif()
- if(NOT BUILD_SHARED_LIBS)
- return()
- endif()
+ # Try to generate pc files also in static build
+ #if(NOT BUILD_SHARED_LIBS)
+ # return()
+ #endif()
set(pkgconfig_file "${QT_CMAKE_EXPORT_NAMESPACE}${module}")
set(pkgconfig_name "${QT_CMAKE_EXPORT_NAMESPACE} ${module}")
--
2.43.1

View File

@ -1,76 +0,0 @@
From 5b0815cdbdc729da3135d3a9c41d7579883f739d Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre@videolabs.io>
Date: Tue, 9 Apr 2019 16:39:23 +0200
Subject: [PATCH] allow cross-compilation of angle with wine
---
src/angle/src/common/common.pri | 2 +-
src/gui/configure.json | 2 +-
src/gui/configure.pri | 24 ++----------------------
3 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index df29269..b6bde4d 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -22,7 +22,7 @@ lib_replace.replace = \$\$\$\$[QT_INSTALL_LIBS]
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
-FXC = $$shell_quote($$shell_path($$QMAKE_FXC_LOCATION))
+FXC = $$shell_path($$QMAKE_FXC_LOCATION)
win32 {
VERSION = $$MODULE_VERSION
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 44140bc..53f4984 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -1106,7 +1106,7 @@
"angle": {
"label": "ANGLE",
"autoDetect": "features.opengles2 || features.opengl-dynamic",
- "condition": "!features.opengl-desktop && features.dxguid && tests.fxc && (features.direct3d9 || (config.winrt && features.direct3d11 && libs.d3dcompiler))",
+ "condition": "!features.opengl-desktop && features.dxguid && tests.fxc && (features.direct3d9 || (features.direct3d11 && libs.d3dcompiler))",
"output": [
"publicFeature",
{ "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" },
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
index 1b95449..875e890 100644
--- a/src/gui/configure.pri
+++ b/src/gui/configure.pri
@@ -20,29 +20,9 @@ defineTest(qtConfLibrary_freetype) {
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
# the Windows SDK.
defineTest(qtConfTest_fxc) {
- !mingw {
- fxc = $$qtConfFindInPath("fxc.exe")
- } else {
- equals(QMAKE_HOST.arch, x86_64): \
- fns = x64/fxc.exe
- else: \
- fns = x86/fxc.exe
- dxdir = $$(DXSDK_DIR)
- !isEmpty(dxdir) {
- fxc = $$dxdir/Utilities/bin/$$fns
- } else {
- winkitbindir = $$(WindowsSdkVerBinPath)
- !isEmpty(winkitbindir) {
- fxc = $$winkitbindir/$$fns
- } else {
- winkitdir = $$(WindowsSdkDir)
- !isEmpty(winkitdir): \
- fxc = $$winkitdir/bin/$$fns
- }
- }
- }
+ fxc = wine "$$(DXSDK_DIR)/fxc2.exe"
- !isEmpty(fxc):exists($$fxc) {
+ !isEmpty(fxc) {
$${1}.value = $$clean_path($$fxc)
export($${1}.value)
$${1}.cache += value
--
2.19.1

View File

@ -0,0 +1,156 @@
From 13ced07c50bc04b7f67001aa6521aee09f3cbfb8 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Sun, 14 Jan 2024 23:34:29 +0200
Subject: [PATCH 4/8] Revert "QMutex: remove qmutex_win.cpp"
This reverts commit b6e30e9fee98f9cdfec4c54c980864f65632519c.
---
src/corelib/CMakeLists.txt | 2 ++
src/corelib/thread/qlocking_p.h | 7 ++++---
src/corelib/thread/qmutex.cpp | 4 +++-
src/corelib/thread/qmutex_p.h | 9 +++++---
src/corelib/thread/qmutex_win.cpp | 30 +++++++++++++++++++++++++++
src/corelib/thread/qwaitcondition_p.h | 7 ++++---
6 files changed, 49 insertions(+), 10 deletions(-)
create mode 100644 src/corelib/thread/qmutex_win.cpp
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index dff023581c..d43ece2b9f 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -499,6 +499,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_animation
# from the wrong DLL at runtime and crash!
qt_internal_extend_target(Core CONDITION QT_FEATURE_thread AND WIN32
SOURCES
+ thread/qmutex_win.cpp
thread/qwaitcondition_win.cpp
LIBRARIES
synchronization
@@ -1313,6 +1314,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_ctf AND QT_FEATURE_library
set_source_files_properties(
thread/qmutex_mac.cpp
thread/qmutex_unix.cpp
+ thread/qmutex_win.cpp
PROPERTIES HEADER_FILE_ONLY ON)
# Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library.
diff --git a/src/corelib/thread/qlocking_p.h b/src/corelib/thread/qlocking_p.h
index 9fa7e70da9..0c205fff66 100644
--- a/src/corelib/thread/qlocking_p.h
+++ b/src/corelib/thread/qlocking_p.h
@@ -8,9 +8,10 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience of
-// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
-// version without notice, or even be removed.
+// This file is not part of the Qt API. It exists for the convenience
+// of qmutex.cpp, qmutex_unix.cpp, and qmutex_win.cpp. This header
+// file may change from version to version without notice, or even be
+// removed.
//
// We mean it.
//
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index b794d79e23..1a30b25ad5 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -913,10 +913,12 @@ void QMutexPrivate::derefWaiters(int value) noexcept
QT_END_NAMESPACE
-#if defined(QT_ALWAYS_USE_FUTEX)
+#if defined(Q_OS_LINUX) && defined(QT_ALWAYS_USE_FUTEX)
// nothing
#elif defined(Q_OS_DARWIN)
# include "qmutex_mac.cpp"
+#elif defined(Q_OS_WIN)
+# include "qmutex_win.cpp"
#else
# include "qmutex_unix.cpp"
#endif
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index aabb66fa55..99b0406eb7 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -10,9 +10,10 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience of
-// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
-// version without notice, or even be removed.
+// This file is not part of the Qt API. It exists for the convenience
+// of qmutex.cpp, qmutex_unix.cpp, and qmutex_win.cpp. This header
+// file may change from version to version without notice, or even be
+// removed.
//
// We mean it.
//
@@ -86,6 +87,8 @@ public:
semaphore_t mach_semaphore;
#elif defined(Q_OS_UNIX)
sem_t semaphore;
+#elif defined(Q_OS_WIN)
+ Qt::HANDLE event;
#endif
};
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
new file mode 100644
index 0000000000..8c7741c113
--- /dev/null
+++ b/src/corelib/thread/qmutex_win.cpp
@@ -0,0 +1,30 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qmutex.h"
+#include <qatomic.h>
+#include "qmutex_p.h"
+#include <qt_windows.h>
+
+QT_BEGIN_NAMESPACE
+
+QMutexPrivate::QMutexPrivate()
+{
+ event = CreateEvent(0, FALSE, FALSE, 0);
+
+ if (!event)
+ qWarning("QMutexPrivate::QMutexPrivate: Cannot create event");
+}
+
+QMutexPrivate::~QMutexPrivate()
+{ CloseHandle(event); }
+
+bool QMutexPrivate::wait(int timeout)
+{
+ return (WaitForSingleObjectEx(event, timeout < 0 ? INFINITE : timeout, FALSE) == WAIT_OBJECT_0);
+}
+
+void QMutexPrivate::wakeUp() noexcept
+{ SetEvent(event); }
+
+QT_END_NAMESPACE
diff --git a/src/corelib/thread/qwaitcondition_p.h b/src/corelib/thread/qwaitcondition_p.h
index cfb36ca30b..01bb000366 100644
--- a/src/corelib/thread/qwaitcondition_p.h
+++ b/src/corelib/thread/qwaitcondition_p.h
@@ -7,9 +7,10 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience of
-// qmutex.cpp and qmutex_unix.cpp. This header file may change from version to
-// version without notice, or even be removed.
+// This file is not part of the Qt API. It exists for the convenience
+// of qmutex.cpp, qmutex_unix.cpp, and qmutex_win.cpp. This header
+// file may change from version to version without notice, or even be
+// removed.
//
// We mean it.
//
--
2.43.1

View File

@ -0,0 +1,26 @@
From 94a5a61135c85489426896d2b164974128edf542 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Thu, 18 Jan 2024 17:30:26 +0200
Subject: [PATCH 5/8] Expose QRhiImplementation in QRhi
---
src/gui/rhi/qrhi.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/gui/rhi/qrhi.h b/src/gui/rhi/qrhi.h
index c96ab7b19c..1aa9d77c76 100644
--- a/src/gui/rhi/qrhi.h
+++ b/src/gui/rhi/qrhi.h
@@ -1964,6 +1964,9 @@ protected:
private:
Q_DISABLE_COPY(QRhi)
QRhiImplementation *d = nullptr;
+
+public:
+ QRhiImplementation* implementation() { return d; };
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags)
--
2.43.1

View File

@ -0,0 +1,77 @@
From 354c2ed8c581d9b0fc0bf776f653c270f307f075 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Mon, 22 Jan 2024 21:19:55 +0200
Subject: [PATCH 6/8] Do not include D3D12MemAlloc.h in header file
---
src/gui/rhi/qrhid3d12.cpp | 11 +++++++++++
src/gui/rhi/qrhid3d12_p.h | 17 +++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/gui/rhi/qrhid3d12.cpp b/src/gui/rhi/qrhid3d12.cpp
index 4a5e52bfc6..0787b9a0c8 100644
--- a/src/gui/rhi/qrhid3d12.cpp
+++ b/src/gui/rhi/qrhid3d12.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qrhid3d12_p.h"
+#include "D3D12MemAlloc.h"
#include "qshader.h"
#include <QWindow>
#include <qmath.h>
@@ -124,6 +125,16 @@ QT_BEGIN_NAMESPACE
// https://learn.microsoft.com/en-us/windows/win32/direct3d12/hardware-feature-levels
static const D3D_FEATURE_LEVEL MIN_FEATURE_LEVEL = D3D_FEATURE_LEVEL_11_0;
+void QD3D12Resource::releaseResources()
+{
+ if (owns) {
+ // order matters: resource first, then the allocation
+ resource->Release();
+ if (allocation)
+ allocation->Release();
+ }
+}
+
QRhiD3D12::QRhiD3D12(QRhiD3D12InitParams *params, QRhiD3D12NativeHandles *importParams)
{
debugLayer = params->enableDebugLayer;
diff --git a/src/gui/rhi/qrhid3d12_p.h b/src/gui/rhi/qrhid3d12_p.h
index a6954d279c..ef13cc214a 100644
--- a/src/gui/rhi/qrhid3d12_p.h
+++ b/src/gui/rhi/qrhid3d12_p.h
@@ -28,7 +28,12 @@
#include <dxgi1_6.h>
#include <dcomp.h>
-#include "D3D12MemAlloc.h"
+namespace D3D12MA {
+ struct Budget;
+ struct Statistics;
+ class Allocation;
+ class Allocator;
+}
QT_BEGIN_NAMESPACE
@@ -291,15 +296,7 @@ struct QD3D12Resource
return pool->add({ resource, state, resource->GetDesc(), nullptr, nullptr, 0, false });
}
- void releaseResources()
- {
- if (owns) {
- // order matters: resource first, then the allocation
- resource->Release();
- if (allocation)
- allocation->Release();
- }
- }
+ void releaseResources();
};
struct QD3D12Pipeline
--
2.43.1

View File

@ -1,28 +0,0 @@
From 5de8d0bf9fb22d8a2f1b648bcbf9fc5b247dbf41 Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre@videolabs.io>
Date: Thu, 21 Mar 2019 14:26:17 +0100
Subject: [PATCH 2/2] ANGLE: remove static assert that can't be evaluated by
gcc 6.4
---
.../angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 3d73b2c..12a809f 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -379,8 +379,8 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const gl:
if (mRenderer->getWorkarounds().addDummyTextureNoRenderTarget &&
colorAttachmentsForRender.empty())
{
- static_assert(static_cast<size_t>(activeProgramOutputs.size()) <= 32,
- "Size of active program outputs should less or equal than 32.");
+ //static_assert(static_cast<size_t>(activeProgramOutputs.size()) <= 32,
+ //"Size of active program outputs should less or equal than 32.");
GLenum i = static_cast<GLenum>(
gl::ScanForward(static_cast<uint32_t>(activeProgramOutputs.bits())));
--
2.19.1

View File

@ -0,0 +1,36 @@
From 944575ba8b8e7817fd11cddbae2c2fc20eabd556 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Wed, 24 Jan 2024 16:31:06 +0200
Subject: [PATCH 7/8] Try DCompositionCreateDevice3() first if available
---
src/gui/rhi/qrhid3dhelpers_p.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/gui/rhi/qrhid3dhelpers_p.h b/src/gui/rhi/qrhid3dhelpers_p.h
index f20c042860..d78c5a2bb2 100644
--- a/src/gui/rhi/qrhid3dhelpers_p.h
+++ b/src/gui/rhi/qrhid3dhelpers_p.h
@@ -45,7 +45,18 @@ inline IDCompositionDevice *createDirectCompositionDevice()
_In_ REFIID iid,
_Outptr_ void **dcompositionDevice);
DCompositionCreateDeviceFuncPtr func = reinterpret_cast<DCompositionCreateDeviceFuncPtr>(
- dcomplib.resolve("DCompositionCreateDevice"));
+ dcomplib.resolve("DCompositionCreateDevice3"));
+
+ if (!func) {
+ qDebug("Could not resolve DCompositionCreateDevice3, dcomp.dll missing or old. Trying DCompositionCreateDevice2...");
+ func = reinterpret_cast<DCompositionCreateDeviceFuncPtr>(dcomplib.resolve("DCompositionCreateDevice2"));
+ }
+
+ if (!func) {
+ qDebug("Could not resolve DCompositionCreateDevice2, dcomp.dll missing or old. Trying DCompositionCreateDevice...");
+ func = reinterpret_cast<DCompositionCreateDeviceFuncPtr>(dcomplib.resolve("DCompositionCreateDevice"));
+ }
+
if (!func) {
qWarning("Unable to resolve DCompositionCreateDevice, perhaps dcomp.dll is missing?");
return nullptr;
--
2.43.1

View File

@ -1,27 +0,0 @@
From 0b5fc908a3d8e24c28e72f61bf8c6242cb85ba3e Mon Sep 17 00:00:00 2001
From: Pierre Lamot <pierre@videolabs.io>
Date: Thu, 21 Mar 2019 16:39:41 +0100
Subject: [PATCH] ANGLE: disable ANGLE_STD_ASYNC_WORKERS when compiling with
gcc/mingw as std::future<void> is not supported
---
src/angle/src/config.pri | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri
index 5c52128..23109cd 100644
--- a/src/angle/src/config.pri
+++ b/src/angle/src/config.pri
@@ -95,6 +95,9 @@ gcc {
-Wno-strict-aliasing -Wno-type-limits -Wno-unused-local-typedefs
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -Wno-reorder -Wno-conversion-null -Wno-delete-non-virtual-dtor
+ !clang {
+ DEFINES += ANGLE_STD_ASYNC_WORKERS=ANGLE_DISABLED
+ }
}
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
--
2.19.1

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
From f0a66adc8862622ef65830dc7f3c154c211e22e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= <krzysio@google.com>
Date: Wed, 24 Apr 2019 17:44:46 -0700
Subject: [PATCH] Add KHRONOS_STATIC to allow static linking on Windows.
I have encountered multiple situations where it is desirable to
statically link against a software implementation of EGL on Windows.
Add the preprocessor constant KHRONOS_STATIC that disables the
annotation of EGL entry points as DLL-imported.
This is squashed from commits 94ba8ee876206364cf45a9bc08b8db5a52cb9543
and f636b23410dd4db5055dffbe499f4754013759d5 from
https://github.com/KhronosGroup/EGL-Registry, applied on the qtbase
repo.
---
src/3rdparty/angle/include/KHR/khrplatform.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h
index 975bbff..dd22d92 100644
--- a/src/3rdparty/angle/include/KHR/khrplatform.h
+++ b/src/3rdparty/angle/include/KHR/khrplatform.h
@@ -90,12 +90,20 @@
* int arg2) KHRONOS_APIATTRIBUTES;
*/
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+# define KHRONOS_STATIC 1
+#endif
+
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
-#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
+#if defined(KHRONOS_STATIC)
+ /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+ * header compatible with static linking. */
+# define KHRONOS_APICALL
+#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
--
2.17.1

View File

@ -1 +1 @@
29e8877bafdbc908072209f1b27a5040b022e2b71f17f4ab4cecd570adeae21597f9af7f1d38758760f3cb30376eeb15c5f066bf02c6e9a9e3a4d07f967046ce qtbase-everywhere-src-5.15.8.tar.xz
ea343bcf269779a4e078ed8baddfbe6c5ec4a34275c7d72b3f3928da60feece2ddc9ce4a380c6536a4e1654b483cee8918f8ad3038904725d2dd1c653ae83ece qtbase-everywhere-src-6.6.2.tar.xz

View File

@ -1,41 +0,0 @@
From 3114853cdc19b35ca9a312321e4014319e5828fa Mon Sep 17 00:00:00 2001
From: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Date: Mon, 12 Dec 2022 13:36:45 +0100
Subject: [PATCH] qmake: always add includedir to the .pc files
The generated .pc files do not contain -I${includedir}, only
-I${includedir}/$QTMODULE. This is because QMake finds out that our
standard contrib include path is already in the QMAKE_DEFAULT_INCDIRS
list.
When this includepath is not forced externally through some script and
only the .pc file flags are used for the qt plugin, the build fails:
In file included from /vlc/contrib/x86_64-linux-gnu/include/QtWidgets/QApplication:1,
from ../modules/gui/qt/vlc-qt-check.cpp:26:
/vlc/contrib/x86_64-linux-gnu/include/QtWidgets/qapplication.h:43:10: fatal error: QtWidgets/qtwidgetsglobal.h: No such file or directory
43 | #include <QtWidgets/qtwidgetsglobal.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes #27588.
---
qmake/generators/makefile.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 5c61a3c65c..ab9d696440 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3388,8 +3388,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
;
- if (!project->values("QMAKE_DEFAULT_INCDIRS").contains(includeDir))
- t << "-I${includedir}";
+ t << "-I${includedir}";
if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
--
2.34.1

View File

@ -1,23 +0,0 @@
#!/usr/bin/env python3
import argparse
# Argument parsing
parser = argparse.ArgumentParser(description="Generate Qt configure options from the compilation variables")
parser.add_argument('-D', action='append', help='compiler definition')
parser.add_argument('-I', action='append', help='include directory')
parser.add_argument('-L', action='append', help='linker directory')
# parser.add_argument('-F', action='append', help='framework flags')
args, remaining = parser.parse_known_args()
all_params = []
if args.D:
all_params += ['-D ' + sub for sub in args.D]
if args.I:
all_params += ['-I ' + sub for sub in args.I]
if args.L:
all_params += ['-L ' + sub for sub in args.L]
if all_params:
print(' '.join(all_params))
else:
print('')

View File

@ -1,26 +0,0 @@
--- a/mkspecs/features/qml_plugin.prf 2020-09-02 12:15:07.000000000 +0200
+++ b/mkspecs/features/qml_plugin.prf 2022-08-31 10:58:10.110600024 +0200
@@ -13,6 +13,10 @@
TEMPLATE = lib
CONFIG += plugin
+qmlprefixpclib_replace.match = $$dirname(_QMAKE_CONF_)
+qmlprefixpclib_replace.replace = $$[QT_INSTALL_PREFIX]
+qmlprefixpclib_replace.CONFIG = path
+QMAKE_PKGCONFIG_INSTALL_REPLACE += qmlprefixpclib_replace
if(win32|mac):!macx-xcode {
qtConfig(debug_and_release): CONFIG += debug_and_release
--- a/mkspecs/features/qt_plugin.prf 2020-09-02 12:15:07.000000000 +0200
+++ b/mkspecs/features/qt_plugin.prf 2022-08-31 10:59:48.380662936 +0200
@@ -15,6 +15,10 @@
TEMPLATE = lib
CONFIG += plugin
+pluginpclib_replace.match = $$MODULE_BASE_OUTDIR/lib
+pluginpclib_replace.replace = $$[QT_INSTALL_LIBS]
+pluginpclib_replace.CONFIG = path
+QMAKE_PKGCONFIG_INSTALL_REPLACE += pluginpclib_replace
DESTDIR = $$MODULE_BASE_OUTDIR/plugins/$$PLUGIN_TYPE
win32:CONFIG(shared, static|shared) {

View File

@ -1,33 +0,0 @@
#!/usr/bin/env sh
# Copyright (C) 2022 Videolabs
# This file is distributed under the same license as the vlc package.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0" )" && pwd -P)"
SOURCE="$1"
DEST="$2"
install -m 644 -p $SOURCE $DEST
# Filter pkg-config files only
if [ "${SOURCE##*.}" != 'pc' ]; then
exit 0
fi
"${SCRIPT_DIR}/../pkg-static.sh" "${DEST}"
# Filter pkg-config files that are not installed in the main pkg-config folder
if [ "$(dirname $2)" -ef "${VLC_PREFIX}/lib/pkgconfig" ]; then
exit 0
fi
pkgconfigdir="$(cd "$(dirname "${DEST}")" && pwd -P)"
# Filter packages installed in a pkgconfig/ folder
if [ "$(basename "${pkgconfigdir}")" = "pkgconfig" ]; then
exit 0
fi
sed -i.orig "s,libdir=.*,libdir=${pkgconfigdir}," "${DEST}"
mkdir -p "${VLC_PREFIX}/lib/pkgconfig"
cp "${DEST}" "${VLC_PREFIX}/lib/pkgconfig/"

View File

@ -1,10 +0,0 @@
--- qt/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp.old 2022-01-18 17:55:16.527952044 +0100
+++ qt/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp 2022-01-18 17:55:28.315744081 +0100
@@ -10,6 +10,7 @@
#include "libANGLE/HandleAllocator.h"
#include <algorithm>
+#include <limits>
#include "common/debug.h"

View File

@ -1,153 +1,110 @@
# Qt
# qtbase
QT_VERSION_MAJOR := 5.15
QT_VERSION := $(QT_VERSION_MAJOR).8
QTBASE_VERSION_MAJOR := 6.6
QTBASE_VERSION := $(QTBASE_VERSION_MAJOR).2
# Insert potential -betaX suffix here:
QT_VERSION_FULL := $(QT_VERSION)
QT_URL := $(QT)/$(QT_VERSION_MAJOR)/$(QT_VERSION_FULL)/submodules/qtbase-everywhere-opensource-src-$(QT_VERSION_FULL).tar.xz
QTBASE_VERSION_FULL := $(QTBASE_VERSION)
QTBASE_URL := $(QT)/$(QTBASE_VERSION_MAJOR)/$(QTBASE_VERSION_FULL)/submodules/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz
ifdef HAVE_MACOSX
#PKGS += qt
endif
ifdef HAVE_WIN32
#PKGS += qt
DEPS_qt = fxc2 $(DEPS_fxc2) d3d9 $(DEPS_d3d9)
ifneq ($(call mingw_at_least, 8), true)
DEPS_qt += dcomp $(DEPS_dcomp)
endif # MINGW 8
ifdef HAVE_CROSS_COMPILE
DEPS_qt += wine-headers
endif
endif
DEPS_qt += freetype2 $(DEPS_freetype2) harfbuzz $(DEPS_harfbuzz) jpeg $(DEPS_jpeg) png $(DEPS_png) zlib $(DEPS_zlib)
DEPS_qt += freetype2 $(DEPS_freetype2) harfbuzz $(DEPS_harfbuzz) jpeg $(DEPS_jpeg) png $(DEPS_png) zlib $(DEPS_zlib) vulkan-headers $(DEPS_vulkan-headers)
ifdef HAVE_WIN32
DEPS_qt += d3d12 $(DEPS_d3d12) dcomp $(DEPS_dcomp)
endif
ifeq ($(call need_pkg,"Qt5Core >= 5.11 Qt5Gui Qt5Widgets"),)
ifeq ($(call need_pkg,"Qt6Core >= 6.6 Qt6Gui >= 6.6 Qt6Widgets >= 6.6 Qt6Network >= 6.6"),)
PKGS_FOUND += qt
endif
$(TARBALLS)/qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz:
$(call download_pkg,$(QT_URL),qt)
$(TARBALLS)/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz:
$(call download_pkg,$(QTBASE_URL), qt)
.sum-qt: qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz
.sum-qt: qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz
qt: qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz .sum-qt
qt: qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz .sum-qt
$(UNPACK)
$(APPLY) $(SRC)/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
$(APPLY) $(SRC)/qt/0001-disable-qt_random_cpu.patch
$(APPLY) $(SRC)/qt/0007-ANGLE-remove-static-assert-that-can-t-be-evaluated-b.patch
$(APPLY) $(SRC)/qt/0008-ANGLE-disable-ANGLE_STD_ASYNC_WORKERS-when-compiling.patch
$(APPLY) $(SRC)/qt/0009-Add-KHRONOS_STATIC-to-allow-static-linking-on-Windows.patch
$(APPLY) $(SRC)/qt/0003-allow-cross-compilation-of-angle-with-wine.patch
$(APPLY) $(SRC)/qt/qt-fix-gcc11-build.patch
# force path replacement in pkg-config output files
$(APPLY) $(SRC)/qt/force-pkgconfg-replace.patch
# pass all files installed through our installer
$(APPLY) $(SRC)/qt/set-mkspecs-properties.patch
# fix missing QMAKE_PKGCONFIG_VERSION in Windows targets
$(APPLY) $(SRC)/qt/set-mkspecs-version.patch
# don't omit -I${includedir} from .pc files when forcing -I$CONTRIB/include
$(APPLY) $(SRC)/qt/add-includedir-to-pc-file.patch
# fix detection of our harfbuzz on macosx
sed -i.orig 's#"-lharfbuzz"#{ "libs": "-framework CoreText -framework CoreGraphics -framework CoreFoundation -lharfbuzz", "condition": "config.darwin" }, "-lharfbuzz"#' "$(UNPACK_DIR)/src/gui/configure.json"
# Let us decide the WINVER/_WIN32_WINNT
sed -i.orig 's,mingw: DEFINES += WINVER=0x0601,# mingw: DEFINES += WINVER=0x0601,' "$(UNPACK_DIR)/mkspecs/features/qt_build_config.prf"
# Prevent all Qt contribs from generating and installing libtool .la files
sed -i.orig "/CONFIG/ s/ create_libtool/ -create_libtool/g" $(UNPACK_DIR)/mkspecs/features/qt_module.prf
$(APPLY) $(SRC)/qt/0001-CMake-Place-resources-into-static-libraries-not-obje.patch
$(APPLY) $(SRC)/qt/0002-Windows-Tray-Icon-Set-NOSOUND.patch
$(APPLY) $(SRC)/qt/0003-Try-to-generate-pkgconfig-pc-files-in-static-build.patch
$(APPLY) $(SRC)/qt/0004-Revert-QMutex-remove-qmutex_win.cpp.patch
$(APPLY) $(SRC)/qt/0005-Expose-QRhiImplementation-in-QRhi.patch
$(APPLY) $(SRC)/qt/0006-Do-not-include-D3D12MemAlloc.h-in-header-file.patch
$(APPLY) $(SRC)/qt/0007-Try-DCompositionCreateDevice3-first-if-available.patch
$(APPLY) $(SRC)/qt/0008-Try-to-satisfy-Windows-7-compatibility.patch
$(MOVE)
QTBASE_CONFIG := -release
ifdef HAVE_WIN32
QT_OPENGL := -angle
else
QT_OPENGL := -opengl desktop
endif
ifdef HAVE_MACOSX
QT_SPEC := macx-clang
endif
ifdef HAVE_LINUX
ifdef HAVE_CLANG
QT_SPEC := linux-clang
else
QT_SPEC := linux-g++
endif
endif
ifdef HAVE_WIN32
ifdef HAVE_CLANG
QT_SPEC := win32-clang-g++
else
QT_SPEC := win32-g++
# Qt static debug build is practically unusable.
# So add debug symbols in release mode instead:
ifndef WITH_OPTIMIZATION
QTBASE_CONFIG += -force-debug-info
endif
ifeq ($(V),1)
QTBASE_CONFIG += -verbose
endif
ifdef HAVE_CROSS_COMPILE
QT_PLATFORM := -xplatform $(QT_SPEC) -device-option CROSS_COMPILE=$(HOST)-
else
ifneq ($(QT_SPEC),)
QT_PLATFORM := -platform $(QT_SPEC)
endif
# This is necessary to make use of qmake
QTBASE_PLATFORM := -device-option CROSS_COMPILE=$(HOST)-
endif
QT_CONFIG := -static -opensource -confirm-license $(QT_OPENGL) -no-pkg-config \
-no-sql-sqlite -no-gif -no-openssl -no-dbus -no-vulkan -no-sql-odbc -no-pch \
-no-feature-concurrent -no-feature-itemmodeltester -no-feature-printer \
-no-feature-sqlmodel -no-feature-sql -no-feature-testlib -no-feature-xml \
-no-compile-examples -nomake examples -nomake tests \
-system-freetype -system-harfbuzz -system-libjpeg -system-libpng -system-zlib \
-no-syncqt
QTBASE_CONFIG += -static -opensource -confirm-license -opengl desktop -no-pkg-config -no-openssl \
-no-gif -no-dbus -no-pch -no-feature-zstd -no-feature-concurrent -no-feature-androiddeployqt \
-no-feature-sql -no-feature-testlib -system-freetype -system-harfbuzz -system-libjpeg \
-no-feature-xml -no-feature-printsupport -system-libpng -system-zlib -no-feature-networklistmanager \
-nomake examples -prefix $(PREFIX) -qt-host-path $(BUILDPREFIX)
# For now, we only build Qt in release mode. In debug mode, startup is prevented by the internal ANGLE
# throwing an assertion in debug mode, but only when built with clang. See issue 27476.
QT_CONFIG += -release
QTBASE_NATIVE_CONFIG := -DQT_BUILD_EXAMPLES=FALSE -DQT_BUILD_TESTS=FALSE -DFEATURE_pkg_config=OFF \
-DFEATURE_accessibility=OFF -DFEATURE_widgets=OFF -DFEATURE_printsupport=OFF -DFEATURE_androiddeployqt=OFF \
-DFEATURE_xml=OFF -DFEATURE_network=OFF -DFEATURE_vnc=OFF -DFEATURE_linuxfb=OFF -DFEATURE_xlib=OFF \
-DFEATURE_sql=OFF -DFEATURE_testlib=OFF -DFEATURE_pdf=OFF -DFEATURE_vulkan=OFF -DFEATURE_imageformatplugin=OFF \
-DFEATURE_zstd=OFF -DFEATURE_xkbcommon=OFF -DFEATURE_evdev=OFF -DFEATURE_sessionmanager=OFF -DFEATURE_png=OFF \
-DFEATURE_dbus=OFF -DINPUT_openssl=no -DFEATURE_concurrent=OFF -DFEATURE_glib=OFF -DFEATURE_icu=OFF \
-DFEATURE_texthtmlparser=OFF -DFEATURE_cssparser=OFF -DFEATURE_textodfwriter=OFF -DFEATURE_textmarkdownreader=OFF \
-DFEATURE_textmarkdownwriter=OFF -DINPUT_libb2=no -DFEATURE_harfbuzz=OFF -DFEATURE_freetype=OFF
ifeq ($(V),1)
QT_CONFIG += -verbose
.qt: qt toolchain.cmake
ifdef HAVE_CROSS_COMPILE
# Native
$(CMAKECLEAN)
$(BUILDVARS) $(CMAKE_NATIVE) $(QTBASE_NATIVE_CONFIG)
+$(CMAKEBUILD)
$(CMAKEINSTALL)
# Note that libexec is treated as bin on Windows by Qt
# MOC
ln -sf $(BUILDPREFIX)/libexec/moc $(PREFIX)/bin/moc
# RCC
ln -sf $(BUILDPREFIX)/libexec/rcc $(PREFIX)/bin/rcc
# UIC
ln -sf $(BUILDPREFIX)/libexec/uic $(PREFIX)/bin/uic
endif
$(CMAKECLEAN)
mkdir -p $(BUILD_DIR)
ifdef HAVE_MINGW_W64
QT_CONFIG += -no-direct2d
endif
# Configure qt, build and run cmake
+cd $(BUILD_DIR) && ../configure $(QTBASE_PLATFORM) $(QTBASE_CONFIG) \
-- -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake)
QT_ENV_VARS := $(HOSTVARS) DXSDK_DIR=$(PREFIX)/bin
QT_QINSTALL="$(shell cd $(SRC)/qt/; pwd -P)/install_wrapper.sh"
# Build
+$(CMAKEBUILD)
qmake_toolchain = echo "!host_build {" > $(1)/.qmake.cache && \
echo " QMAKE_C = $(CC)" >> $(1)/.qmake.cache && \
echo " QMAKE_CXX = $(CXX)" >> $(1)/.qmake.cache && \
echo " QMAKE_STRIP = $(STRIP)" >> $(1)/.qmake.cache && \
echo " QMAKE_CFLAGS += -isystem $(PREFIX)/include $(CFLAGS)" >> $(1)/.qmake.cache && \
echo " QMAKE_CXXFLAGS += -isystem $(PREFIX)/include $(CXXFLAGS)" >> $(1)/.qmake.cache && \
echo " QMAKE_LFLAGS += $(LDFLAGS)" >> $(1)/.qmake.cache && \
echo " QMAKE_INSTALL_FILE = VLC_PREFIX=$(PREFIX) $(QT_QINSTALL)" >> $(1)/.qmake.cache && \
echo "} else {" >> $(1)/.qmake.cache && \
echo " QMAKE_C = $(BUILDCC)" >> $(1)/.qmake.cache && \
echo " QMAKE_CXX = $(BUILDCXX)" >> $(1)/.qmake.cache && \
echo " QMAKE_STRIP = $(BUILDSTRIP)" >> $(1)/.qmake.cache && \
echo " QMAKE_CFLAGS += $(BUILDCFLAGS)" >> $(1)/.qmake.cache && \
echo " QMAKE_CXXFLAGS += $(BUILDCXXFLAGS)" >> $(1)/.qmake.cache && \
echo " QMAKE_LFLAGS += $(BUILDLDFLAGS)" >> $(1)/.qmake.cache && \
echo "}" >> $(1)/.qmake.cache && \
echo "CONFIG -= debug_and_release" >> $(1)/.qmake.cache && \
echo "CONFIG += object_parallel_to_source create_pc force_bootstrap" >> $(1)/.qmake.cache
# Install
$(CMAKEINSTALL)
# qt-configure-module wants to have qt-cmake-private in libexec:
mkdir -p $(PREFIX)/libexec
ln -sf $(PREFIX)/bin/qt-cmake-private $(PREFIX)/libexec/qt-cmake-private
.qt: qt
$(call qmake_toolchain, $<)
# Configure qt, build and run qmake
+cd $< && $(QT_ENV_VARS) ./configure $(QT_PLATFORM) $(QT_CONFIG) -prefix $(PREFIX) -hostprefix $(PREFIX)/lib/qt5 \
$(shell $(SRC)/qt/configure-env.py $(CPPFLAGS) $(LDFLAGS))
# Build libraries, widgets, plugins, doc (empty)
$(MAKE) -C $<
# Install libraries, widgets, plugins, tools, doc (empty)
$(MAKE) -C $< install
#fix host tools headers to avoid collision with target headers
mkdir -p $(PREFIX)/lib/qt5/include
cp -R $(PREFIX)/include/QtCore $(PREFIX)/lib/qt5/include
sed -i.orig -e "s#\$\$QT_MODULE_INCLUDE_BASE#$(PREFIX)/lib/qt5/include#g" $(PREFIX)/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
touch $@

View File

@ -1,22 +0,0 @@
--- qt/qmake/generators/makefile.cpp.orig 2022-12-09 12:33:15.756774500 +0100
+++ qt/qmake/generators/makefile.cpp 2022-12-09 12:41:41.744418400 +0100
@@ -3471,11 +3471,16 @@ QString MakefileGenerator::installMetaFi
{
QString ret;
QString sedargs = createSedArgs(replace_rule);
- if (sedargs.isEmpty()) {
- ret = "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
- } else {
- ret = "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
+ QString escaped_src = escapeFilePath(src);
+ if (!sedargs.isEmpty()) {
+ int pos = src.lastIndexOf('.');
+ QString filename = src.left(pos);
+ QString ext = src.mid(pos + 1);
+ escaped_src = escapeFilePath(filename + ".qmakereplace." + ext);
+ ret += "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > "
+ + escaped_src + " && ";
}
+ ret += "$(INSTALL_FILE) " + escaped_src + ' ' + escapeFilePath(dst);
return ret;
}

View File

@ -1,26 +0,0 @@
--- a/mkspecs/features/qml_plugin.prf 2022-09-02 14:15:09.023765377 +0200
+++ b/mkspecs/features/qml_plugin.prf 2022-09-02 14:59:06.296938907 +0200
@@ -30,9 +30,9 @@
}
isEmpty(TARGETPATH): TARGETPATH = $$eval(QT.$${CXX_MODULE}.name)
+isEmpty(VERSION): VERSION = $$MODULE_VERSION
win32:CONFIG(shared, static|shared) {
# Embed a VERSIONINFO resource into the plugin's DLL.
- isEmpty(VERSION): VERSION = $$MODULE_VERSION
CONFIG += skip_target_version_ext
}
--- a/mkspecs/features/qt_plugin.prf 2022-09-02 14:15:04.593670115 +0200
+++ b/mkspecs/features/qt_plugin.prf 2022-09-02 14:59:06.296938907 +0200
@@ -17,9 +17,9 @@
CONFIG += plugin create_pc
DESTDIR = $$MODULE_BASE_OUTDIR/plugins/$$PLUGIN_TYPE
+isEmpty(VERSION): VERSION = $$QT_VERSION
win32:CONFIG(shared, static|shared) {
# Embed a VERSIONINFO resource into the plugin's DLL.
- isEmpty(VERSION): VERSION = $$QT_VERSION
CONFIG += skip_target_version_ext
}