summaryrefslogtreecommitdiffstats
path: root/src/corelib/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Extract Header qbindingstorage.hMarc Mutz2021-11-041-0/+1
| | | | | | | | | | | | | | | QBindingStorage doesn't depend in-size on much else in qproperty.h, but is used in-size in qobject.h, thus requiring qobject.h to include qproperty.h. As a first step, move the class and the bits it actually depends on, to a separate header file, qbindingstorage.h, and, for now, just include that from qproperty.h. The end goal here is to make qobject.h independent of qproperty.h. Pick-to: 6.2 Change-Id: I44245a5e57473067e3106d1fd70bf2d744ce0a5f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add internal property to store Qt namespaceAlexey Edelev2021-10-261-0/+2
| | | | | | | | | | In some cases it might be useful to use the value of Qt namespace in CMake files. Currently the value is only stored inside Core target compile definitions. This adds the internal property _qt_namespace to the Core target and exports it. Change-Id: Ic0454f0ce6b8c65b5a186981463d3977169b022e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove unused qapplicationpermission.hJoerg Bornemann2021-10-221-1/+0
| | | | | | | | | The app permission API was removed, and this file is a left-over. This amends commit 72e5b36e2e4c79dc7995f0203968503266b4f2f5. Pick-to: 6.2 Change-Id: Ie1bf9465260594864464c4d4ee4dc99593c28cc1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the ABI tag from minimum-linux.S to qlibraryinfo.cppThiago Macieira2021-10-211-17/+0
| | | | | | | | | | | | | | | We don't need the assembly file any more. According to a comment to patchsets 2 in the Gerrit code review for commit bb8a61866ec6a6de2426012f8c4219d41b3a414a, the section ended up as SHT_PROGBITS instead of SHT_NOTE. I didn't know then that the section type is not actually important, only whether it's present in the segment pointed by a PT_NOTE is. That isn't recorded in the review. Since we now depend on the linker properly placing the .note.* sections for Qt plugins, we can rely on this working. Change-Id: Icb2516126f674e7b8bb3fffd16ad659149e34a23 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Make LTO build workThiago Macieira2021-10-131-1/+1
| | | | | | | | We don't need to check FEATURE_ltcg, just add -fno-lto unconditionally. That makes QtCore compile with -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON. Change-Id: Icb2516126f674e7b8bb3fffd16ada2c71d7334aa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qfloat16: re-merge the F16C content into qfloat16.cppThiago Macieira2021-10-131-32/+0
| | | | | | | | | The bugs we had noticed previously are believed to be fixed. MSVC will do per-function updating of AVX content where necessary and the ICC issue is no longer relevant. Change-Id: I2bbf422288924c198645fffd16a9235f2d73cc19 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-7/+1
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Guard WinRT API code for clang-clPeter Varga2021-10-121-1/+2
| | | | | | | | | | | | | | It is unsupported with clang-cl and breaks the build. This is a fixup for: 51e8d3592a Let QLocale::uiLanguages() use WinRT API when possible Task-number: QTBUG-94341 Pick-to: 6.2 Change-Id: Icf32339e81d67d4c119b7fb8d8d834c744b9ead0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ic78afb67143112468c6f84677ac88f27a74b53aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Let QLocale::uiLanguages() use WinRT API when possibleIvan Solovev2021-10-011-1/+6
| | | | | | | | | | | | | | | | | | This patch introduces support for the WinRT UI languages API. We are using the Win32 API to get the list of preferred languages when the system locale is used. However, this API returns an incomplete list. As Qt 6 supports Windows 10 and above, we can make use of the WinRT API, if it's supported by the compiler. This API returns the full list, as reported by the Windows system itself. Note however, that this API can't be used with Clang and MinGW, so we still have to fall back to Win32 API for these compilers. We also do it if WinRT API returns an empty list of languages for some reason. Fixes: QTBUG-94341 Pick-to: 6.2 Change-Id: I1d23c68d2ec298ae7835d0d18718876ff041aede Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-8/+8
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Copy and install lldb QtCore.py script for lldb and Xcode useAlexandru Croitor2021-09-071-2/+26
| | | | | | | | | | | | The file was not handled during the qmake -> CMake transition. qmake had a more generic mechanism to allow embedding dSYM scripts per Qt module, but it wasn't used as far as I know, so the CMake implementation only limits it to QtCore. Pick-to: 6.2 Change-Id: Ibcd818df1897f603ac194092b28d4bd4d1d6c6ae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: add new event dispatcher implementationMorten Johan Sørvig2021-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QEventDispatcherWasm to QtCore. The event dispatcher supports managing event queue wakeups and timers, both for the main thread or for secondary threads. Blocking in processEvents() (using QEventLoop::WaitForMoreEvents) is supported when running on a secondary thread, or on the main thread when Qt is built with Emscripten’s asyncify support. Code is shared for all both modes as far as possible, with breakout functions which handle main and secondary thread as well as asyncify specifics,. Some functions like wakeUp() can be called from any thread, and needs to take the calling thread into consideration as well. The current asyncify implementation in Emscripten is restricted to one level of suspend, and this restriction carries over to Qt as well. In practice this means we support one level of exec()-like API. Note that this commit does not _enable_ use of the new event dispatcher. This will be done in separate commits. Task-number: QTBUG-76007 Task-number: QTBUG-64020 Change-Id: I77dc9ba34bcff59ef05dd23a46dbf1873cbe6780 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Don't install metatypes files for user projectsAlexandru Croitor2021-08-191-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Installing extracted metatypes json files for user projects was an oversight. We shouldn't install anything on behalf of user projects, but rather give them enough information so they can do it the themselves. Make all the install options of qt6_extract_metatypes internal, change the behavior not to install the files by default, unless __QT_INTERNAL_INSTALL is passed, which is used for the Qt build only. __QT_INTERNAL_NO_INSTALL is now a no-op and should be removed from projects. This is behavior change for existing public API, but it's better to fix this now before 6.2.0 release. Introduce a new OUTPUT_FILES option to allow assigning the extracted metatype file paths into a variable that the project provides. The project can then install the files where they need them. [ChangeLog][CMake] qt6_extract_metatypes does not install metatypes files anymore. Instead the OUTPUT_FILES option can be provided to get the list of extracted files for further processing. Pick-to: 6.2 Task-number: QTBUG-95845 Change-Id: If5dd0255a5fea2b598e15118c29ec2ab2ba4324e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Short live namespace q20!Marc Mutz2021-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | As proposed already for Qt 5 (then with q14 and q17), add reimplementations of C++20 library features into a q20 namespace. The advantage is that we can later just s/q20::/std::/ and be sure that a) the q20 functionality works (within reason) like the std counterparts and b) we don't have to re-indent the code after the replacement. Start with std::identity in q20functional.h, required by std::ranges::{any,all,none}_of() (ex ranges[1]) in q20algorithm.h, which I happen to require in QLibrary next. [1] We can't provide the nice range-based overloads (any_of(vector, pred)), yet, because that would require to reimplement all the range-related concepts, as the overloads are ambiguous if unconstrained. First, we should check whether we can't just depend on Nieber's ranges-v3 library instead. The q20 namespace is independent of this decision, as it's more universally useful (q20::remove_cvref comes to mind). Unlike in q14/q17 times, a single header, q20.h, would become unwieldy very soon, so use separate headers. Change-Id: I14b98c865e242d2dc9674bc1bff5f7a9e4db9940 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests: fix some -WvolatileMarc Mutz2021-07-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 deprecated compound volatile statements such as pre- and post-increments, to stress that they're not atomic. So instead of volatile i; ~~~~; ++i; you're now supposed to write volatile i; ~~~~; int j = i; // volatile load ++j; i = j; // volatile store which matches more closely what hardware does. Instead of fixing every use of volatile pre- or post-increment in this fashion individually, and realising that probably a few more Qt modules will have the same kind of code patterns in them, write QtPrivate functions to do the job centrally. Change-Id: I838097bd484ef2118c071726963f103c080d2ba5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtCore: clean up API removalsMarc Mutz2021-07-281-2/+2
| | | | | | | | | Use the same new pattern as in QtWidgets. Amends de18b3ff370543b5b99bd068b871a2cd677cf9f3. Change-Id: Ia1cbd40aa7a7efc9a954d22b599e13a19a6a9266 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move Android implementation of permissions API to QtAndroidPrivateTor Arne Vestbø2021-07-261-1/+0
| | | | | | | | | | | | And remove plumbing from public QCoreApplication API, which is going to be removed in follow up patch after leaf modules have moved to the private Android API. The public permissions API will be reintroduced in 6.3 after further work. Pick-to: 6.2 Change-Id: I46772284b98d0ced8d4a624a850adaa4a1dfe645 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Clean up and simplify qt6_extract_metatypes implementationAlexandru Croitor2021-07-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove copying of json files in non-prefix builds. Previously, this was done to mimic the directory layout of prefix builds in a non-prefix build, but the extra complexity is not worth it. Keeping the files in the build directories of each repo in a non-prefix build should be good enough. As a result, we don't need to distinguish which file path should be passed in INTERFACE_SOURCES. Now we have only 2 paths to consider, the BUILD_INTERFACE one and the INSTALL_PREFIX one, rather than 3 different paths. Move the code that handles installation closer together. Rename the internal COPY_OVER_INSTALL option to ___QT_INTERNAL_NO_INSTALL. We might want to expose it as a public option later, but it depends on whether we will disable default installation for user projects. Remove assignment of some properties that are not used anymore. Amends c431e2d33c2b13dee8b43a08c267c20ec1ae9654 Pick-to: 6.2 Task-number: QTBUG-94942 Change-Id: I3a26d1988987b2ce7c7d01d2311c13b3da3175a8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Rename QPermission namespace to QApplicationPermissionAssam Boudjelthia2021-07-151-1/+1
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-94407 Change-Id: Ie9c05dbe498cd372c015b5125e6cb8d59ca96b59 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QCryptographicHash: port addData() to QByteArrayViewMarc Mutz2021-07-061-1/+9
| | | | | | | | | | | | | Incl. the static hash() function. Remove the QByteArray versions from the API, but not the ABI. Adapt some callers. [ChangeLog][QtCore][QCryptographicHash] Replaced QByteArray with QByteArrayView in addData() and static hash() functions. Change-Id: Ia0e9bf726276305e05894d323d76a29e985f39eb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Re-apply "Remove old Android code that have now has alternative public APIs"Assam Boudjelthia2021-07-011-1/+0
| | | | | | | | | | | | | This reverts commit 046d819e2e25d2752b3898dd775eeb560e24b4ce. Since qtandroidextras is now removed from qt5, there should no longer be a dependency issue in CI. Pick-to: 6.2 Change-Id: I3b8ed409eeb0ad6c7bb3303ec08e672739c5b2ed Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Enable QT_TYPESAFE_FLAGS for bootstrap and QtCoreGiuseppe D'Angelo2021-06-231-0/+1
| | | | | | Change-Id: I5c64a29ffecece9e527f5db78cceb912836153d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live QT_TYPESAFE_FLAGS!Giuseppe D'Angelo2021-06-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an opt-in mechanism to kill type-unsafe functions and implicit conversions of QFlags, therefore removing an entire category of bugs that QFlags itself is supposed to protect against: QFlags<E> f; f == 3.14; // OK; f->int, int->double, then operator==(double,double) f & UnrelatedEnum; // OK if of unscoped enum, calls operator&(int) f &= 123; // calls QFlags::operator&=(int) int i = f * 42; // f->int, then operator*(int, int) Thankfully, operator+ and operator- had already been deleted. By defining QT_TYPESAFE_FLAGS one: * disables operators taking (u)int, forcing the usage of an enumeration or another QFlags object; * turns the implicit conversions towards integers/bool in explicit (one can always use fromInt/toInt instead); * adds a convenience set of (in)equality operators against literal 0, in order to keep code like `(flag & bit) == 0` compile. This set can't be added normally otherwise it would add ambiguity; * adds the unary operator~(Enum), turning it into a flag. This is a source incompatible change, in general, so it's opt-in. This is a Qt-internal macro at this point. It can't be offered to users yet because we need to fix some public API flaws first: in some places (e.g. QPainter::drawText) we ask users to do type-unsafe manipulation of flags. A user enabling the macro wouldn't be able to properly use the functions in question. This macro will be enabled in a follow-up commit. Change-Id: I796f2256b446bafc12cdcbaf7de417d12bd3619e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix SSE4.1, RDSEED requirement for clang-cl buildsAllan Sandfeld Jensen2021-06-171-20/+0
| | | | | | | | | | | | | | A misunderstanding seems to have caused several files to be compiled with extra runtime arch options. We need to disable multi-target functions though, because it doesn't work with clang-cl headers. Task-number: QTBUG-88081 Task-number: QTBUG-88434 Pick-to: 6.2 Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "Remove old Android code that have now has alternative public APIs"Jani Heikkinen2021-06-161-0/+1
| | | | | | | | | | | | | This reverts commit 03eb44394e4cdf3d2a9aa7be632b487313519fbb. Reason for revert: This breaks the dependecy update round in dev now. The revert can be reverted again after 1) Full dependency round is succeed in 'dev' 2) Android extras submodule has been removed from qt5.git#dev (7aa41d22fa485f212aebbef500ea91921c7bc38b) 3)qtmultimedia has been ported to use new api instead of this old one 4) Full dependency round with all above is succeed in 'dev' Change-Id: I23241d2a90307074ecfc9573d2b58baba1874cfc Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Adjust the EntryPoint target name according to the internal module naming policyAlexey Edelev2021-06-151-5/+7
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-87775 Change-Id: I1d6097c950f97e102c44e2952edc98caa4deb6c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove old Android code that have now has alternative public APIsAssam Boudjelthia2021-06-111-1/+0
| | | | | | | | | | * Remove the old qjni private APIs. * Remove the Android permission private APIs. * Remove runOnAndroidThread(). Pick-to: 6.2 Change-Id: I37ba8b4cb87a099f067e2e0b6744b8d01a0f9bbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build without features.itemmodelTasuku Suzuki2021-06-111-2/+6
| | | | | Change-Id: Ic768f12861db5366ff3fa25b28f9252358ce3a72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Add support for building with clang-clCristian Adam2021-06-041-0/+20
| | | | | | | | | qmake had support for building with clang-cl as the win32-clang-msvc mkspec. Task-number: QTBUG-89642 Task-number: QTBUG-88081 Change-Id: I0709c289f90fedb121620d1e67ef841602219816 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move QIdentityProxyModelPrivate out into its own headerMitch Curtis2021-06-011-1/+1
| | | | | | | | | qtquickcontrols2 needs to use it. Change-Id: Ic5e3105095a8fcd36a38a3ce4353db4057ada0de Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* Make the internal Zlib module privateAlexey Edelev2021-05-211-1/+1
| | | | | | | | Rename Zlib module to adjust its name to the internal module naming policy. Change-Id: Ieb04842bd362a36fbf4247e3559b9907d29c28b8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: remove unnecessary add_dependencies()Li Xinwei2021-05-171-4/+0
| | | | | | | | | | | | | The dependencies to moc, uic and rcc have already been handled by qt_manual_moc(), qt_enable_autogen_tool() and _qt_internal_process_resource(). This allows not building some of the debug executables in a multi-config scenario. Task-number: QTBUG-88414 Change-Id: I6c162721f3ddf6b4b410345ad012073abbdfd9df Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move QNativeInterface helpers to their own header fileTor Arne Vestbø2021-05-101-0/+1
| | | | | | | | | The machinery is not needed for all translation units, so keep it out of qglobal.h. Change-Id: Ib0459a3f7bc036f56b0810eb750d4641f567f1fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move Android Extras as private APIs under qtbaseAssam Boudjelthia2021-05-101-0/+1
| | | | | | | | To the option to users to use some needed APIs until we make them ready as proper cross-platform public APIs. Change-Id: I53006397463331ebae8314bf8a3a019474aec617 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Move JNI_OnLoad implementation to qjnihelpersAssam Boudjelthia2021-05-061-1/+0
| | | | | | | | To keep the Android implementation details as concise and close as possible. Change-Id: I8452e29ec4fc4b0a0c5e1861e159e7aea88c17b5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add new app permissions API under QCoreApplicationAssam Boudjelthia2021-05-051-0/+2
| | | | | | | | | | | | | | | | | | | | | The API allows users to request and check the status of various permissions. A predefined enum class of the common permission types on different platforms is used to allow requesting permission with a common code. Platform specific permissions are defined only on their relevant platform. For permissions that are not predefined, they can be requested via a string variant of this API. This adds the Android implementation only. [ChangeLog][QtCore] Add new API for handling app permissions with an initial implementation for Android. Task-number: QTBUG-90498 Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Introduce zlib find script to work around hardcoded iOS SDKAlexandru Croitor2021-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode allows building a project targeting either the device or simulator sysroot in one single build dir, but for the sysroot switching to work there should be no linker or compiler flags referencing absolute paths of a specific sysroot. During CMake configuration of a project targeting iOS, all found system libraries will be within one single sysroot, either the device one or the simulator one, whichever one was passed to CMAKE_OSX_SYSROOT. CMake will then generate the Xcode project and pass those absolute paths, which makes sysroot switching within Xcode not work. To avoid that, the CMake documentation recommends passing linker and framework flags of the form '-lfoo' and '-framework bar' instead of absolute paths. Xcode then takes care of setting the correct framework search path. Zlib is one of the libraries found in the iOS sysroot and thus passed as absolute path. To avoid that, create a new FindWrapZLIB find script. The target it creates will pass the absolute path to the library on non Apple platforms and an -lz linker flag on Apple platforms (macOS and iOS). To avoid issues with target global promotion when system PNG package is found, ensure that a found ZLIB::ZLIB target is promoted to global manually in src/gui/configure.cmake. Pick-to: 6.1 Change-Id: I8bd8649be4f680a331ad51925f27cb9d13ac5e5f Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Check whether CMake was built with zstd supportJoerg Bornemann2021-04-161-0/+5
| | | | | | | | | | | | | | | | CMake 3.18 introduced the file(ARCHIVE_CREATE) API that we use with COMPRESSION Zstd for compressing corelib's mimedatabase. It's possible to build CMake without proper zstd support, and we have encountered such builds in the wild where the file(ARCHIVE_CREATE) call crashes. Add a configure test to determine whether CMake properly supports the Zstd compression method. Fixes: QTBUG-89108 Change-Id: I37e389c878845162b6f18457984d4f73a265b604 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Switch metatypes generation on by default for Qt modulesUlf Hermann2021-04-161-0/+1
| | | | | | | | | | We need the metatypes for anything directly or indirectly exposed to QML. Switching this on has no runtime overhead. For interface libraries we cannot generate any metatypes, though. Change-Id: I7b7f85bb4e16c28d00383c5c88b0f1c172c8d193 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix generating mimedatabase with generate.pl using makeNiclas Rosenvik2021-04-091-1/+3
| | | | | | | | | | | | When building using make and having set QT_AVOID_CMAKE_ARCHIVING_API to ON the build breaks with the message "sh: cannot create .rcc/qmimeprovider_database.cpp: directory nonexistent" . ninja creates this directory automatically, make does not. Add a file MAKE_DIRECTORY cmake command to make sure the .rcc directory is created. Change-Id: I140279a794753436d427d647ab2231636827d07f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix environ build break on FreeBSDNiclas Rosenvik2021-04-081-2/+7
| | | | | | | | | | | QMAKE_LFLAGS_NOUNDEF = <EMPTY> for FreeBSD did not get converted to CMakeLists.txt. This breaks the build on FreeBSD since environ is missing from libc, it is available at runtime. Turn -Wl,-no-undefined into warnings on FreeBSD to fix the build. Also add a comment based on the one from corelib.pro . Change-Id: I3835884a2682af0f68a4d65dede3e4e5d4104ac8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* wasm: add cmake build supportLorn Potter2021-04-011-0/+4
| | | | | | | | | | | | | | | | A few configure defines get changed: QMAKE_WASM_PTHREAD_POOL_SIZE is now QT_WASM_PTHREAD_POOL_SIZE QMAKE_WASM_TOTAL_MEMORY is now QT_WASM_INITIAL_MEMORY QMAKE_WASM_SOURCE_MAP_BASE is now QT_WASM_SOURCE_MAP_BASE device-option EMSCRIPTEN_ASYNCIFY=1 is QT_EMSCRIPTEN_ASYNCIFY=1 To create source maps for debugging. use device-option QT_WASM_SOURCE_MAP=1 Task-number: QTBUG-78647 Change-Id: If9f30cd7fb408c386d6d69b5f7b1beecf1ab44b5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the redundant code related to the QT_NAMESPACE variableAlexey Edelev2021-03-301-2/+1
| | | | | Change-Id: Ib82b199fc7761c8b84f915c2808c7f57bf23927c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMetaType::id(): Fix ABI breakageFabian Kosmale2021-03-261-0/+2
| | | | | | | | | | | | | We cannot replace a non-inline method with an inline one without breaking the ABI. Instead, we now create a version with a dummy int parameter (to avoid ODR violations), and hide the non-inline version behind an ifdef, so that it is only visible in qmetatype.cpp. Pick-to: 6.1 Change-Id: Ib4e82e44071bdf5c37227409a56d377ff2e07ee0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Get rid of the Core_qobject static libraryAlexandru Croitor2021-03-251-48/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Core_qobject target was problematic for a few reasons. In the very beginning, Core_qobject was an OBJECT library, explaining its existence with the following comment "requires to spill internals into users". The object library contained qobject.cpp and qproperty.cpp and their manually generated moc files. It was was a dependency of Core. Afterwards it got converted into a static library instead, presumably to circumvent some issues with metatype generation. Unfortunately making it a static library was wrong, because it leads to linker failures (undefined symbols) in a static Qt build when trying to link a project that uses only QtCore. Both Core and Core_qobject refer to each other's symbols, and whichever library came first on the link line, many of its symbols were discarded by the linker. Transforming Core_qobject back into an object library could be an option, but that leads to trouble with creating proper prl files (our infrastructure doesn't quite support that for object libraries yet). Furthermore, there was some internal discussion and concern about how to merge the two metatype json file lists (Core and Core_qobject) into a single file. Instead of using an object library, move qobject.cpp and qproperty.cpp to be directly a part of Core again and remove the Core_qobject target. In order to do that, we have to circumvent some issues with AUTOMOC. First, we have to disable AUTOMOC for qobject.cpp and its headers. qobject.cpp contains Q_GADGET, Q_NAMESPACE, etc keywords in its doc comments. That confuses AUTOMOC, because it expects a qobject.moc file which is not included by qobject.cpp. See e2ff9e3b9957f844d6530cc92096bed3c16fa46a for some details on the Q_GADGET + AUTOMOC issue. We still need to run moc on on qobject.h and compile moc_qobject.cpp, so we manually run moc on the header file. Because qobject.cpp directly includes moc_qobject.cpp, we need to adjust the header include path to the generated file. Second, we remove the direct inclusion of moc_qnamespace.cpp in qobject.cpp to prevent duplicate symbol compilation, because the symbols were compiled both as part of qobject.cpp and mocs_compilation.cpp. Finally, because manual moc is used on qobject.h, the generated json file needs to be explicitly passed to Core's metatype generation step. Amends e57a94cbd8f28ccab8b3368afc4365237c533a4f Amends 3c4c02b3f1cec8ebc0134fd05b0e51f1f771937d Pick-to: 6.1 Task-number: QTBUG-87580 Change-Id: I859a7d2f95508eda211a0a0b4ec132540b78bda4 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix backtrace on non-linux systemsNiclas Rosenvik2021-03-221-0/+5
| | | | | | | | | | | | On BSD systems backtrace lies in libexecinfo. Use FindBacktrace from CMake to be able to resolve backtrace on more unixes than linux. Change-Id: Ie14fd1727d2da03645fc2d6de10c0217baabad6b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Get rid of the Core_versiontagging object libraryAlexandru Croitor2021-03-191-17/+4
| | | | | | | | | | | | | | | | | We don't currently handle object libraries when creating prl files for static Qt builds, so it's best to compile files as part of the main Core target. Use source file COMPILE_OPTIONS to add the -fno-lto flag to the global/qversiontagging.cpp source file. Amends 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967 Pick-to: 6.1 6.0 Change-Id: Iac1d37ecb4caa7c9889d44b3a103a9bdafec49f3 Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Unify QLibraryInfo settingsAlexey Edelev2021-03-171-1/+1
| | | | | | | | | | | Exporting QLibraryInfo internals allows to reuse settings in qmake/qtpath without having to keep its own instance. Also there is no need to check setting groups in QLibraryInfo except the 'Paths' group, since this logic belongs to qmake/qtpaths only. Change-Id: If762defba025ad7f7489f8a86ef5768a8628bd2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use Core library for qmake instead of the Bootstrap libraryAlexey Edelev2021-02-251-1/+1
| | | | | | | | | | | | | | | | | | | Move the qmake-specific logic of the QLibraryInfo class to qmake internals. 'qconfig.cpp.in' now stores information about the library info entries to keep them consistent between qmake and the Core library. qmake requires specific features enabled in the Core library, so building qmake will be skipped if the features are not enabled. All flags directly related to the qmake have been removed from Core lib. Remove all bootstrap related sections from qmake CMakeLists.txt Task-number: QTBUG-89369 Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>