Commit Graph

3 Commits

Author SHA1 Message Date
Alexandru Croitor
3c23317552 CMake: Make WrapVulkanHeaders target optional for QtGui consumers
If Vulkan headers are present on the system when qtbase is configured,
QtGui and QtOpenGL should be compiled with Vulkan support.

If a user project uses a Qt built with Vulkan support, but their system
is missing Vulkan headers, the project configuration needs to succeed.

The project will get compilation errors if it uses Vulkan headers, but
that's intended.

This use case was broken when fixing Vulkan to be found when building
Qt for Android.

Fix the regression with a combination of things
1) Mark the WrapVulkanHeaders package as optional (already the case)
2) Use the include directories directly when compiling Gui and OpenGL
3) Propagate WrapVulkanHeaders::WrapVulkanHeaders link requirement to
   consumers only if the target exists. It won't exist if Vulkan
   include dirs are not found

This also requires some changes in pri and prl file generation.

For prl file generation, we don't want to link to the
WrapVulkanHeaders target, so we filter out all dependencies that
use TARGET_NAME_IF_EXISTS for anything that calls
__qt_internal_walk_libs which includes qt_collect_libs.

For pri files, we make sure to generate a uses=vulkan/nolink clause
by inspecting a new _qt_is_nolink_target property on the target.

We also don't add include dirs to the pri file if the new
_qt_skip_include_dir_for_pri property is set.
This is intended for Vulkan, because there is separate qmake logic to
try and find the include dirs when configuring a user project.

As a drive-by, fix nolink handling for WrapOpenSSLHeaders.

Amends bb25536a3d
Amends 7b9904849f

Pick-to: 6.2
Fixes: QTBUG-95391
Change-Id: I21e2f4be5c386f9e40033e4691f4786a91ba0e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-07-29 16:38:50 +02:00
Alexandru Croitor
6d59e1e088 CMake: Be more explicit about found OpenSSL variables
Specifying the variables as required variable will show the found
paths in the configure output.

Pick-to: 6.2
Task-number: QTBUG-94355
Change-Id: I985a3585f37b38e25b6be4fae5d42c82e06517de
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-07-01 18:57:22 +02:00
Alexandru Croitor
e0346df1b2 CMake: Handle finding of OpenSSL headers correctly
In Coin when provisioning for Android, we download and configure
the OpenSSL package, but don't actually build it. This means that
find_package(OpenSSL) can find the headers, but not the library,
and thus the package is marked as not found.

Previously the openssl_headers feature used the result of finding
the OpenSSL package, which led to it being disabled in the above
described Android case.

Introduce 2 new find scripts FindWrapOpenSSL and
FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL,
and checks if the headers were found, regardless of the OpenSSL_FOUND
value, which can be used for implementing the openssl_headers feature.

FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the
OpenSSL target if available.

The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android.
Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will
always be prepended to the Android sysroot, causing the package not
to be found.

Adjust the mapping in helper.py to use the targets created by these
find scripts. This also replaces the openssl/nolink target.

Adjust the projects and tests to use the new target names.

Adjust the compile tests for dtls and oscp to use the
WrapOpenSSLHeaders target, so that the features can be enabled even
if the library is dlopen-ed (like on Android).

Task-number: QTBUG-83371
Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-04-08 22:03:24 +02:00