Commit Graph

1364 Commits

Author SHA1 Message Date
Alexey Edelev
dec84a56f5 Throw FATAL_ERROR if specified platform doesn't exist
If user specifies non-existing platform build fails in some non-obvious
place, since qplatfromdefs.h couldn't be found.

Add an explicit error if the defined platform folder doesn't exists in
Qt sources.

Change-Id: Id847d57a6f9cc4f463e697b474b8a669cd041fb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-25 13:32:26 +02:00
Alexandru Croitor
e2c6f2ba7e CMake: Fix 'Cannot find source file' error with older CMakes
Configuring a static qtdeclarative with CMake versions older than
3.18.0 fails at generation phase with

CMake Error at cmake/QtExecutableHelpers.cmake:28 (add_executable):
  Cannot find source file:

   some_path/some_target_plugin_imports_Gui.cpp

Marking the generated file as GENERATED explicitly solves the issue.

Pick-to: 6.1 6.2
Change-Id: Ife0eba61a1aab4f988d9fe7e2217d30eb96774a7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-25 12:33:58 +02:00
Alexandru Croitor
1981682687 CMake: Propagate sanitizer flags to public projects
Ensure that Qt user projects build with sanitizer flags if Qt was
configured with any of the sanitizers enabled.

To compile Qt with sanitizer support enable any of Qt sanitizer
features.

Passing -DECM_ENABLE_SANITIZERS=address to CMake is NOT supported
anymore.

When configuring Qt using CMake directly, pass
    -DFEATURE_sanitizer_address=ON
    -DFEATURE_sanitizer_undefined=ON
instead of
    -DECM_ENABLE_SANITIZERS=address;undefined

When configuring Qt with the configure script pass
    -sanitize address -sanitize undefined
as usual.

QtConfig.cmake now records the sanitizer options that should be
enabled for all consuming projects based on the enabled Qt features.
This applies to internal Qt builds as well as well as tests an
examples.

The recorded sanitizer options are assigned to the ECM_ENABLE_SANITIZERS
variable in the directory scope where find_package(Qt6) is called.
The ECMEnableSanitizers module is included to add the necessary flags to
all targets in that directory scope or its children.

This behavior can be opted out by setting the
QT_NO_ADD_SANITIZER_OPTIONS variable in projects that use Qt and might
be handling sanitizer options differently.

Amends 7e03bc39b8

Pick-to: 6.2
Fixes: QTBUG-87989
Task-number: QTBUG-92083
Change-Id: I2e3371147277bdf8f55a39abaa34478dea4853a6
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-25 12:33:58 +02:00
Alexandru Croitor
9a9da3aad2 CMake: Handle fuzzer-no-link sanitizer feature name correctly
Pick-to: 6.2
Task-number: QTBUG-87989
Change-Id: Ife42f1fe001c5fafd10981f23dcd387cacc15276
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-25 12:33:58 +02:00
Alexandru Croitor
8c1a35a991 CMake: Restore Qt-custom sanitizer additions to ECMEnableSanitizers
Restores addition of 'float-divide-by-zero' to undefined sanitizer
flags as well as the custom fuzzer-no-link option.

Pick-to: 6.2
Task-number: QTBUG-87989
Change-Id: Icde1e5d31083ce1b6128ab45b0e9df5ae69736a3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-25 12:33:58 +02:00
Alexandru Croitor
6b3e512e02 CMake: Update ECM sanitizer module to latest version
To bring support for sanitizers when using MSVC.

Pick-to: 6.2
Task-number: QTBUG-87989
Change-Id: I7a8ebf8fdaa31669df82d232fd9eae4e72407b92
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-25 12:33:58 +02:00
Alexey Edelev
9bd418aeab Implement generating of a module cpp export header
Add an option that automatically generates an export header for a Qt
module. The header contains only Q_DECL_EXPORT/Q_DECL_IMPORT related
content, so it's not a full replacement of 'global' header files.

