diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-01-30 10:40:42 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-02-01 13:31:02 +0100 |
commit | 3e7d1a990d39132e12a82601afe1db019c258e66 (patch) | |
tree | 7d8edb59fe7869477664fe3ec1a49b5494497ea8 /src/qml/Qt6QmlMacros.cmake | |
parent | f5877880c5596f953a8beee62a91c4e1a2b8a510 (diff) |
Fix cmake dependencies around qmltypes files
qmltypes files are generated by qmltyperegistrar, and conditionally
consumed by qmlcachegen. In turn, the C++ files generated by
qmlcachegen must not declare any moc'able constructs as that would be a
circular dependency via the metatypes.json files. Codify this condition
as a SKIP_AUTOGEN property on the generated C++ files.
Change-Id: Ied2ca6ad202dd20039bca9823ef1de4fffcf64d5
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index b89f824280..d70a5c4aef 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -818,7 +818,10 @@ function(qt6_qml_type_registration target) file(TO_NATIVE_PATH "${${PROJECT_NAME}_BINARY_DIR}/bin$<SEMICOLON>${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}$<SEMICOLON>%PATH%" env_path_native) set(extra_env_command COMMAND set \"PATH=${env_path_native}\") endif() - add_custom_command(OUTPUT ${type_registration_cpp_file} + add_custom_command( + OUTPUT + ${type_registration_cpp_file} + ${plugin_types_file} DEPENDS ${foreign_types_file} ${target_metatypes_json_file} @@ -1007,8 +1010,12 @@ function(_qt_internal_quick_compiler_process_resources target resource_name) DEPENDS $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qmlcachegen> "${file_absolute}" + "$<$<BOOL:${qmltypes}>:${qmltypes}>" ) target_sources(${target} PRIVATE ${compiled_file}) + set_source_files_properties(${compiled_file} PROPERTIES + SKIP_AUTOGEN ON + ) endforeach() set(qmlcache_loader_list "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qmlcache/${resource_name}/qml_loader_file_list.rsp") |