aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2023-06-13 08:29:52 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2023-06-13 20:35:32 +0200
commit470fee3217794c66f0eaf19f1a3cb229cfb85fc1 (patch)
treeb086b654c97dc350cf71c66fb22077e53515ae65 /src/qml/Qt6QmlMacros.cmake
parent8a74155411d7a22bb8efa405fe59a681e47e6b45 (diff)
CMake: Remove superfluous depfile in QML type registration
In _qt_internal_qml_type_registration we created a depfile that contained the *_metatypes.json files of target's SOURCES. This depfile was used in the custom command that produces ${target}_qmltyperegistration.cpp. It doesn't seem necessary to create a depfile, and one could use the DEPENDS option of add_custom_command instead. And indeed, commit ce950d619aef3ad0534544b2e029a6f025b256a5 added the same dependencies this way. Presumably, this was done to fix dependencies for older CMake versions and generators that do not support depfiles. This commit removes the creation of the depfile. This double dependency declaration was found when investigating QTBUG-106683, and it turns out that removing the depfile fixes the problem of re-generating ${target}_qmltyperegistration.cpp for Visual Studio generators. Pick-to: 6.2 6.5 6.6 Task-number: QTBUG-106683 Change-Id: I6cf909dfb4a9b31b76599b7ad35ad6f595ca0891 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 2bc33adf9b..585089e1b3 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -2564,28 +2564,6 @@ function(_qt_internal_qml_type_registration target)
message(FATAL_ERROR "Need target metatypes.json file")
endif()
- cmake_policy(PUSH)
-
- _qt_internal_check_depfile_support(has_depfile_support)
- set(registration_cpp_file_dep_args)
- if(has_depfile_support)
- if(POLICY CMP0116)
- # Without explicitly setting this policy to NEW, we get a warning
- # even though we ensure there's actually no problem here.
- # See https://gitlab.kitware.com/cmake/cmake/-/issues/21959
- cmake_policy(SET CMP0116 NEW)
- set(relative_to_dir ${CMAKE_CURRENT_BINARY_DIR})
- else()
- set(relative_to_dir ${CMAKE_BINARY_DIR})
- endif()
- set(dependency_file_cpp "${target_binary_dir}/qmltypes/${type_registration_cpp_file_name}.d")
- set(registration_cpp_file_dep_args DEPFILE ${dependency_file_cpp})
- file(RELATIVE_PATH cpp_file_name "${relative_to_dir}" "${type_registration_cpp_file}")
- file(GENERATE OUTPUT "${dependency_file_cpp}"
- CONTENT "${cpp_file_name}: $<IF:$<BOOL:${genex_list}>,\\\n$<JOIN:${genex_list}, \\\n>, \\\n>"
- )
- endif()
-
_qt_internal_get_tool_wrapper_script_path(tool_wrapper)
add_custom_command(
OUTPUT
@@ -2606,13 +2584,10 @@ function(_qt_internal_qml_type_registration target)
${CMAKE_COMMAND} -E make_directory "${generated_marker_dir}"
COMMAND
${CMAKE_COMMAND} -E touch "${generated_marker_file}"
- ${registration_cpp_file_dep_args}
COMMENT "Automatic QML type registration for target ${target}"
VERBATIM
)
- cmake_policy(POP)
-
# The ${target}_qmllint targets need to depend on the generation of all
# *.qmltypes files in the build. We have no way of reliably working out
# which QML modules a given target depends on at configure time, so we