Task-number: QTBUG-90492
Change-Id: I250d1201b11d4096b7e78e61cbf4565945fe6517
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-24 20:40:49 +02:00
Alexey Edelev
1cb63fcc97 Disable forced full optimization if QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS=ON
Pick-to: 6.2
Task-number: QTBUG-94753
Change-Id: Ib9dda1a96f3123394e3b3d4f84feac8cedd18b89
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-24 18:10:32 +02:00
Joerg Bornemann
d6e01ae05c Fix QT_HOST_DATA for builds setting INSTALL_MKSPECSDIR
In a Qt build that was configured with INSTALL_MKSPECSDIR set to
something different than INSTALL_DATADIR, the qmake property
QT_HOST_DATA was wrong. Consequently, mkspecs could not be loaded,
rendering qmake dysfunctional.

The reason was that we considered every QT_HOST_xxx property to have the
same value as QT_INSTALL_xxx in a non-cross build.
This is not true for QT_HOST_DATA, because users might want to set
INSTALL_DATADIR to "foo" but INSTALL_MKSPECSDIR to "bar/mkspecs".

Move the unused determination of the host data dir to the QtLibraryInfo
lib and handle QT_HOST_DATA specially.

Fixes: QTBUG-94591
Pick-to: 6.2
Change-Id: I2c44cda8405ff1d14391254fcd1d9b1361cb5855
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-23 22:12:41 +02:00
Kai Köhne
d0676874d6 MSVC: Enable warnings-are-errors for latest Visual Studio 2019
Also remove handling of older versions, because we only support
Visual Studio 2019 currently

Pick-to: 6.2
Change-Id: If66a46d970047fe25582e323df74e0a904ee92da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-06-23 12:49:19 +02:00
Morten Sørvig
53eb44906c wasm: don’t set exit_runtime
Go with Emscripten’s default of not shutting down on
main() exit; this allows for writing main() in such
a way that avoids the exec() workaround.

Existing main() implementations (which do use the exec()
workaround) do not shut down Qt cleanly anyway, so we
gain little by shutting down the Emscripten runtime.

Applications can set this flag if they do want to shut
down on main() exit:
    LFAGS += -s EXIT_RUNTIME=1

Change-Id: I52e1cc2bc907d1d2146822713e39b7610db3f95b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-06-23 06:57:21 +00:00
Giuseppe D'Angelo
648e9696d3 Disable -Werror=stringop-overflow on GCC >= 10
There's a number of upstream bugs that cause false positives;
do not make them errors.

Change-Id: I4151794d8d37177a47a34aef8d83accf4377d44a
Pick-to: 6.1 6.2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-06-23 00:23:55 +02:00
Morten Sørvig
7ee4468a18 wasm: enable MODULARIZE option and set EXPORT_NAME
Make Emscripten generate a global constructor function
("createQtAppInstance()") instead of a global javascript
module object.

This enables more fine-grained control over module
instantiation; previously the module object would be
created when the runtime javascript was evaluated, and
the number of emscripten module/instances was limited
to one per page.

Set EXPORT_NAME to “createQtAppInstance” which avoids
collisions with other non-Qt Emscripten modules on
the same page. A further improvement would be to include
the app name in EXPORT_NAME, but this is not done at
this time.

Update the code in qtloader.js to call the constructor
function instead of working on a global module object.
The qtloader.js API is functional before the wasm and
Emscripten modules have been instantiated; store properties
and forward to the Emscripten module when it's created.

Change-Id: I12c49a5b9a4a932bbc46fcc5e5ecc453fd0fe7f0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-06-22 11:11:20 +00:00
Lorn Potter
ae717aa51f wasm: fix build for emscripten 2.0.14
new syntax rules for EXTRA_EXPORTED_RUNTIME_METHODS valid after 2.0.16

Pick-to: 6.2
Change-Id: Iff33e4c6f3176619fb35ec0994a7cc87b5d937c7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-21 23:43:02 +00:00
Alexey Edelev
991b64a7e5 Cleanup temporary code related to internal modules
Remove the temprotary 'Private' targets of the iternal modules.

