xcode generator: don't change output_dir when opening a pbx file directly
ProjectBuilderMakefileGenerator::openOutput should only change back Option::output_dir when creating a pbx file inside an Xcode project. Since the pbx file will be placed inside a different directory than output_dir when creating an Xcode project, MakefileGenerator::openOutput() will redirect output_dir to be inside the Xcode project as well. Since we don't want this redirection, we change output_dir back to what it was once the call returns. But we should only do this when creating the whole Xcode project, since only then we create a pbx file that is different from output_dir in the first place. A bug with this is seen when making qt_makeqmake.mak (which is a helper makefile inside the Xcode project). That file will only regenerate the pbx file (and not the whole Xcode project), which means that we don't enter the fileName.isEmpty() section, which means that output_dir should stay as it is. Task-number: QTBUG-45826 Change-Id: I03d5c3dec395ff4768f9272fd1981c6fd35efb1e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
45f60d2da2
commit
d1528919de
@ -1812,11 +1812,14 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c
|
||||
}
|
||||
output += QString("project.pbxproj");
|
||||
file.setFileName(output);
|
||||
bool ret = UnixMakefileGenerator::openOutput(file, build);
|
||||
((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1);
|
||||
Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2);
|
||||
return ret;
|
||||
}
|
||||
bool ret = UnixMakefileGenerator::openOutput(file, build);
|
||||
((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1);
|
||||
Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2);
|
||||
return ret;
|
||||
|
||||
((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir;
|
||||
return UnixMakefileGenerator::openOutput(file, build);
|
||||
}
|
||||
|
||||
/* This function is such a hack it is almost pointless, but it
|
||||
|
Loading…
x
Reference in New Issue
Block a user