diff options
author | Kai Koehne <kai.koehne@qt.io> | 2020-08-19 14:05:29 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2020-08-25 21:13:08 +0200 |
commit | db21bad936a761f475145886f1e06dfcfa11eb80 (patch) | |
tree | df6c3fe9993e7550fd5a4ef8ccee39438d85166d /cmake/QtModuleHelpers.cmake | |
parent | 24af3ebef3dc4046bc6ea38b88bb5a65ea5cbb46 (diff) |
Port headersclean check to CMake
Configure Qt with -DQT_FEATURE_headersclean=ON to enable the
check. There will be separate target for each module include
(e.g. QtCore_header_check), but the check will also be done
when the module is built for the first time.
There are notable differences to the qmake version:
- the build does not pick up anymore default defines or flags from
the module, or Qt. Instead options like -fPIC they have to be listed
explicitly. Also for this reason, we have to skip the vulkan-related
headers from the check, since vulkan/vulkan.h is not necessarily
in the compiler's default search path.
- some checks for nowadays unsupported compiler versions are
removed.
- -Wdouble-promotion -Wshorten-64-to-32 is not added for clang
builds; the qmake code path did never enforce that on CI
machines (it was non-Apple clang only), and the check currently
fails on these configurations.
Fixes: QTBUG-82615
Change-Id: I1cd303677b1472116910b6c27748f96436feb35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtModuleHelpers.cmake')
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 6a4f49dc76..b60c8a04ea 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -559,6 +559,13 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") endif() endif() + if(QT_FEATURE_headersclean AND NOT arg_NO_MODULE_HEADERS) + qt_internal_add_headers_clean_target( + ${target} + "${module_include_name}" + "${module_headers_clean}") + endif() + if(NOT ${arg_NO_PRIVATE_MODULE}) target_include_directories("${target_private}" INTERFACE ${interface_includes}) target_link_libraries("${target_private}" INTERFACE "${target}") |