Skip to content

Commit

Permalink
Fix long file name generated for certain qmlcache.qrc
Browse files Browse the repository at this point in the history
When compiling qtvirtualkeyboard with MSVC, it may choke on the long
file name generated for certain *_qmlcache.qrc files. Specifically,
these files are originally generated by qmake, therefore reside in the
build directory.

For example, this happens when compiling qtvirtualkeyboard out-of-tree
using shadow build (e.g. in Qt Creator):

qrc____build_qtvirtualkeyboard_Desktop_Qt_5_12_0_MSVC2017_x86_64_Debug_src_virtualkeyboard_.rcc_release_qmake_virtualkeyboard_layouts_qmlcache.cpp
c1xx: fatal error C1083: Cannot open source file: '.rcc\release\qrc____build_qtvirtualkeyboard_Desktop_Qt_5_12_0_MSVC2017_x86_64_Debug_src_virtualkeyboard_.rcc_release_qmake_virtualkeyboard_layouts_qmlcache.cpp': No such file or directory

This change changes the base directory to $$OUT_PWD for paths which
point outside the source directory.

Change-Id: I9733af98d916a60ca1ab02cd49ab67024f1db086
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
  • Loading branch information
jarkkokoivikko-code-q committed Oct 6, 2018
1 parent b22cb20 commit 5d7710a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/qmlcachegen/qtquickcompiler.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ isEmpty(QMLCACHE_DIR): QMLCACHE_DIR = .

defineReplace(qmlCacheResourceFileOutputName) {
name = $$relative_path($$1, $$_PRO_FILE_PWD_)
contains(name, ^\\.\\..*): name = $$relative_path($$1, $$OUT_PWD)
name = $$replace(name,/,_)
name = $$replace(name, \\.qrc$, _qmlcache.qrc)
name = $$replace(name,\.\.,)
Expand Down

0 comments on commit 5d7710a

Please sign in to comment.