aboutsummaryrefslogtreecommitdiffstats
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-16 04:10:09 +0000
commitec5fee55ef1596db95d6f0ebcdf256b1ffd5da02 (patch)
treeb0339b4a2e170acfd4ba2ef26f6838ae8f5c5bc6
parent0f7a3165ba48720cf414ca16735db8e92ad4f894 (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. 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> (cherry picked from commit 470fee3217794c66f0eaf19f1a3cb229cfb85fc1)
-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 9eb96384ff..bd565a1fb0 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -2525,28 +2525,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
@@ -2567,13 +2545,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