Pick-to: 6.2
Task-number: QTBUG-87775
Change-Id: I9a2c7c8c2f63602476fd935b11dab7a835864537
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-21 21:25:00 +02:00
Alexandru Croitor
f567f429bd CMake: Update section on required CMake versions
Change-Id: I6c556cd3a2e8bdf87b3c7c6ef62a6af6bdbe7137
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-21 12:48:12 +02:00
Alexey Edelev
ff4244b540 Move dependency lookup functionality to the common macro
Dependency lookup mechanism is the same for modules and plugins. It
makes sense to wrap it using macro.

Pick-to: 6.2
Change-Id: I73727743b0f5f40b2d94624f65ebfcf85e8dcc59
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-19 14:04:37 +02:00
Alexey Edelev
cdbb390c4a Disable finalizers by default for the non-ld linkers
Check if link order matters before use the object library finalizer.

Amends 5fb99e3860

Pick-to: 6.2
Change-Id: Ie996bc175ebea36ccda1bb2fe388ae3b7fcde395
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-19 11:06:04 +02:00
Alexey Edelev
ed92cb30e4 Fix the naming of the config header files for private modules
Perform a file name of the config header before adding a '_private'
suffix.

TODO: It makes sense to revisit the use of the CONFIG_MODULE_NAME
variable since the variable is used for different purposes and
mutate with use.

Amends 8aee7c6b29

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: Id5aaf8d423ec8b94afffe4641b54dab94b5453fb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 22:18:25 +00:00
Alexey Edelev
3329212815 Move the linking logic of the object libraries to a common function
The linking logic of object libraries should be reusable outside of the
resource context. This introduces a
__qt_internal_propagate_object_library function that prepares all the
necessary genexes to link and propagate the object library to the
end-point executable.

Rename resource object finalizer API to make the naming more generic
to object libraries of any kind.

Amends 5fb99e3860

Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 23:18:26 +02:00
Mårten Nordheim
bccfb92507 CMake: output VCPKG_CHAINLOAD_TOOLCHAIN_FILE with cmake paths
Change-Id: Ibde8890c30b9024aca589e892590d071b547c361
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 21:15:05 +02:00
Alexey Edelev
29789ff0ea Use target OUTPUT_NAME as a module identifier in .pri files
QtPriHelpers copies the logic related to the module OUTPUT_NAME to
produce a module identifier. Since the module identifier should be
equal to OUTPUT_NAME it makes sense to reuse the property and
deduplicate logic.

Amends 8aee7c6b29

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: I8d9c04273e4cdb1a2e6a3b0db3ddf52e008c0cf7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 15:14:02 +02:00
Giuseppe D'Angelo
f29ff5dffb Add GCC 11 and C++20 workarounds
GCC 11.1 has a bug [1] in the preprocessor that leads to
-Wsuggest-override warnings being raised in random places, even under
pragmas that are supposed to suppress it. For some reason, NOT using the
integrated preprocessor fixes it, so add that flag as a workaround.

Also, GCC 11 introduces a family of warnings for C++20's deprecations of
mixed enum arithmetic, which we use all over the place. Avoid a hard
error for those warnings.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796

Change-Id: I3b2aefa385f191f207e7eb876bc1ed0b18fb342b
Pick-to: 6.1 6.2
Task-number: QTBUG-93360
Task-number: QTBUG-94059
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-18 15:14:02 +02:00
Alexandru Croitor
b6c5e06676 CMake: Handle OPTIONAL_COMPONENTS in qt_find_package
The optional components arguments were not handled before which
caused the recorded package information for static builds to be
incorrect, it only recorded the package name without the component.

Remove REQUIRED_COMPONENTS TODO, there is no such find_package option,
it's already handled by the regular COMPONENTS code path.

Amends 07b6d3367d

