diff options
author | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2018-04-04 09:36:45 +0200 |
---|---|---|
committer | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2018-04-04 09:36:45 +0200 |
commit | 4b98898c7c9844d06e8a6dffd995d820202456bd (patch) | |
tree | d268e3d2b8fbd5fc987c95c9cfc78585e9db556a /mesonbuild | |
parent | b4cd949c48ab67891e4bc6b14a8f9f247e28777d (diff) | |
download | meson-4b98898c7c9844d06e8a6dffd995d820202456bd.zip meson-4b98898c7c9844d06e8a6dffd995d820202456bd.tar.gz meson-4b98898c7c9844d06e8a6dffd995d820202456bd.tar.bz2 |
[Qt module] refactor b4cd949c48ab67891e4bc6b14a8f9f247e28777d
Since relative path in qrc files are always relative to qrc file
itself then we just need to check that normpath(qrc file + resource)
doesn't start with build dir path, this would mean that the resource is
generated.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/qt.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py index a306af7..39c65ed 100644 --- a/mesonbuild/modules/qt.py +++ b/mesonbuild/modules/qt.py @@ -93,6 +93,9 @@ class QtBaseModule: # a) in build directory -> implies a generated file # b) in source directory # c) somewhere else external dependency file to bundle + # + # Also from qrc documentation: relative path are always from qrc file + # So relative path must always be computed from qrc file ! if os.path.isabs(resource_path): # a) if resource_path.startswith(os.path.abspath(state.environment.build_dir)): @@ -102,10 +105,9 @@ class QtBaseModule: else: result.append(File(is_built=False, subdir=state.subdir, fname=resource_path)) else: - path_from_build = os.path.normpath(os.path.join(state.environment.build_dir, resource_path)) - path_from_rcc = os.path.join(rcc_dirname, resource_path) + path_from_rcc = os.path.normpath(os.path.join(rcc_dirname, resource_path)) # a) - if path_from_build.startswith(state.environment.build_dir) and not os.path.exists(path_from_rcc): + if path_from_rcc.startswith(state.environment.build_dir): result.append(File(is_built=True, subdir=state.subdir, fname=resource_path)) # b) else: |