Add the common headersclean_check target
Add headersclean_check that allows to run all module-specific '_headersclean_check' targets in single command. Also add dependency on input header files for the headers clean custom commands. Also adjust the '_headersclean_check' target names to match the naming of module targets - the 'Qt' prefix is removed. Change-Id: I17c3442c3c51ce99cd9b38c85d606e9ababbb013 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
9ce5709fb1
commit
c2c4a21374
@ -1,10 +1,10 @@
|
|||||||
# Copyright (C) 2022 The Qt Company Ltd.
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
# Add a custom ${module_include_name}_header_check target that builds each header in
|
# Add a custom ${module_target}_headersclean_check target that builds each header in
|
||||||
# ${module_headers} with a custom set of defines. This makes sure our public headers
|
# ${module_headers} with a custom set of defines. This makes sure our public headers
|
||||||
# are self-contained, and also compile with more strict compiler options.
|
# are self-contained, and also compile with more strict compiler options.
|
||||||
function(qt_internal_add_headers_clean_target
|
function(qt_internal_add_headersclean_target
|
||||||
module_target
|
module_target
|
||||||
module_include_name
|
module_include_name
|
||||||
module_headers)
|
module_headers)
|
||||||
@ -188,7 +188,9 @@ function(qt_internal_add_headers_clean_target
|
|||||||
-o${artifact_path}
|
-o${artifact_path}
|
||||||
IMPLICIT_DEPENDS CXX
|
IMPLICIT_DEPENDS CXX
|
||||||
VERBATIM
|
VERBATIM
|
||||||
COMMAND_EXPAND_LISTS)
|
COMMAND_EXPAND_LISTS
|
||||||
|
DEPENDS "${input_path}"
|
||||||
|
)
|
||||||
list(APPEND hclean_artifacts "${artifact_path}")
|
list(APPEND hclean_artifacts "${artifact_path}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@ -221,17 +223,24 @@ function(qt_internal_add_headers_clean_target
|
|||||||
-Fo${artifact_path} "${source_path}"
|
-Fo${artifact_path} "${source_path}"
|
||||||
IMPLICIT_DEPENDS CXX
|
IMPLICIT_DEPENDS CXX
|
||||||
VERBATIM
|
VERBATIM
|
||||||
COMMAND_EXPAND_LISTS)
|
COMMAND_EXPAND_LISTS
|
||||||
|
DEPENDS "${input_path}"
|
||||||
|
)
|
||||||
list(APPEND hclean_artifacts "${artifact_path}")
|
list(APPEND hclean_artifacts "${artifact_path}")
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
else()
|
||||||
message(ERROR "CMAKE_CXX_COMPILER_ID \"${CMAKE_CXX_COMPILER_ID}\" is not supported for the headersclean check.")
|
message(FATAL_ERROR "CMAKE_CXX_COMPILER_ID \"${CMAKE_CXX_COMPILER_ID}\" is not supported"
|
||||||
|
" for the headersclean check.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(${module_include_name}_header_check
|
add_custom_target(${module_target}_headersclean_check
|
||||||
COMMENT "headersclean: Checking headers in ${module_include_name}"
|
COMMENT "headersclean: Checking headers in ${module_include_name}"
|
||||||
DEPENDS ${hclean_artifacts}
|
DEPENDS ${hclean_artifacts}
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
|
|
||||||
add_dependencies(${module_target} ${module_include_name}_header_check)
|
if(NOT TARGET headersclean_check)
|
||||||
|
add_custom_target(headersclean_check ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_dependencies(headersclean_check ${module_target}_headersclean_check)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -819,7 +819,7 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(QT_FEATURE_headersclean AND NOT arg_NO_MODULE_HEADERS)
|
if(QT_FEATURE_headersclean AND NOT arg_NO_MODULE_HEADERS)
|
||||||
qt_internal_add_headers_clean_target(
|
qt_internal_add_headersclean_target(
|
||||||
${target}
|
${target}
|
||||||
"${module_include_name}"
|
"${module_include_name}"
|
||||||
"${module_headers_clean}")
|
"${module_headers_clean}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user