Pick-to: 6.1 6.2
Fixes: QTBUG-94501
Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 23:28:18 +02:00
Alexey Edelev
8aee7c6b29 Fix internal module naming in qmake .pri files
Set the correct value to the _qt_config_module_name property at the
internal module creating step instead of appending _private suffix when
generating .pri files.

Amends 425ff34aa1

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: I6fa8089358bc638668e313c98c3aee680bf7ec2a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-17 19:32:56 +02:00
Alexandru Croitor
5ec937115b CMake: Export info if an object lib target is a plugin initializer
Needed for qtdeclarative so we can filter out which object library
should go into which export set, because qt_internal_add_qml_module
can create both a backing library export set and a plugin export set.
The plugin initializer object lib should go to the plugin export set.

Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I0fce131eff75a0b3090ac0fbb2a12ecfcba5e38d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
a37957df5c CMake: Add TODO to apply generalized object library linking approach
Pick-to: 6.2
Change-Id: I1ea368e81d8b055ef353a0f021f188b45588c937
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
602d26c38f CMake: Set the plugin class name for qml plugins
This is needed for a change in qtdeclarative to allow building the
Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin.

Show an error if the qml plugin has no class name, it's needed for
plugin initialization so it's mandatory to have a class name.

Show an error if a class name is not found when computing the import
macro for a plugin (both for a regular qt plugin and a qml plugin).

When querying for the class name of a target, query both a Qt6::
prefixed target as well as a non-prefixed one, with the Qt one
taking precedence.
This is to allow querying the class name of user project created qml
plugins.

Currently regular qt user plugins don't use the object library
initializer approach. This will likely be revisited in the future.

Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
103c1bc7ba CMake: Don't generate .pri files for qml plugins
We didn't do it in Qt 5 times and it was accidentally done for Qt 6.

There's no reason to generate them, the .pri files are only meant to
be used for regular plugins so a project can do QTPLUGINS += foo.

That mechanism is not needed for qml plugins which use
qmlimportscanner instead.

Furthermore the pri contents didn't contain a class name, so they
couldn't be used anyway.

Pick-to: 6.2
Change-Id: I6299fda21ece0f693a817ab558b45aa46b97e5ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexey Edelev
13a4de6bf6 Remove target specific flags from the linker capabilities check
Remove target specific flags from static_link_order.
Move the check to the common config.tests folder.

Amends 5fb99e3860

Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: I1368075ec6bd1e743b2b89fd93143df38a278ec2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-16 21:56:09 +02:00
Alexandru Croitor
335123f240 CMake: Don't make example external projects depend on tests
Only depend on the ${project}_src and ${project}_tools targets.

This might exclude some non-obivous target dependencies, but we can
adjust that if needed.

This reduces the build.ninja file of qtbase + qtsvg form 341MB
to 41MB when configuring with tests and examples, as well as reduces
the processing time of calling ninja.

Amends d97fd7af2b

Pick-to: 6.2
Change-Id: I2860d8ae89728f33f6b73fede1335cd6d6290f78
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-16 20:01:30 +02:00
Alexey Edelev
5fb99e3860 Check the impact of static link order for user projects
For user projects we run the static link order check once
'find_package(Qt6 ...)' is called.

If linker can resolve circular dependencies between static libraries
and object files we set the _qt_link_order_matters property of the
Qt::Platform target. This indicates the use of finalizers is not
required and we may rely on CMake-base propagation of resource
libraries and resource object files.

If linker could not resolve circular dependencies depending on
the _qt_resource_objects_finalizer_mode value:
  - Finalizer will be called and collected resource objects will be
    linked to the target directly.
  - Finalizer will be omitted and resource objects will be linked
    using the target_sources function implicitly. This only
    propagates resource one level up if consumer links the static
    library PUBLICly, but all symbols will be resolved correctly
    since object files are placed in the beginning of the linker line.

In the CMake version 3.21 we expect that CMake will take care about
the order of the resource object files in a linker line, it's
expected that all object files are located at the beginning of the
linker line.

