diff --git a/cmake/QtFrameworkHelpers.cmake b/cmake/QtFrameworkHelpers.cmake index 6d67bc4a119..8c39cb9b8f2 100644 --- a/cmake/QtFrameworkHelpers.cmake +++ b/cmake/QtFrameworkHelpers.cmake @@ -82,24 +82,41 @@ function(qt_copy_framework_headers target) set(output_dir_QPA "${output_dir}/${fw_private_module_header_dir}/qpa") set(output_dir_RHI "${output_dir}/${fw_private_module_header_dir}/rhi") + qt_internal_module_info(module "${target}") - set(out_files) + set(out_files "") + set(in_files "") + set(copy_commands "") foreach(type IN ITEMS PUBLIC PRIVATE QPA RHI) + set(in_files_${type} "") set(fw_output_header_dir "${output_dir_${type}}") foreach(hdr IN LISTS arg_${type}) get_filename_component(in_file_path ${hdr} ABSOLUTE) get_filename_component(in_file_name ${hdr} NAME) set(out_file_path "${fw_output_header_dir}/${in_file_name}") - add_custom_command( - OUTPUT ${out_file_path} - DEPENDS ${in_file_path} - COMMAND ${CMAKE_COMMAND} -E make_directory "${fw_output_header_dir}" - COMMAND ${CMAKE_COMMAND} -E copy "${in_file_path}" "${fw_output_header_dir}" - VERBATIM) list(APPEND out_files ${out_file_path}) + list(APPEND in_files_${type} "${in_file_path}") endforeach() + if(in_files_${type}) + list(APPEND copy_commands + COMMAND ${CMAKE_COMMAND} -E copy ${in_files_${type}} "${fw_output_header_dir}") + list(APPEND in_files ${in_files_${type}}) + endif() endforeach() + list(REMOVE_DUPLICATES out_files) + list(REMOVE_DUPLICATES in_files) + add_custom_command( + OUTPUT "${output_dir}/${fw_versioned_header_dir}" ${out_files} + DEPENDS ${in_files} ${target}_sync_headers + COMMAND + ${CMAKE_COMMAND} -E copy_directory + "${module_build_interface_include_dir}/.syncqt_staging" + "${output_dir}/${fw_versioned_header_dir}" + ${copy_commands} + VERBATIM + COMMENT "Copy the ${target} header files to the framework directory" + ) set_property(TARGET ${target} APPEND PROPERTY QT_COPIED_FRAMEWORK_HEADERS "${out_files}") endfunction() diff --git a/cmake/QtSyncQtHelpers.cmake b/cmake/QtSyncQtHelpers.cmake index 4dba8fccfec..c310d1ac6de 100644 --- a/cmake/QtSyncQtHelpers.cmake +++ b/cmake/QtSyncQtHelpers.cmake @@ -61,13 +61,6 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge set(is_framework FALSE) if(NOT is_interface_lib) get_target_property(is_framework ${target} FRAMEWORK) - if(is_framework) - qt_internal_get_framework_info(fw ${target}) - get_target_property(fw_output_base_dir ${target} LIBRARY_OUTPUT_DIRECTORY) - set(framework_args "-framework" - "-frameworkIncludeDir" "${fw_output_base_dir}/${fw_versioned_header_dir}" - ) - endif() endif() qt_internal_get_qt_all_known_modules(known_modules) @@ -151,7 +144,6 @@ function(qt_internal_target_sync_headers target module_headers module_headers_ge -headers ${module_headers} -stagingDir "${syncqt_staging_dir}" -knownModules ${known_modules} - ${framework_args} ${version_script_args} ) list(JOIN syncqt_args "\n" syncqt_args_string) diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp index 442d07a0a69..ab982b0342e 100644 --- a/src/tools/syncqt/main.cpp +++ b/src/tools/syncqt/main.cpp @@ -7,8 +7,7 @@ * - Header file that contains the module version information, and named as Vesion * - LD version script if applicable * - Aliases or copies of the header files sorted by the generic Qt-types: public/private/qpa - * and stored in the corresponding directories. Also copies the aliases to the framework-specific - * directories. + * and stored in the corresponding directories. * Also the tool executes conformity checks on each header file if applicable, to make sure they * follow rules that are relevant for their header type. * The tool can be run in two modes: with either '-all' or '-headers' options specified. Depending @@ -195,8 +194,6 @@ public: const std::string &privateIncludeDir() const { return m_privateIncludeDir; } - const std::string &frameworkIncludeDir() const { return m_frameworkIncludeDir; } - const std::string &qpaIncludeDir() const { return m_qpaIncludeDir; } const std::string &rhiIncludeDir() const { return m_rhiIncludeDir; } @@ -221,8 +218,6 @@ public: bool scanAllMode() const { return m_scanAllMode; } - bool isFramework() const { return m_isFramework; } - bool isInternal() const { return m_isInternal; } bool isNonQtModule() const { return m_isNonQtModule; } @@ -245,7 +240,6 @@ public: " -includeDir -privateIncludeDir -qpaIncludeDir -rhiIncludeDir " " -stagingDir <-headers
|-all> [-debug]" " [-versionScript ] [-qpaHeadersFilter ] [-rhiHeadersFilter ]" - " [-framework [-frameworkIncludeDir ]]" " [-knownModules ... ]" " [-nonQt] [-internal] [-copy]\n" "" @@ -289,10 +283,6 @@ public: " -versionScript Generate linker version script by\n" " provided path.\n" " -debug Enable debug output.\n" - " -framework Indicates that module is framework.\n" - " -frameworkIncludeDir The directory to store the framework\n" - " header files.\n" - " E.g. QtCore.framework/Versions/A/Headers\n" " -copy Copy header files instead of creating\n" " aliases.\n" " -minimal Do not create CaMeL case headers for the\n" @@ -336,7 +326,6 @@ private: { "-rhiIncludeDir", { &m_rhiIncludeDir } }, { "-stagingDir", { &m_stagingDir, true } }, { "-versionScript", { &m_versionScriptFile, true } }, - { "-frameworkIncludeDir", { &m_frameworkIncludeDir, true } }, { "-publicNamespaceFilter", { &publicNamespaceFilter, true } }, }; @@ -349,7 +338,7 @@ private: static const std::unordered_map> boolArgumentMap = { { "-nonQt", { &m_isNonQtModule, true } }, { "-debug", { &m_debug, true } }, - { "-help", { &m_printHelpOnly, true } }, { "-framework", { &m_isFramework, true } }, + { "-help", { &m_printHelpOnly, true } }, { "-internal", { &m_isInternal, true } }, { "-all", { &m_scanAllMode, true } }, { "-copy", { &m_copy, true } }, { "-minimal", { &m_minimal, true } }, { "-showonly", { &m_showOnly, true } }, { "-showOnly", { &m_showOnly, true } }, @@ -483,10 +472,10 @@ private: // Convert all paths from command line to a generic one. void normilizePaths() { - static std::array paths = { + static std::array paths = { &m_sourceDir, &m_binaryDir, &m_includeDir, &m_privateIncludeDir, &m_qpaIncludeDir, &m_rhiIncludeDir, &m_stagingDir, - &m_versionScriptFile, &m_frameworkIncludeDir + &m_versionScriptFile, }; for (auto path : paths) { if (!path->empty()) @@ -503,13 +492,11 @@ private: std::string m_rhiIncludeDir; std::string m_stagingDir; std::string m_versionScriptFile; - std::string m_frameworkIncludeDir; std::set m_knownModules; std::set m_headers; std::set m_generatedHeaders; bool m_scanAllMode = false; bool m_copy = false; - bool m_isFramework = false; bool m_isNonQtModule = false; bool m_isInternal = false; bool m_printHelpOnly = false; @@ -737,13 +724,6 @@ public: // process eaiser. if (!copyGeneratedHeadersToStagingDirectory(m_commandLineArgs->stagingDir())) error = SyncFailed; - // We also need to have a copy of the generated header files in framework include - // directories when building with '-framework'. - if (m_commandLineArgs->isFramework()) { - if (!copyGeneratedHeadersToStagingDirectory( - m_commandLineArgs->frameworkIncludeDir(), true)) - error = SyncFailed; - } } return error; } @@ -1597,12 +1577,6 @@ public: if (isCrossModuleDeprecation) { const std::string stagingDir = outputDir + "/.syncqt_staging/"; writeIfDifferent(stagingDir + headerName, buffer.str()); - if (m_commandLineArgs->isFramework()) { - const std::string frameworkStagingDir = stagingDir + moduleName - + ".framework/Versions/A/Headers/" QT_VERSION_STR "/" - + moduleName.substr(2) + '/'; - writeIfDifferent(frameworkStagingDir + headerName, buffer.str()); - } } m_producedHeaders.insert(headerName); }