Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (7)
Showing
with 315 additions and 735 deletions
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
From 52965e15b8f87e192c4cfbeb772648d018b77016 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Thu, 4 Apr 2024 13:32:31 +0300
Subject: [PATCH] QTypeInfo: Add a missing include
This header uses std::is_trivial_v, which requires including
the <type_traits> header.
When building with PCH enabled (which is the default), this
dependency does get satisfied via the PCH, so no issue is
visible.
This fixes building with recent version of libc++ when configured
with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES (which removes unnecessary
transitive dependencies between the libc++ headers, a configuration
which may become the default in the future), with PCH disabled.
Pick-to: 6.7 6.5 6.2
Change-Id: I5e3ae20e366ed3028b1156cee05bcf2908d6e845
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit adb49d65e0774fa6be0b0d9d490c6f1fc5066a1b)
---
src/corelib/global/qtypeinfo.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index f89bf72635..3b8c40e974 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -11,6 +11,7 @@
#include <variant>
#include <optional>
#include <tuple>
+#include <type_traits>
QT_BEGIN_NAMESPACE
--
2.34.1
From d05eac31981d69c4b29aaf38f9f0addb2b549fae Mon Sep 17 00:00:00 2001
From 846a13b3703dc4bac6f7a9f3bbb6aa31fa5660f7 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
Subject: [PATCH 1/7] 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
index ed88e250a2..835487a818 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
@@ -216,6 +216,9 @@ void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &me
qStringToLimitedWCharArray(message, tnd.szInfo, 256);
qStringToLimitedWCharArray(title, tnd.szInfoTitle, 64);
......@@ -22,5 +22,5 @@ index acad849a3d..fae00c2081 100644
const auto size = icon.actualSize(QSize(256, 256));
--
2.43.1
2.44.0
From 55a7e34d7b4eeafb3465d9869920dc88dbc3a6e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 9 Apr 2024 14:03:29 +0300
Subject: [PATCH 2/3] QStringTokenizer: Add a missing include
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This header uses std::forward_iterator_tag, which requires including
the <iterator> header.
This fixes building with libc++ with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES enabled.
Pick-to: 6.7 6.5 6.2
Change-Id: Id2ce97e158c87dab1efe30e54a93f0bc9351de5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit aa896ca9f51252b6d01766e19a03e41bd49857f3)
---
src/corelib/text/qstringtokenizer.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h
index 2b679608f9..7a627b4508 100644
--- a/src/corelib/text/qstringtokenizer.h
+++ b/src/corelib/text/qstringtokenizer.h
@@ -5,6 +5,7 @@
#include <QtCore/qnamespace.h>
#include <QtCore/qcontainerfwd.h>
+#include <iterator>
QT_BEGIN_NAMESPACE
--
2.25.1
From d9d290432bfc482ba970bf215f1dcec59fa7da01 Mon Sep 17 00:00:00 2001
From 25f81e4e301efa03c4b72eda8ea10249f2779b55 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
Subject: [PATCH 2/7] Try to generate pkgconfig pc files in static build
---
cmake/QtPkgConfigHelpers.cmake | 7 ++++---
......@@ -26,5 +26,5 @@ index dbe736c438..caacd4e8ed 100644
set(pkgconfig_file "${QT_CMAKE_EXPORT_NAMESPACE}${module}")
set(pkgconfig_name "${QT_CMAKE_EXPORT_NAMESPACE} ${module}")
--
2.43.1
2.44.0
From ba1059325eedba710d933fa0be4af1e6a4056aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 9 Apr 2024 15:38:02 +0300
Subject: [PATCH 3/3] CMake: Fix a misplaced > in pkg-config files
The Qt CMake routines for generating pkg-config files don't
handle all sorts of generator expressions, see
qt_internal_set_pkg_config_cpp_flags in QtPkgConfigHelpers.cmake
which hardcodes handling of some specific expressions. In this
case, they don't handle the semicolon within the generator
expression expansion.
For the UNICODE and _UNICODE defines, this means that the pkg-config
file ends up containing "-D_UNICODE>" with the trailing ">". (The
pkg-config generator tries to parse out the generator expressions,
but the semicolon gets handled as a higher level separator, leaving
the closing bracket ">" behind.)
This issue only shows up for mingw targets, because pkg-config files
aren't generated in MSVC style builds.
Escape the semicolon as $<SEMICOLON> to make it not break the
surrounding generator expression, as parsed by the pkg-config file
generator.
The generator expressions aren't fully correctly evaluated for the
pkg-config files though; the UNICODE and _UNICODE defines don't
end up in the resulting pkg-config file even though they're used
during compilation (both before and after this change).
Fixes: QTBUG-103019
Co-authored-by: Martin Reboredo <yakoyoku@gmail.com>
Pick-to: 6.7 6.5 6.2
Change-Id: Icdb380e3b42be2a47372a8ee2b61378a33c685f7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Li Xinwei <1326710505@qq.com>
(cherry picked from commit f35b9530b9acf954f8741d0ee2b4b68fc90a4afc)
---
cmake/QtFlagHandlingHelpers.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index 91e1de8644..cdbaaacad4 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -365,7 +365,7 @@ function(qt_internal_enable_unicode_defines)
set(no_unicode_condition
"$<NOT:$<BOOL:$<TARGET_PROPERTY:QT_NO_UNICODE_DEFINES>>>")
target_compile_definitions(Platform
- INTERFACE "$<${no_unicode_condition}:UNICODE;_UNICODE>")
+ INTERFACE "$<${no_unicode_condition}:UNICODE$<SEMICOLON>_UNICODE>")
endif()
endfunction()
--
2.25.1
From 13ced07c50bc04b7f67001aa6521aee09f3cbfb8 Mon Sep 17 00:00:00 2001
From a566b1d5192a99b41ae13706668b7c8bf786e204 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"
Subject: [PATCH 3/7] Revert "QMutex: remove qmutex_win.cpp"
This reverts commit b6e30e9fee98f9cdfec4c54c980864f65632519c.
---
......@@ -15,18 +15,18 @@ This reverts commit b6e30e9fee98f9cdfec4c54c980864f65632519c.
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
index bf24eec2cf..4809e32766 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!
@@ -524,6 +524,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_animation
qt_internal_extend_target(Core CONDITION QT_FEATURE_thread AND WIN32
SOURCES
thread/qfutex_win_p.h
+ 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
@@ -1362,6 +1363,7 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_ctf
set_source_files_properties(
thread/qmutex_mac.cpp
thread/qmutex_unix.cpp
......@@ -53,10 +53,10 @@ index 9fa7e70da9..0c205fff66 100644
// We mean it.
//
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index b794d79e23..1a30b25ad5 100644
index ec6c711a4f..97ccbdf3a4 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -913,10 +913,12 @@ void QMutexPrivate::derefWaiters(int value) noexcept
@@ -908,10 +908,12 @@ void QMutexPrivate::derefWaiters(int value) noexcept
QT_END_NAMESPACE
......@@ -134,7 +134,7 @@ index 0000000000..8c7741c113
+
+QT_END_NAMESPACE
diff --git a/src/corelib/thread/qwaitcondition_p.h b/src/corelib/thread/qwaitcondition_p.h
index cfb36ca30b..01bb000366 100644
index 14833d56ef..7b1becb3db 100644
--- a/src/corelib/thread/qwaitcondition_p.h
+++ b/src/corelib/thread/qwaitcondition_p.h
@@ -7,9 +7,10 @@
......@@ -152,5 +152,5 @@ index cfb36ca30b..01bb000366 100644
// We mean it.
//
--
2.43.1
2.44.0
From 94a5a61135c85489426896d2b164974128edf542 Mon Sep 17 00:00:00 2001
From 5e7f3336f7a924a0401934d66512c4073aa785fc 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
Subject: [PATCH 4/7] 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
index f7a49dc292..a4c74dd837 100644
--- a/src/gui/rhi/qrhi.h
+++ b/src/gui/rhi/qrhi.h
@@ -1964,6 +1964,9 @@ protected:
@@ -1987,6 +1987,9 @@ protected:
private:
Q_DISABLE_COPY(QRhi)
QRhiImplementation *d = nullptr;
......@@ -22,5 +22,5 @@ index c96ab7b19c..1aa9d77c76 100644
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags)
--
2.43.1
2.44.0
From 354c2ed8c581d9b0fc0bf776f653c270f307f075 Mon Sep 17 00:00:00 2001
From 94a120d3668a29b3f08b3dcba68656038888a60d 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
Subject: [PATCH 5/7] Do not include D3D12MemAlloc.h in header file
---
src/gui/rhi/qrhid3d12.cpp | 11 +++++++++++
......@@ -9,7 +9,7 @@ Subject: [PATCH 6/8] Do not include D3D12MemAlloc.h in header file
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
index ce9c5dcbdb..ae6e4ac376 100644
--- a/src/gui/rhi/qrhid3d12.cpp
+++ b/src/gui/rhi/qrhid3d12.cpp
@@ -2,6 +2,7 @@
......@@ -17,10 +17,10 @@ index 4a5e52bfc6..0787b9a0c8 100644
#include "qrhid3d12_p.h"
+#include "D3D12MemAlloc.h"
#include "qshader.h"
#include <QWindow>
#include <qmath.h>
@@ -124,6 +125,16 @@ QT_BEGIN_NAMESPACE
#include <QtCore/private/qsystemerror_p.h>
#include <comdef.h>
@@ -123,6 +124,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;
......@@ -38,10 +38,10 @@ index 4a5e52bfc6..0787b9a0c8 100644
{
debugLayer = params->enableDebugLayer;
diff --git a/src/gui/rhi/qrhid3d12_p.h b/src/gui/rhi/qrhid3d12_p.h
index a6954d279c..ef13cc214a 100644
index c6d4123c09..08d11e9e47 100644
--- a/src/gui/rhi/qrhid3d12_p.h
+++ b/src/gui/rhi/qrhid3d12_p.h
@@ -28,7 +28,12 @@
@@ -27,7 +27,12 @@
#include <dxgi1_6.h>
#include <dcomp.h>
......@@ -53,9 +53,9 @@ index a6954d279c..ef13cc214a 100644
+ class Allocator;
+}
QT_BEGIN_NAMESPACE
@@ -291,15 +296,7 @@ struct QD3D12Resource
// ID3D12Device2 and ID3D12GraphicsCommandList1 and types and enums introduced
// with those are hard requirements now. These should be declared in any
@@ -311,15 +316,7 @@ struct QD3D12Resource
return pool->add({ resource, state, resource->GetDesc(), nullptr, nullptr, 0, false });
}
......@@ -73,5 +73,5 @@ index a6954d279c..ef13cc214a 100644
struct QD3D12Pipeline
--
2.43.1
2.44.0
From 944575ba8b8e7817fd11cddbae2c2fc20eabd556 Mon Sep 17 00:00:00 2001
From 2e74ca54c146bda95482900faba547e96ece24a1 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
Subject: [PATCH 6/7] Try DCompositionCreateDevice3() first if available
---
src/gui/rhi/qrhid3dhelpers_p.h | 13 ++++++++++++-
src/gui/rhi/qrhid3dhelpers.cpp | 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()
diff --git a/src/gui/rhi/qrhid3dhelpers.cpp b/src/gui/rhi/qrhid3dhelpers.cpp
index 216c358cbe..79efb386eb 100644
--- a/src/gui/rhi/qrhid3dhelpers.cpp
+++ b/src/gui/rhi/qrhid3dhelpers.cpp
@@ -110,7 +110,18 @@ IDCompositionDevice *createDirectCompositionDevice()
_In_ REFIID iid,
_Outptr_ void **dcompositionDevice);
DCompositionCreateDeviceFuncPtr func = reinterpret_cast<DCompositionCreateDeviceFuncPtr>(
......@@ -32,5 +32,5 @@ index f20c042860..d78c5a2bb2 100644
qWarning("Unable to resolve DCompositionCreateDevice, perhaps dcomp.dll is missing?");
return nullptr;
--
2.43.1
2.44.0
From 2a54018b77e290b8613718de32c99f02e146a415 Mon Sep 17 00:00:00 2001
From 09d078434fef71a34690b098720d8e6bfe7dc5f8 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Mon, 22 Jan 2024 21:37:39 +0200
Subject: [PATCH 8/8] Try to satisfy Windows 7 compatibility
Subject: [PATCH 7/7] Try to satisfy Windows 7 compatibility
---
cmake/QtBaseConfigureTests.cmake | 10 +-
src/corelib/CMakeLists.txt | 18 +--
src/corelib/CMakeLists.txt | 20 +--
src/corelib/global/qt_windows.h | 6 +-
src/corelib/io/qfilesystemengine_win.cpp | 5 +
src/corelib/kernel/qeventdispatcher_win.cpp | 10 +-
src/corelib/kernel/qfunctions_win.cpp | 13 +-
src/corelib/thread/qfutex_p.h | 41 +++++-
src/corelib/thread/qfutex_win_p.h | 42 +++++-
src/corelib/thread/qmutex_win.cpp | 4 +-
src/gui/CMakeLists.txt | 1 -
src/gui/rhi/qrhid3d11.cpp | 8 +-
src/gui/rhi/qrhid3d12.cpp | 67 +++++++++-
src/gui/rhi/qrhid3d11.cpp | 9 +-
src/gui/rhi/qrhid3d12.cpp | 68 +++++++++-
.../text/windows/qwindowsfontdatabasebase.cpp | 14 +-
src/plugins/platforms/direct2d/CMakeLists.txt | 1 -
.../networklistmanager/CMakeLists.txt | 1 -
src/plugins/platforms/direct2d/CMakeLists.txt | 2 -
.../direct2d/qwindowsdirect2dcontext.cpp | 1 +
src/plugins/platforms/windows/CMakeLists.txt | 1 -
src/plugins/platforms/windows/CMakeLists.txt | 2 -
.../platforms/windows/qtwindowsglobal.h | 4 +
.../platforms/windows/qwin10helpers.cpp | 24 +++-
.../platforms/windows/qwindowscontext.cpp | 126 +++++++++++++++---
.../platforms/windows/qwindowscontext.h | 94 +++++++++++++
.../platforms/windows/qwindowscontext.h | 95 +++++++++++++
.../platforms/windows/qwindowsdrag.cpp | 10 +-
.../platforms/windows/qwindowskeymapper.cpp | 17 ++-
.../windows/qwindowspointerhandler.cpp | 33 +++--
.../platforms/windows/qwindowsscreen.cpp | 18 ++-
.../platforms/windows/qwindowstheme.cpp | 6 +-
.../platforms/windows/qwindowswindow.cpp | 46 +++++--
25 files changed, 498 insertions(+), 80 deletions(-)
.../platforms/windows/qwindowswindow.cpp | 48 +++++--
src/widgets/styles/qwindowsstyle.cpp | 26 +++-
27 files changed, 523 insertions(+), 92 deletions(-)
diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake
index 7713def6bf..0af3d622f9 100644
......@@ -58,10 +60,10 @@ index 7713def6bf..0af3d622f9 100644
CACHE STRING "Qt platform specific pre-processor defines" FORCE)
endif()
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index d43ece2b9f..804c2c5cf0 100644
index 4809e32766..ddf4c8057c 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -493,16 +493,16 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_animation
@@ -517,17 +517,17 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_animation
animation/qvariantanimation.cpp animation/qvariantanimation.h animation/qvariantanimation_p.h
)
......@@ -74,19 +76,32 @@ index d43ece2b9f..804c2c5cf0 100644
+# Which seems to be available on Windows 7 (for some reason)
+# but is broken. Use the symbols from kernel32 instead.
qt_internal_extend_target(Core CONDITION QT_FEATURE_thread AND WIN32
- SOURCES
- thread/qmutex_win.cpp
- thread/qwaitcondition_win.cpp
SOURCES
thread/qfutex_win_p.h
thread/qmutex_win.cpp
thread/qwaitcondition_win.cpp
- LIBRARIES
- synchronization
+ SOURCES
+ thread/qmutex_win.cpp
+ thread/qwaitcondition_win.cpp
+ # LIBRARIES
+ # synchronization
+ # LIBRARIES
+ # synchronization
)
qt_internal_extend_target(Core CONDITION WIN32
@@ -821,10 +821,10 @@ qt_internal_extend_target(Core CONDITION WASM
)
# On MS-Win, clang has two flavors, one of which immitates MSVC (so claims to be it)
-qt_internal_extend_target(Core CONDITION MSVC
- LIBRARIES
- runtimeobject
-)
+# qt_internal_extend_target(Core CONDITION MSVC
+# LIBRARIES
+# runtimeobject
+# )
qt_internal_extend_target(Core CONDITION QT_FEATURE_icu
SOURCES
diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h
index 5586d0b927..eb0264b4ee 100644
--- a/src/corelib/global/qt_windows.h
......@@ -128,10 +143,10 @@ index 67378e2b5d..580e141e2b 100644
#include "qoperatingsystemversion.h"
#include "qplatformdefs.h"
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index f7fd2a7b51..05499f6d00 100644
index a7663b2481..78ad3d3ede 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -363,7 +363,15 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t)
@@ -362,7 +362,15 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t)
if (!ok) {
// user normal timers for (Very)CoarseTimers, or if no more multimedia timers available
......@@ -149,14 +164,14 @@ index f7fd2a7b51..05499f6d00 100644
if (!ok)
ok = SetTimer(internalHwnd, t->timerId, interval, nullptr);
diff --git a/src/corelib/kernel/qfunctions_win.cpp b/src/corelib/kernel/qfunctions_win.cpp
index d5ce3e5894..9a78a581e1 100644
index d5ce3e5894..a712a1a74f 100644
--- a/src/corelib/kernel/qfunctions_win.cpp
+++ b/src/corelib/kernel/qfunctions_win.cpp
@@ -4,6 +4,7 @@
#include "qfunctions_win_p.h"
#include <QtCore/qdebug.h>
+#include <plugin/qsystemlibrary_p.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#include <combaseapi.h>
#include <objbase.h>
......@@ -179,23 +194,23 @@ index d5ce3e5894..9a78a581e1 100644
case ERROR_INSUFFICIENT_BUFFER:
return true;
case APPMODEL_ERROR_NO_PACKAGE:
diff --git a/src/corelib/thread/qfutex_p.h b/src/corelib/thread/qfutex_p.h
index 48f03f5ed0..e1af23c9d8 100644
--- a/src/corelib/thread/qfutex_p.h
+++ b/src/corelib/thread/qfutex_p.h
@@ -16,6 +16,7 @@
//
diff --git a/src/corelib/thread/qfutex_win_p.h b/src/corelib/thread/qfutex_win_p.h
index 75a12bd82c..3d2aa021db 100644
--- a/src/corelib/thread/qfutex_win_p.h
+++ b/src/corelib/thread/qfutex_win_p.h
@@ -18,37 +18,65 @@
#include <private/qglobal_p.h>
+#include <plugin/qsystemlibrary_p.h>
#include <QtCore/qtsan_impl.h>
#include <qdeadlinetimer.h>
#include <qtsan_impl.h>
+#include <QtCore/private/qsystemlibrary_p.h>
QT_BEGIN_NAMESPACE
@@ -113,29 +114,57 @@ QT_END_NAMESPACE
#include <qt_windows.h>
-#define QT_ALWAYS_USE_FUTEX
-
QT_BEGIN_NAMESPACE
namespace QtWindowsFutex {
-#define QT_ALWAYS_USE_FUTEX
-constexpr inline bool futexAvailable() { return true; }
+typedef BOOL(*WaitOnAddressCompat)( _In_ volatile VOID *Address, _In_ PVOID CompareAddress, _In_ SIZE_T AddressSize, _In_ DWORD dwMilliseconds);
+typedef void(*WakeByAddressAllCompat)(_In_ PVOID Address);
......@@ -215,7 +230,7 @@ index 48f03f5ed0..e1af23c9d8 100644
+ funcs.waitOnAddress = (WaitOnAddressCompat)(synchWin8ApiSet.resolve("WaitOnAddress"));
+ funcs.wakeByAddressAll = (WakeByAddressAllCompat)(synchWin8ApiSet.resolve("WakeByAddressAll"));
+ funcs.wakeByAddressSingle = (WakeByAddressSingleCompat)(synchWin8ApiSet.resolve("WakeByAddressSingle"));
+
+
+ return funcs;
+}();
+
......@@ -234,11 +249,12 @@ index 48f03f5ed0..e1af23c9d8 100644
QtTsan::futexAcquire(&futex);
}
template <typename Atomic>
inline bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, qint64 nstimeout)
inline bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, QDeadlineTimer deadline)
{
- BOOL r = WaitOnAddress(&futex, &expectedValue, sizeof(expectedValue), DWORD(nstimeout / 1000 / 1000));
+ assert(futexFuncs.waitOnAddress);
+ BOOL r = futexFuncs.waitOnAddress(&futex, &expectedValue, sizeof(expectedValue), DWORD(nstimeout / 1000 / 1000));
using namespace std::chrono;
- BOOL r = WaitOnAddress(&futex, &expectedValue, sizeof(expectedValue), DWORD(deadline.remainingTime()));
+ BOOL r = futexFuncs.waitOnAddress(&futex, &expectedValue, sizeof(expectedValue), DWORD(deadline.remainingTime()));
return r || GetLastError() != ERROR_TIMEOUT;
}
template <typename Atomic> inline void futexWakeAll(Atomic &futex)
......@@ -253,7 +269,7 @@ index 48f03f5ed0..e1af23c9d8 100644
+ assert(futexFuncs.wakeByAddressSingle);
+ futexFuncs.wakeByAddressSingle(&futex);
}
}
} // namespace QtWindowsFutex
namespace QtFutex = QtWindowsFutex;
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
index 8c7741c113..ce3586a90b 100644
......@@ -272,22 +288,30 @@ index 8c7741c113..ce3586a90b 100644
void QMutexPrivate::wakeUp() noexcept
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index dded14bb31..c1b2e2d5d9 100644
index 3207244afd..437a09c708 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -426,7 +426,6 @@ qt_internal_extend_target(Gui CONDITION WIN32
@@ -433,7 +433,6 @@ qt_internal_extend_target(Gui CONDITION WIN32
d3d11
dxgi
dxguid
- d3d12
)
if(QT_FEATURE_egl)
if(QT_FEATURE_graphicsframecapture)
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index 8c4eac9b1f..ce59ac794e 100644
index 92e4cacc16..844e9c072b 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -155,8 +155,14 @@ inline Int aligned(Int v, Int byteAlign)
@@ -8,6 +8,7 @@
#include <qmath.h>
#include <QtCore/qcryptographichash.h>
#include <QtCore/private/qsystemerror_p.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#include "qrhid3dhelpers_p.h"
QT_BEGIN_NAMESPACE
@@ -155,8 +156,14 @@ inline Int aligned(Int v, Int byteAlign)
static IDXGIFactory1 *createDXGIFactory2()
{
......@@ -304,10 +328,18 @@ index 8c4eac9b1f..ce59ac794e 100644
qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s",
qPrintable(QSystemError::windowsComString(hr)));
diff --git a/src/gui/rhi/qrhid3d12.cpp b/src/gui/rhi/qrhid3d12.cpp
index 0787b9a0c8..b3f484998a 100644
index ae6e4ac376..bce22ee6ce 100644
--- a/src/gui/rhi/qrhid3d12.cpp
+++ b/src/gui/rhi/qrhid3d12.cpp
@@ -125,6 +125,17 @@ QT_BEGIN_NAMESPACE
@@ -5,6 +5,7 @@
#include "D3D12MemAlloc.h"
#include <qmath.h>
#include <QtCore/private/qsystemerror_p.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#include <comdef.h>
#include "qrhid3dhelpers_p.h"
#include "cs_mipmap_p.h"
@@ -124,6 +125,17 @@ 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;
......@@ -325,7 +357,7 @@ index 0787b9a0c8..b3f484998a 100644
void QD3D12Resource::releaseResources()
{
if (owns) {
@@ -185,14 +196,23 @@ bool QRhiD3D12::create(QRhi::Flags flags)
@@ -190,14 +202,23 @@ bool QRhiD3D12::create(QRhi::Flags flags)
UINT factoryFlags = 0;
if (debugLayer)
factoryFlags |= DXGI_CREATE_FACTORY_DEBUG;
......@@ -351,7 +383,7 @@ index 0787b9a0c8..b3f484998a 100644
}
if (SUCCEEDED(hr)) {
debugLayer = false;
@@ -214,7 +234,18 @@ bool QRhiD3D12::create(QRhi::Flags flags)
@@ -219,7 +240,18 @@ bool QRhiD3D12::create(QRhi::Flags flags)
if (debugLayer) {
ID3D12Debug1 *debug = nullptr;
......@@ -371,7 +403,7 @@ index 0787b9a0c8..b3f484998a 100644
qCDebug(QRHI_LOG_INFO, "Enabling D3D12 debug layer");
debug->EnableDebugLayer();
debug->Release();
@@ -284,7 +315,22 @@ bool QRhiD3D12::create(QRhi::Flags flags)
@@ -287,7 +319,22 @@ bool QRhiD3D12::create(QRhi::Flags flags)
if (minimumFeatureLevel == 0)
minimumFeatureLevel = MIN_FEATURE_LEVEL;
......@@ -393,9 +425,9 @@ index 0787b9a0c8..b3f484998a 100644
+
+ hr = d3D12CreateDevice(activeAdapter,
minimumFeatureLevel,
__uuidof(ID3D12Device),
__uuidof(ID3D12Device2),
reinterpret_cast<void **>(&dev));
@@ -2587,7 +2633,12 @@ bool QD3D12MipmapGenerator::create(QRhiD3D12 *rhiD)
@@ -2770,7 +2817,12 @@ bool QD3D12MipmapGenerator::create(QRhiD3D12 *rhiD)
rsDesc.Desc_1_1.pStaticSamplers = &samplerDesc;
ID3DBlob *signature = nullptr;
......@@ -409,7 +441,7 @@ index 0787b9a0c8..b3f484998a 100644
if (FAILED(hr)) {
qWarning("Failed to serialize root signature: %s", qPrintable(QSystemError::windowsComString(hr)));
return false;
@@ -4857,7 +4908,11 @@ QD3D12ObjectHandle QD3D12ShaderResourceBindings::createRootSignature(const QD3D1
@@ -5025,7 +5077,11 @@ QD3D12ObjectHandle QD3D12ShaderResourceBindings::createRootSignature(const QD3D1
rsDesc.Desc_1_1.Flags = D3D12_ROOT_SIGNATURE_FLAGS(rsFlags);
ID3DBlob *signature = nullptr;
......@@ -423,18 +455,18 @@ index 0787b9a0c8..b3f484998a 100644
qWarning("Failed to serialize root signature: %s", qPrintable(QSystemError::windowsComString(hr)));
return {};
diff --git a/src/gui/text/windows/qwindowsfontdatabasebase.cpp b/src/gui/text/windows/qwindowsfontdatabasebase.cpp
index f9b36b4852..87d9e9b967 100644
index cef739201b..72a786efbf 100644
--- a/src/gui/text/windows/qwindowsfontdatabasebase.cpp
+++ b/src/gui/text/windows/qwindowsfontdatabasebase.cpp
@@ -6,6 +6,7 @@
#include <QtCore/QThreadStorage>
#include <QtCore/QtEndian>
+#include <private/qsystemlibrary_p.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#if QT_CONFIG(directwrite)
# if QT_CONFIG(directwrite3)
@@ -685,7 +686,18 @@ QFont QWindowsFontDatabaseBase::systemDefaultFont()
@@ -704,7 +705,18 @@ QFont QWindowsFontDatabaseBase::systemDefaultFont()
// Qt 6: Obtain default GUI font (typically "Segoe UI, 9pt", see QTBUG-58610)
NONCLIENTMETRICS ncm = {};
ncm.cbSize = sizeof(ncm);
......@@ -454,18 +486,33 @@ index f9b36b4852..87d9e9b967 100644
const QFont systemFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMessageFont);
qCDebug(lcQpaFonts) << __FUNCTION__ << systemFont;
return systemFont;
diff --git a/src/plugins/networkinformation/networklistmanager/CMakeLists.txt b/src/plugins/networkinformation/networklistmanager/CMakeLists.txt
index f15eedf866..9e68765b89 100644
--- a/src/plugins/networkinformation/networklistmanager/CMakeLists.txt
+++ b/src/plugins/networkinformation/networklistmanager/CMakeLists.txt
@@ -16,7 +16,6 @@ qt_internal_add_plugin(QNLMNIPlugin
qt_internal_extend_target(QNLMNIPlugin CONDITION MSVC
LIBRARIES
- runtimeobject
oleaut32
)
diff --git a/src/plugins/platforms/direct2d/CMakeLists.txt b/src/plugins/platforms/direct2d/CMakeLists.txt
index e21b230cd7..be6bd1d0ba 100644
index fe4a237aff..4357652207 100644
--- a/src/plugins/platforms/direct2d/CMakeLists.txt
+++ b/src/plugins/platforms/direct2d/CMakeLists.txt
@@ -76,7 +76,6 @@ qt_internal_add_plugin(QWindowsDirect2DIntegrationPlugin
@@ -77,10 +77,8 @@ qt_internal_add_plugin(QWindowsDirect2DIntegrationPlugin
winmm
winspool
wtsapi32
- shcore
comdlg32
d3d9
runtimeobject
- runtimeobject
)
# Resources:
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
index 307ca2e550..8f1199e229 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
......@@ -479,19 +526,22 @@ index 307ca2e550..8f1199e229 100644
#include "qwindowsdirect2dhelpers.h"
#include "qwindowsdirect2dintegration.h"
diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt
index ca1bbcb758..1ab2db7473 100644
index ea119bfb1e..cb9be899a7 100644
--- a/src/plugins/platforms/windows/CMakeLists.txt
+++ b/src/plugins/platforms/windows/CMakeLists.txt
@@ -63,7 +63,6 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin
@@ -64,10 +64,8 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin
winmm
winspool
wtsapi32
- shcore
comdlg32
d3d9
runtimeobject
- runtimeobject
)
# Resources:
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 22787bd63e..95798a9a91 100644
index 96a72600eb..067069d8de 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -60,6 +60,10 @@
......@@ -554,7 +604,7 @@ index 026e81cb0c..78c9bf2ea0 100644
if (FAILED(hr))
return false;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 43de7e7858..d9bafe7501 100644
index c363b85cb3..0661f41aae 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -44,6 +44,8 @@
......@@ -564,9 +614,9 @@ index 43de7e7858..d9bafe7501 100644
+#include <QtCore/qoperatingsystemversion.h>
+#include <QtCore/private/qsystemlibrary_p.h>
#include <QtCore/private/qwinregistry_p.h>
#include <QtCore/private/qfactorycacheregistration_p.h>
#include <QtCore/private/qsystemerror_p.h>
@@ -118,6 +120,85 @@ static inline bool sessionManagerInteractionBlocked()
#if QT_CONFIG(cpp_winrt)
# include <QtCore/private/qfactorycacheregistration_p.h>
@@ -121,6 +123,85 @@ static inline bool sessionManagerInteractionBlocked()
static inline bool sessionManagerInteractionBlocked() { return false; }
#endif
......@@ -652,7 +702,7 @@ index 43de7e7858..d9bafe7501 100644
QWindowsContext *QWindowsContext::m_instance = nullptr;
/*!
@@ -161,6 +242,9 @@ bool QWindowsContextPrivate::m_v2DpiAware = false;
@@ -164,6 +245,9 @@ bool QWindowsContextPrivate::m_v2DpiAware = false;
QWindowsContextPrivate::QWindowsContextPrivate()
: m_oleInitializeResult(OleInitialize(nullptr))
{
......@@ -662,7 +712,7 @@ index 43de7e7858..d9bafe7501 100644
if (m_pointerHandler.touchDevice() || m_mouseHandler.touchDevice())
m_systemInfo |= QWindowsContext::SI_SupportsTouch;
m_displayContext = GetDC(nullptr);
@@ -279,6 +363,12 @@ bool QWindowsContext::initPointer(unsigned integrationOptions)
@@ -282,6 +366,12 @@ bool QWindowsContext::initPointer(unsigned integrationOptions)
if (integrationOptions & QWindowsIntegration::DontUseWMPointer)
return false;
......@@ -675,7 +725,7 @@ index 43de7e7858..d9bafe7501 100644
d->m_systemInfo |= QWindowsContext::SI_SupportsPointer;
return true;
}
@@ -347,29 +437,31 @@ void QWindowsContext::setDetectAltGrModifier(bool a)
@@ -350,29 +440,31 @@ void QWindowsContext::setDetectAltGrModifier(bool a)
}
[[nodiscard]] static inline QtWindows::DpiAwareness
......@@ -716,7 +766,7 @@ index 43de7e7858..d9bafe7501 100644
return dpiAwarenessContextToQtDpiAwareness(context);
}
@@ -382,7 +474,10 @@ QtWindows::DpiAwareness QWindowsContext::processDpiAwareness()
@@ -385,7 +477,10 @@ QtWindows::DpiAwareness QWindowsContext::processDpiAwareness()
// return the default DPI_AWARENESS_CONTEXT for the process if
// SetThreadDpiAwarenessContext() was never called. So we can use
// it as an equivalent.
......@@ -728,7 +778,7 @@ index 43de7e7858..d9bafe7501 100644
return dpiAwarenessContextToQtDpiAwareness(context);
}
@@ -442,11 +537,11 @@ bool QWindowsContext::setProcessDpiAwareness(QtWindows::DpiAwareness dpiAwarenes
@@ -445,11 +540,11 @@ bool QWindowsContext::setProcessDpiAwareness(QtWindows::DpiAwareness dpiAwarenes
if (processDpiAwareness() == dpiAwareness)
return true;
const auto context = qtDpiAwarenessToDpiAwarenessContext(dpiAwareness);
......@@ -742,7 +792,7 @@ index 43de7e7858..d9bafe7501 100644
qCWarning(lcQpaWindow).noquote().nospace()
<< "SetProcessDpiAwarenessContext() failed: "
<< QSystemError::windowsString()
@@ -886,8 +981,8 @@ void QWindowsContext::forceNcCalcSize(HWND hwnd)
@@ -891,8 +986,8 @@ void QWindowsContext::forceNcCalcSize(HWND hwnd)
bool QWindowsContext::systemParametersInfo(unsigned action, unsigned param, void *out,
unsigned dpi)
{
......@@ -753,7 +803,7 @@ index 43de7e7858..d9bafe7501 100644
: SystemParametersInfo(action, param, out, 0);
return result == TRUE;
}
@@ -975,7 +1070,8 @@ static bool enableNonClientDpiScaling(HWND hwnd)
@@ -980,7 +1075,8 @@ static bool enableNonClientDpiScaling(HWND hwnd)
{
bool result = false;
if (QWindowsContext::windowDpiAwareness(hwnd) == QtWindows::DpiAwareness::PerMonitor) {
......@@ -764,13 +814,14 @@ index 43de7e7858..d9bafe7501 100644
const DWORD errorCode = GetLastError();
qErrnoWarning(int(errorCode), "EnableNonClientDpiScaling() failed for HWND %p (%lu)",
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 1a3b47be5e..df9547ca85 100644
index 1089224433..f6727a008a 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -44,6 +44,97 @@ class QPoint;
@@ -44,6 +44,98 @@ struct QWindowsContextPrivate;
class QPoint;
class QKeyEvent;
class QPointingDevice;
+
+struct QWindowsUser32DLL
+{
+ inline void init();
......@@ -865,7 +916,7 @@ index 1a3b47be5e..df9547ca85 100644
class QWindowsContext
{
Q_DISABLE_COPY_MOVE(QWindowsContext)
@@ -138,6 +229,9 @@ public:
@@ -138,6 +230,9 @@ public:
QWindowsScreenManager &screenManager();
QWindowsTabletSupport *tabletSupport() const;
......@@ -876,7 +927,7 @@ index 1a3b47be5e..df9547ca85 100644
void setAsyncExpose(bool value);
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 16025dcd46..eb128a7180 100644
index c6f55c3509..ae26641d86 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -1,6 +1,11 @@
......@@ -891,7 +942,7 @@ index 16025dcd46..eb128a7180 100644
#include <QtCore/qt_windows.h>
#include "qwindowsdrag.h"
#include "qwindowscontext.h"
@@ -667,11 +672,14 @@ static HRESULT startDoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource,
@@ -669,11 +674,14 @@ static HRESULT startDoDragDrop(LPDATAOBJECT pDataObj, LPDROPSOURCE pDropSource,
}
if (msg.message == WM_POINTERUPDATE) {
......@@ -908,10 +959,10 @@ index 16025dcd46..eb128a7180 100644
if (pointerInfo.pointerFlags & POINTER_FLAG_PRIMARY) {
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index fa46dec4aa..d33aae863a 100644
index af1230d240..edcb2889fd 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -751,14 +751,23 @@ static inline QString messageKeyText(const MSG &msg)
@@ -732,14 +732,23 @@ static inline QString messageKeyText(const MSG &msg)
[[nodiscard]] static inline int getTitleBarHeight(const HWND hwnd)
{
......@@ -940,7 +991,7 @@ index fa46dec4aa..d33aae863a 100644
}
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 77ed0f84d7..e0bca057a0 100644
index 9f1f25db8c..3660f2c0c8 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -1,6 +1,11 @@
......@@ -1016,7 +1067,7 @@ index 77ed0f84d7..e0bca057a0 100644
qWarning() << "GetPointerPenInfoHistory() failed:" << qt_error_string();
return false;
}
@@ -519,7 +531,8 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
@@ -520,7 +532,8 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
inputIds.insert(touchPoint.id);
// Avoid getting repeated messages for this frame if there are multiple pointerIds
......@@ -1026,7 +1077,7 @@ index 77ed0f84d7..e0bca057a0 100644
}
// Some devices send touches for each finger in a different message/frame, instead of consolidating
@@ -565,7 +578,11 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
@@ -567,7 +580,11 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
auto *penInfo = static_cast<POINTER_PEN_INFO *>(vPenInfo);
RECT pRect, dRect;
......@@ -1092,10 +1143,10 @@ index a50f9fd4b0..ac5711e6a2 100644
case ORIENTATION_PREFERENCE_NONE:
break;
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 4fccec98fb..9aa01c3e3a 100644
index 2a01b0fa0d..b79155dab6 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -664,7 +664,11 @@ void QWindowsTheme::refreshFonts()
@@ -672,7 +672,11 @@ void QWindowsTheme::refreshFonts()
fixedFont.setStyleHint(QFont::TypeWriter);
LOGFONT lfIconTitleFont;
......@@ -1109,10 +1160,10 @@ index 4fccec98fb..9aa01c3e3a 100644
m_fonts[SystemFont] = new QFont(QWindowsFontDatabase::systemDefaultFont());
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 05eb41b6ab..cb9ed96d40 100644
index c2c093faf4..d93b01f1ed 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -147,7 +147,7 @@ static QByteArray debugWinExStyle(DWORD exStyle)
@@ -148,7 +148,7 @@ static QByteArray debugWinExStyle(DWORD exStyle)
rc += " WS_EX_NOACTIVATE";
if (exStyle & WS_EX_NOPARENTNOTIFY)
rc += " WS_EX_NOPARENTNOTIFY";
......@@ -1121,7 +1172,7 @@ index 05eb41b6ab..cb9ed96d40 100644
rc += " WS_EX_NOREDIRECTIONBITMAP";
if (exStyle & WS_EX_RIGHT)
rc += " WS_EX_RIGHT";
@@ -526,8 +526,11 @@ static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::Windo
@@ -523,8 +523,11 @@ static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::Windo
// The width of the padded border will always be 0 if DWM composition is
// disabled, but since it will always be enabled and can't be programtically
// disabled from Windows 8, we are safe to go.
......@@ -1135,7 +1186,7 @@ index 05eb41b6ab..cb9ed96d40 100644
}
/*!
@@ -537,11 +540,14 @@ static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::Windo
@@ -534,11 +537,14 @@ static inline void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::Windo
static QMargins invisibleMargins(QPoint screenPoint)
{
......@@ -1151,7 +1202,7 @@ index 05eb41b6ab..cb9ed96d40 100644
const int gap = getResizeBorderThickness(dpiX);
return QMargins(gap, 0, gap, gap);
}
@@ -551,7 +557,12 @@ static QMargins invisibleMargins(QPoint screenPoint)
@@ -548,7 +554,12 @@ static QMargins invisibleMargins(QPoint screenPoint)
[[nodiscard]] static inline QMargins invisibleMargins(const HWND hwnd)
{
......@@ -1165,7 +1216,16 @@ index 05eb41b6ab..cb9ed96d40 100644
const int gap = getResizeBorderThickness(dpi);
return QMargins(gap, 0, gap, gap);
}
@@ -1067,7 +1078,14 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, DWORD style, DWORD exStyl
@@ -841,7 +852,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
// Currently only compatible with D3D surfaces, use it with care.
if (qEnvironmentVariableIntValue("QT_QPA_DISABLE_REDIRECTION_SURFACE"))
- exStyle |= WS_EX_NOREDIRECTIONBITMAP;
+ exStyle |= 0x00200000L /* WS_EX_NOREDIRECTIONBITMAP */;
}
}
@@ -1068,7 +1079,14 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, DWORD style, DWORD exStyl
return {};
RECT rect = {0,0,0,0};
style &= ~DWORD(WS_OVERLAPPED); // Not permitted, see docs.
......@@ -1181,7 +1241,7 @@ index 05eb41b6ab..cb9ed96d40 100644
qErrnoWarning("%s: AdjustWindowRectExForDpi failed", __FUNCTION__);
}
const QMargins result(qAbs(rect.left), qAbs(rect.top),
@@ -1559,7 +1577,14 @@ void QWindowsWindow::initialize()
@@ -1561,7 +1579,14 @@ void QWindowsWindow::initialize()
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(w, obtainedGeometry);
}
}
......@@ -1197,7 +1257,7 @@ index 05eb41b6ab..cb9ed96d40 100644
}
QSurfaceFormat QWindowsWindow::format() const
@@ -2051,7 +2076,12 @@ void QWindowsWindow::handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
@@ -2056,7 +2081,12 @@ void QWindowsWindow::handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
void QWindowsWindow::handleDpiChangedAfterParent(HWND hwnd)
{
......@@ -1211,6 +1271,67 @@ index 05eb41b6ab..cb9ed96d40 100644
const qreal scale = dpiRelativeScale(dpi);
setSavedDpi(dpi);
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index ae82f784ca..50d2e85871 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -62,6 +62,7 @@
QT_BEGIN_NAMESPACE
#if defined(Q_OS_WIN)
+#include <QtCore/private/qsystemlibrary_p.h>
QT_BEGIN_INCLUDE_NAMESPACE
#include "qt_windows.h"
@@ -266,29 +267,42 @@ int QWindowsStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, const
// hardcode DPI to 1x 96 DPI.
const int dpi = 96;
+ typedef int (*GetSystemMetricsForDpiFunc)(int, UINT);
+ static GetSystemMetricsForDpiFunc getSystemMetricsForDpi = []() {
+ QSystemLibrary user32dll(QLatin1String("user32"));
+ return (GetSystemMetricsForDpiFunc)(user32dll.resolve("GetSystemMetricsForDpi"));
+ }();
+
+ typedef BOOL (*SystemParametersInfoForDpiFunc)(UINT, UINT, PVOID, UINT, UINT);
+ static SystemParametersInfoForDpiFunc systemParametersInfoForDpi = []() {
+ QSystemLibrary user32dll(QLatin1String("user32"));
+ return (SystemParametersInfoForDpiFunc)(user32dll.resolve("SystemParametersInfoForDpi"));
+ }();
+
switch (pm) {
case QStyle::PM_DockWidgetFrameWidth:
- return GetSystemMetricsForDpi(SM_CXFRAME, dpi);
+ return getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CXFRAME, dpi) : GetSystemMetrics(SM_CXFRAME);
case QStyle::PM_TitleBarHeight: {
const int resizeBorderThickness =
- GetSystemMetricsForDpi(SM_CXSIZEFRAME, dpi) + GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi);
+ (getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CXSIZEFRAME, dpi) : GetSystemMetrics(SM_CXSIZEFRAME)) +
+ (getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi) : GetSystemMetrics(SM_CXPADDEDBORDER));
if (widget && (widget->windowType() == Qt::Tool))
- return GetSystemMetricsForDpi(SM_CYSMCAPTION, dpi) + resizeBorderThickness;
- return GetSystemMetricsForDpi(SM_CYCAPTION, dpi) + resizeBorderThickness;
+ return (getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CYSMCAPTION, dpi) : GetSystemMetrics(SM_CYSMCAPTION)) + resizeBorderThickness;
+ return (getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CYCAPTION, dpi) : GetSystemMetrics(SM_CYCAPTION)) + resizeBorderThickness;
}
case QStyle::PM_ScrollBarExtent:
{
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
- if (SystemParametersInfoForDpi(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0, dpi))
+ if (systemParametersInfoForDpi ? systemParametersInfoForDpi(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0, dpi) : SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))
return qMax(ncm.iScrollHeight, ncm.iScrollWidth);
}
break;
case QStyle::PM_MdiSubWindowFrameWidth:
- return GetSystemMetricsForDpi(SM_CYFRAME, dpi);
+ return getSystemMetricsForDpi ? getSystemMetricsForDpi(SM_CYFRAME, dpi) : GetSystemMetrics(SM_CYFRAME);
default:
break;
--
2.43.1
2.44.0
ea343bcf269779a4e078ed8baddfbe6c5ec4a34275c7d72b3f3928da60feece2ddc9ce4a380c6536a4e1654b483cee8918f8ad3038904725d2dd1c653ae83ece qtbase-everywhere-src-6.6.2.tar.xz
72896cc5a677361779f49d60dbdfc33a21d77bd479e0586b0beb03eee2016d613aee56e798143a489431a07a5e7a7db4c7c046105a11b63dd178768f3a7f195a qtbase-everywhere-src-6.7.0.tar.xz
# qtbase
QTBASE_VERSION_MAJOR := 6.6
QTBASE_VERSION := $(QTBASE_VERSION_MAJOR).2
QTBASE_VERSION_MAJOR := 6.7
QTBASE_VERSION := $(QTBASE_VERSION_MAJOR).0
# Insert potential -betaX suffix here:
QTBASE_VERSION_FULL := $(QTBASE_VERSION)
QTBASE_URL := $(QT)/$(QTBASE_VERSION_MAJOR)/$(QTBASE_VERSION_FULL)/submodules/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz
......@@ -22,7 +22,7 @@ ifdef HAVE_WIN32
DEPS_qt += d3d12 $(DEPS_d3d12) dcomp $(DEPS_dcomp)
endif
ifeq ($(call need_pkg,"Qt6Core >= 6.6 Qt6Gui >= 6.6 Qt6Widgets >= 6.6 Qt6Network >= 6.6"),)
ifeq ($(call need_pkg,"Qt6Core >= $(QTBASE_VERSION_MAJOR) Qt6Gui >= $(QTBASE_VERSION_MAJOR) Qt6Widgets >= $(QTBASE_VERSION_MAJOR)"),)
PKGS_FOUND += qt
endif
ifndef HAVE_CROSS_COMPILE
......@@ -41,18 +41,14 @@ $(TARBALLS)/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz:
qt: qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz .sum-qt
$(UNPACK)
$(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
$(APPLY) $(SRC)/qt/0001-Windows-Tray-Icon-Set-NOSOUND.patch
$(APPLY) $(SRC)/qt/0002-Try-to-generate-pkgconfig-pc-files-in-static-build.patch
$(APPLY) $(SRC)/qt/0003-Revert-QMutex-remove-qmutex_win.cpp.patch
$(APPLY) $(SRC)/qt/0004-Expose-QRhiImplementation-in-QRhi.patch
$(APPLY) $(SRC)/qt/0005-Do-not-include-D3D12MemAlloc.h-in-header-file.patch
$(APPLY) $(SRC)/qt/0006-Try-DCompositionCreateDevice3-first-if-available.patch
$(APPLY) $(SRC)/qt/0007-Try-to-satisfy-Windows-7-compatibility.patch
$(APPLY) $(SRC)/qt/0001-disable-precompiled-headers-when-forcing-WINVER-inte.patch
$(APPLY) $(SRC)/qt/0001-QTypeInfo-Add-a-missing-include.patch
$(APPLY) $(SRC)/qt/0002-QStringTokenizer-Add-a-missing-include.patch
$(APPLY) $(SRC)/qt/0003-CMake-Fix-a-misplaced-in-pkg-config-files.patch
$(MOVE)
ifeq ($(V),1)
......
12e4142ce8e9b0863ee5d39c37f9a04ef696fd34c98b5d955464a1cfcc7d55ea8387b6238a49d9e9380f8c95f4b655ffa64fe250f27fee3d4e9f48065bcabb6a qt5compat-everywhere-src-6.6.2.tar.xz
92115ca88b839171cf69360e0c3add64bb84305fdc28b9459da5eb69df79bfc2884616991ada898242e3614ac4f188dd76aa17889b5fb7fa72316a11efd61c85 qt5compat-everywhere-src-6.7.0.tar.xz
# Qt5Compat
QT5COMPAT_VERSION_MAJOR := 6.6
QT5COMPAT_VERSION := $(QT5COMPAT_VERSION_MAJOR).2
QT5COMPAT_VERSION_MAJOR := 6.7
QT5COMPAT_VERSION := $(QT5COMPAT_VERSION_MAJOR).0
QT5COMPAT_URL := $(QT)/$(QT5COMPAT_VERSION_MAJOR)/$(QT5COMPAT_VERSION)/submodules/qt5compat-everywhere-src-$(QT5COMPAT_VERSION).tar.xz
DEPS_qt5compat += qtdeclarative $(DEPS_qtdeclarative)
......@@ -10,7 +10,7 @@ ifdef HAVE_WIN32
PKGS += qt5compat
endif
ifeq ($(call need_pkg,"Qt6Core5Compat >= 6.6"),)
ifeq ($(call need_pkg,"Qt6Core5Compat >= $(QT5COMPAT_VERSION_MAJOR)"),)
PKGS_FOUND += qt5compat
endif
......
From e7d7242242169efd9d9ac1b736006aada1edfc60 Mon Sep 17 00:00:00 2001
From c68baab79783c2f103d779b9b9eb4de24781cd76 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Fri, 12 Jan 2024 20:40:24 +0200
Subject: [PATCH] Fix incorrect library inclusion
Subject: [PATCH 1/2] Fix incorrect library inclusion
---
src/qmlintegration/CMakeLists.txt | 2 +-
......@@ -20,5 +20,5 @@ index 0dd54f53bd..e77232df84 100644
Qt::Core
)
--
2.43.1
2.44.0
From 3257a47d55493e6ccedda50ab4093716366d95b3 Mon Sep 17 00:00:00 2001
From: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Date: Tue, 21 Nov 2023 23:58:43 +0900
Subject: [PATCH 2/2] Fix build with -no-feature-network
Change-Id: Ib21012301da6afb5458f707b39a9a8079d93eb93
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
---
src/qml/configure.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qml/configure.cmake b/src/qml/configure.cmake
index 2d0434643a..d1ff90bd54 100644
--- a/src/qml/configure.cmake
+++ b/src/qml/configure.cmake
@@ -82,7 +82,7 @@ qt_feature("qml-ssl" PUBLIC
SECTION "QML"
LABEL "QML SSL support"
PURPOSE "Provides ssl support in QML."
- CONDITION QT_FEATURE_ssl
+ CONDITION QT_FEATURE_qml_network AND QT_FEATURE_ssl
)
# On arm and arm64 we need a specialization of cacheFlush() for each OS to be
--
2.44.0
944e9f824dd8ec47d9e23e716d09142c5942f4478238f207d70f1144993440afa7925f85f3fd4cb5659191dee6a142524db40c7144c69c8bec9817591324cee1 qtdeclarative-everywhere-src-6.6.2.tar.xz
b189f3fc4ae9ad3e5c26aa56696b97cb2f1894cb23110928a31e5a62fb779578b492bec2f4dda5b31958a33eb2571ec4e1085ae6864442507be3ae0da83c96ee qtdeclarative-everywhere-src-6.7.0.tar.xz
# QtDeclarative
QTDECLARATIVE_VERSION_MAJOR := 6.6
QTDECLARATIVE_VERSION := $(QTDECLARATIVE_VERSION_MAJOR).2
QTDECLARATIVE_VERSION_MAJOR := 6.7
QTDECLARATIVE_VERSION := $(QTDECLARATIVE_VERSION_MAJOR).0
QTDECLARATIVE_URL := $(QT)/$(QTDECLARATIVE_VERSION_MAJOR)/$(QTDECLARATIVE_VERSION)/submodules/qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz
DEPS_qtdeclarative-tools := qt-tools $(DEPS_qt-tools) qtshadertools-tools $(DEPS_qtshadertools-tools)
......@@ -19,7 +19,7 @@ PKGS_TOOLS += qtdeclarative-tools
endif
PKGS_ALL += qtdeclarative-tools
ifeq ($(call need_pkg,"Qt6Qml >= 6.6 Qt6Quick >= 6.6 Qt6QuickControls2 >= 6.6 Qt6QuickDialogs2 >= 6.6 Qt6QuickLayouts >= 6.6"),)
ifeq ($(call need_pkg,"Qt6Qml >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6Quick >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QuickControls2 >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QuickLayouts >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QmlWorkerScript >= $(QTDECLARATIVE_VERSION_MAJOR)"),)
PKGS_FOUND += qtdeclarative
endif
ifndef HAVE_CROSS_COMPILE
......@@ -39,6 +39,7 @@ $(TARBALLS)/qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz:
qtdeclarative: qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz .sum-qtdeclarative
$(UNPACK)
$(APPLY) $(SRC)/qtdeclarative/0001-Fix-incorrect-library-inclusion.patch
$(APPLY) $(SRC)/qtdeclarative/0002-Fix-build-with-no-feature-network.patch
# disable unused CLI tools: qml, qmleasing, qmldom, qmlformat, qmltc
sed -i.orig -e 's,add_subdirectory(qml),#add_subdirectory(qml),' $(UNPACK_DIR)/tools/CMakeLists.txt
sed -i.orig -e 's,add_subdirectory(qmleasing),#add_subdirectory(qmleasing),' $(UNPACK_DIR)/tools/CMakeLists.txt
......@@ -47,6 +48,8 @@ qtdeclarative: qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz .sum
sed -i.orig -e 's,add_subdirectory(qmltc),#add_subdirectory(qmltc),' $(UNPACK_DIR)/tools/CMakeLists.txt
# disable QT labs feature we don't use
sed -i.orig -e 's,add_subdirectory(labs),#add_subdirectory(labs),' $(UNPACK_DIR)/src/CMakeLists.txt
# disable unused svgtoqml tool:
sed -i.orig -e 's,add_subdirectory(svgtoqml),#add_subdirectory(svgtoqml),' $(UNPACK_DIR)/tools/CMakeLists.txt
$(MOVE)
QT_DECLARATIVE_COMMON_CONFIG := \
......
From 0813ef63bb445437d364d16aeca42f7425608a0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Thu, 4 Apr 2024 14:26:47 +0300
Subject: [PATCH] Backport a change to SPIRV-Cross to add a missing include
This backports this change from later upstream SPIRV-Cross:
https://github.com/KhronosGroup/SPIRV-Cross/commit/a25d0acaad9406e5e5d5a712ebb7e798965aacf6
Further upstream in qtshadertools, this issue goes away entirely
by updating to a newer version of SPIRV-Cross, with this fix
included.
This fixes building with libc++ with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES set.
---
src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp b/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp
index 506b069..9fc2a80 100644
--- a/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp
+++ b/src/3rdparty/SPIRV-Cross/spirv_cross_containers.hpp
@@ -26,6 +26,7 @@
#include "spirv_cross_error_handling.hpp"
#include <algorithm>
+#include <exception>
#include <functional>
#include <iterator>
#include <limits>
--
2.25.1