TODO: Need to confirm that the CMake 3.21 meets the expectations.

Amends 4e901a2f99

Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-16 16:58:45 +02:00
Alexandru Croitor
7f0f44f014 CMake: Promote all targets to global within a scope when possible
CMake 3.21 introduced a new IMPORTED_TARGETS directory property which
we can use to promote all imported targets within a scope to be
global.

This would cover transitive non-Qt imported targets which the Qt build
system does not know about and is thus a more complete solution
compared to promoting only Qt targets.

Run a finalizer at the end of the directory scope where
find_package(Qt6) is called to promote all imported targets within
that scope to global (when requested).

The old promotion method is disabled when the CMake version is new
enough.

Pick-to: 6.2
Task-number: QTBUG-92878
Task-number: QTBUG-94528
Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-16 13:22:17 +02:00
Alexandru Croitor
561fc8107f CMake: Allow promoting the Qt libraries to be global targets
User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to
true so that the various imported targets created by find_package(Qt6)
are promoted to global targets.

This would allow a project to find Qt packages in a subdirectory scope
while using those Qt targets from a different scope.

E.g. it fixes errors like

  CMake Error at CMakeLists.txt:5 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_OBJECTS:Qt6::Widgets_resources_1>

  Objects of target "Qt6::Widgets_resources_1" referenced but no such
  target exists.

when trying to use a static Qt from a sibling scope.

Various 3rd party dependency targets (like Atomic or ZLIB) are not
made global due to limitations in CMake, but as long as those targets
are not mentioned directly, it shouldn't cause issues.

The targets are made global in the generated
QtFooAdditionalTargetInfo.cmake file.

To ensure that resource object libraries promoted, the generation
of the file has to be done at the end of the defining scope
where qt_internal_export_additional_targets_file is called,
which is achieved with a deferred finalizer.

Replaced all occurrences of target promotion with a helper function
which allows tracing of all promoted targets by specifying
--log-level=debug to CMake.

Pick-to: 6.2
Fixes: QTBUG-92878
Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-16 13:22:17 +02:00
Allan Sandfeld Jensen
b62fcccb15 Detect win32-msvc target
Automatically set compilers based on old mkspec style target

Pick-to: 6.2
Change-Id: I80404376964a85c6b519657c054d008da47aed91
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-15 16:58:46 +02:00
Allan Sandfeld Jensen
127f658cc9 Fix the win32-clang-msvc target
Detect clang-cl mkspec target

Pick-to: 6.2
Change-Id: If0ca31ae2da3b44a4e2bd116933007139cc02fdc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-15 16:58:46 +02:00
Alexey Edelev
02855ff6e0 Adjust the EntryPoint target name according to the internal module naming policy
Pick-to: 6.2
Task-number: QTBUG-87775
Change-Id: I1d6097c950f97e102c44e2952edc98caa4deb6c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-15 12:51:49 +02:00
Alexandru Croitor
dab8f64b6d CMake: Be precise about EXTERNAL_BUILD check when building examples
This change allows temporarily removing the EXTERNAL_BUILD option in
a qt repo examples project to check how the examples behave in a
non-external project build, without forcing the developer to use a
prefix build.

Useful to compare behavior until we've ported over prefix builds to
use EXTERNAL_BUILD.

Amends d97fd7af2b

Change-Id: I29b834bb5f00e1e93966caae6f816faedba76b76
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-15 12:51:49 +02:00
Dominik Holland
f380c87731 CMake: Add public FindPackageHelpers
This makes qt_internal_disable_find_package_global_promotion available,
which is needed when linking against QtMultimedia in a static build

Pick-to: 6.2
Change-Id: I9b8f6d7b74a8693ac471f8a280e893f4da80a44b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-14 20:58:00 +02:00
Robert Griebl
6eea6e30c6 cmake: Allow tools to enable exceptions
Needed for the QtApplicationManager tools.

