diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-09 11:01:41 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-08-09 09:21:12 +0000 |
commit | 8ba882a0b39d1e16aa797f4b89f8796d22aa8bef (patch) | |
tree | 97c545de4b1d158e97b6002647259825ec93a38a | |
parent | 587581963e79093c26deccde0d421341dd2ddd60 (diff) |
Add support for QTQUICK_COMPILER_SKIPPED_RESOURCES
Detect this in the conversion script and map it to a source file
property. When that's the case, avoid repeating the file list but
instead store it in a variable.
Change-Id: If3119d83914bb798766e27351746b4e867bd3ab3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | cmake/QtBuild.cmake | 2 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 790b322876..5ceba17086 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2425,7 +2425,7 @@ function(qt_quick_compiler_process_resources target resource_name) foreach(file IN LISTS arg_FILES) # check whether this resource should not be processed by the qt quick # compiler - get_source_file_property(skip_compiler_check ${file} QT_QUICKCOMPILER_SKIPPED_RESOURCE) + get_source_file_property(skip_compiler_check ${file} QT_SKIP_QUICKCOMPILER) if (skip_compiler_check) list(APPEND resource_files ${file}) continue() diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 589ac1d568..78fd4fd1ce 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -115,7 +115,7 @@ def find_qmake_conf(project_file_path: str = '') -> typing.Optional[str]: return None -def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_file_path: str = '') -> str: +def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_file_path: str = '', skip_qtquick_compiler: bool = False) -> str: assert(target) # Hack to handle QT_SOURCE_TREE. Assume currently that it's the same @@ -181,6 +181,14 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_fil output += 'set_source_files_properties("{}"\n' \ ' PROPERTIES alias "{}"\n)\n'.format(full_source, alias) + if skip_qtquick_compiler: + file_list = '\n '.join(sorted_files) + output += 'set(resource_files\n {}\n)\n\n'.format(file_list) + file_list = "${resource_files}" + output += 'set_source_files_properties(${resource_files} QT_SKIP_QUICKCOMPILER 1)\n\n' + else: + file_list = '\n '.join(sorted_files) + params = '' if lang: params += ' LANG\n "{}"\n'.format(lang) @@ -190,7 +198,7 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '', project_fil params += ' BASE\n "{}"\n'.format(base_dir) output += 'add_qt_resource({} "{}"\n{} FILES\n {}\n)\n'.format(target, full_resource_name, params, - '\n '.join(sorted_files)) + file_list) resource_count += 1 @@ -1666,12 +1674,13 @@ def write_resources(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in # Handle QRC files by turning them into add_qt_resource: resources = scope.get_files('RESOURCES') + qtquickcompiler_skipped = scope.get_files('QTQUICK_COMPILER_SKIPPED_RESOURCES') qrc_output = '' if resources: qrc_only = True for r in resources: if r.endswith('.qrc'): - qrc_output += process_qrc_file(target, r, scope.basedir, scope.file_absolute_path) + qrc_output += process_qrc_file(target, r, scope.basedir, scope.file_absolute_path, r in qtquickcompiler_skipped) else: qrc_only = False |