diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-09-10 10:01:31 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-14 13:19:41 +0000 |
commit | 56a2a0f21affff66653c457f24fe72e89b7a2af3 (patch) | |
tree | 4c3b6f45ea56c5e5adcb501584c06c2c4b0cbf5b /qmake | |
parent | f0ed2e6574f67f732516c773f545384e044de5f8 (diff) |
qmake/xcode: Do not create OBJECTS_DIR
If we create OBJECTS_DIR at qmake time, Xcode will not consider this
directory as created by the build system, and "xcodebuild --clean" will
fail.
Prevent qmake from creating that directory in the Xcode generator.
Fixes: QTBUG-96305
Change-Id: I874bf34a4289ce5f2d3e2ce070ffbe56d5368861
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b5a23e88be0dd8cb6c66010c92c495c20c455325)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.h | 1 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 15 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 1 |
4 files changed, 23 insertions, 0 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index c562d9940d..414c8b577e 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -2061,4 +2061,10 @@ ProjectBuilderMakefileGenerator::writeSettings(const QString &var, const ProStri return ret; } +bool +ProjectBuilderMakefileGenerator::inhibitMakeDirOutPath(const ProKey &path) const +{ + return path == "OBJECTS_DIR"; +} + QT_END_NAMESPACE diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h index e344da1b8a..8a3d636575 100644 --- a/qmake/generators/mac/pbuilder_pbx.h +++ b/qmake/generators/mac/pbuilder_pbx.h @@ -68,6 +68,7 @@ public: protected: bool doPrecompiledHeaders() const override { return false; } bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); } + bool inhibitMakeDirOutPath(const ProKey &path) const override; }; QT_END_NAMESPACE diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index dd01ba210b..074bef578b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -173,6 +173,9 @@ MakefileGenerator::initOutPaths() if (noIO() || (project->first("TEMPLATE") == "subdirs")) continue; + if (inhibitMakeDirOutPath(dkey)) + continue; + QString path = project->first(dkey).toQString(); //not to be changed any further path = fileFixify(path, FileFixifyBackwards); debug_msg(3, "Fixed output_dir %s (%s) into %s", dirs[x], @@ -216,6 +219,18 @@ MakefileGenerator::initOutPaths() } } +/* + * For the given directory path, return true if MakefileGenerator::initOutPaths() should inhibit the + * creation of the directory. Overload this in subclasses. + */ +bool +MakefileGenerator::inhibitMakeDirOutPath(const ProKey &path) const +{ + Q_UNUSED(path); + return false; +} + + QMakeProject *MakefileGenerator::projectFile() const { diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index e5a722f8ad..3207909a77 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -153,6 +153,7 @@ protected: void verifyCompilers(); virtual void init(); void initOutPaths(); + virtual bool inhibitMakeDirOutPath(const ProKey &path) const; struct Compiler { QString variable_in; |