Pick-to: 6.2
Change-Id: I987b297406b6659d777ce5c00f9fc1b89ccc80ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-14 18:32:47 +00:00
Alexey Edelev
523ee5577a Replace flags with spaces when removing them
Removing flags based on REGEX may include spaces, so flags might be
glued. Replace flags with spaces to keep at least one space for
the described case.

Pick-to: 6.2 6.1
Fixes: QTBUG-94400
Change-Id: Ice268da36174ef5cf4398d2aee8fcd4731336316
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-12 00:30:23 +02:00
Alexey Edelev
fd5b92c2ba Fix internal module mappings of the qtdeclarative repo
Add 'Private' suffix to the internal module names in the mappings of
the qmake files for modules of the qtdeclarative repo.

Change-Id: I1592ebad0f0db553322ea766561b1b8c3fd38aea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-11 15:34:38 +02:00
Alexey Edelev
4e901a2f99 Add the check for linker capabilities to resolve circular dependencies
'ld' only capable to resolve circular dependencies by wrapping the
suspected static libraries and objects using --start/end-group
arguments. We want to detect if linker is 'ld' at configure time to
decide how to link the resource objects if finalizers are not enabled.

The qt_config_compile_test function is extended with an extra argument
since it's required to pass custom cmake flags to the ld-related test.

Pick-to: 6.2
Change-Id: I484fcc99e2886952d8b0232f37e4e6a35d072931
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-10 15:17:55 +02:00
Alexandru Croitor
524b957d1f CMake: Fix global 'apk' target to apply to Qt EXTERNAL_BUILD examples
This means calling 'ninja apk' in a Qt build with examples configured
will build all example apks, regardless of whether the examples are
built as external projects or in-tree.

Fixes: QTBUG-94264
Change-Id: I5c7af0354858898a2e154a6d54fb025e4d81ff80
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-08 22:37:50 +02:00
Lorn Potter
1b4fe5d388 wasm: fix threaded builds
set the thread pool size default to 4

Change-Id: I038a81610c82ac4d162c044d0e1f58196cffc7b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-08 08:10:43 +10:00
Cristian Adam
20b3eb0fd8 CMake: Add support for building with clang-cl
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>
2021-06-04 16:25:17 +02:00
Joerg Bornemann
6d82d0c532 Remove CMake compatibility functions for old API
All repositories define QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS by now,
and we can remove QtCompatibilityHelpers.cmake altogether.

Change-Id: I4d8104246e96a4514d5651c104607d651d208d95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-04 14:27:20 +02:00
Niclas Rosenvik
7920c03ff1 Fix support for using system supplied md4c library
Add FindWrapSystemMd4c.cmake so that the old md4c target can be used
as well as the new one and set WrapSystemMd4c_FOUND.
Link to the imported target WrapSystemMd4c::WrapSystemMd4c if the
system library is used.
Add qt_find_package line to find the package in configure.cmake.
Fix the condition for enabling system-textmarkdownreader, it includes
testing for textmarkdownreader because even if the code would compile
correctly without it, it looks strange when the output says
"textmarkdownreader no" and under "using system libmd4c yes" even if
libmd4c is not used.
Use system include when system-markdownreader is enabled.
Add library mapping for libmd4c.

Change-Id: Id5d5b13d6691a8c1cdf627238887977c847c1e67
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-03 20:08:32 +02:00
Alexey Edelev
5cc3105807 Move resource object files to the beginning of linker line in .prl files
Move collected resource objects to the beginning of the linker line to
prevent order-related issues.

Fixes: QTBUG-92250
Change-Id: Ia046f2820feb693bfadc2b60e07fa001638d4d7b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-03 19:37:46 +02:00
Kai Köhne
f00c63093b Fix location of qtattributionsscanner in doc builds
qtattributionsscanner is now found in libexec.

Task-number: QTBUG-88791
Change-Id: Ie704663012be92b0c223d9d57210ec1874abff0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-03 18:23:40 +02:00