Fix moc warnings with no_include_pwd and shadow builds

If CONFIG option no_include_pwd is set, moc does not add the build
directory to its include path. The path to the generated
moc_predefs.h file is by default relative though, resulting in
moc warnings:

  Warning: Failed to resolve include "debug/moc_predefs.h" for moc file xxx myheader.h

Fix this by always making the path to moc_predefs.h absolute.

Task-number: QTBUG-69087
Change-Id: I8ef79c8340f9ebd6b0bba15e026d65ef3c088535
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Kai Koehne 2018-06-22 16:48:58 +02:00
parent 0e88882fee
commit 4c68e2558c

View File

@ -57,7 +57,7 @@ defineReplace(mocCmdBase) {
msvc: RET += --compiler-flavor=msvc
isEmpty(MOC_PREDEF_FILE): RET += $$join(QMAKE_COMPILER_DEFINES, " -D", -D)
else: RET += --include $$shell_quote($$moc_predefs.output)
else: RET += --include $$shell_quote($$absolute_path($$moc_predefs.output, $$OUT_PWD))
RET += $$incvar $$QMAKE_MOC_OPTIONS
return($$RET)