diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-11-20 13:45:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-03 11:57:27 +0100 |
commit | 430f202718f7311c541a7243870719e2df456f2f (patch) | |
tree | 12f089ba18081aa724761848be4b7bdd5b24d7c0 /src/core/resources | |
parent | 7f980badcf1ec600f6a0a8f205a284240c501a64 (diff) |
Ship repacked .pak files
We used to wrap various .pak files in qrc files, but it turns out to be
very memory inefficient compared to chromium's approach of mmaping
those files.
Drop the pak->qrc logic and instead add some pure gyp targets to repack
the resources.
We then install those with qmake and look them up with QLibraryInfo.
Change-Id: I6dd3cedf6afa626ed181463911fef8885c9e9add
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/resources')
-rw-r--r-- | src/core/resources/repack_resources.gypi | 23 | ||||
-rw-r--r-- | src/core/resources/resources.gyp | 18 | ||||
-rw-r--r-- | src/core/resources/resources.pro | 5 |
3 files changed, 41 insertions, 5 deletions
diff --git a/src/core/resources/repack_resources.gypi b/src/core/resources/repack_resources.gypi new file mode 100644 index 000000000..49bd52b8e --- /dev/null +++ b/src/core/resources/repack_resources.gypi @@ -0,0 +1,23 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'action_name': 'repack_resources', + 'variables': { + 'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py', + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak', +# FIXME: we'll probably want those as well +# '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak', + ], + }, + 'inputs': [ + '<(repack_path)', + '<@(pak_inputs)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/repack/qtwebengine_resources.pak', + ], + 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'], +} diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp new file mode 100644 index 000000000..4747829ae --- /dev/null +++ b/src/core/resources/resources.gyp @@ -0,0 +1,18 @@ +{ + 'dependencies': [ + '<(chromium_src_dir)/webkit/webkit_resources.gyp:webkit_resources', + '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', + ], + 'targets': [ + { + 'target_name': 'qtwebengine_resources', + 'type': 'none', + 'actions' : [ + { + 'action_name': 'repack_resources', + 'includes': [ 'repack_resources.gypi' ], + }, + ] + } + ] +} diff --git a/src/core/resources/resources.pro b/src/core/resources/resources.pro deleted file mode 100644 index b0eba1246..000000000 --- a/src/core/resources/resources.pro +++ /dev/null @@ -1,5 +0,0 @@ -# This is a dummy .pro file used to prepare chromium .pak resource files. -# These files will then be bundled using the Qt Resource System. -TEMPLATE = aux - -system("python $$QTWEBENGINE_ROOT/tools/buildscripts/build_resources.py") |