diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 13:09:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-15 16:53:19 +0200 |
commit | c7ec7cd2a1ae9bec31113fae1f1e549b2bf98e0b (patch) | |
tree | fc81fba4e7815ea061da277cf3bcf3102866932f /qmake | |
parent | 7947032e2d1d68b2c0f79874db7adcf560851f29 (diff) | |
parent | 6132260da394a9627947f0fe6a279c20863b6ad2 (diff) |
Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/.prev_CMakeLists.txt | 37 | ||||
-rw-r--r-- | qmake/CMakeLists.txt | 30 | ||||
-rw-r--r-- | qmake/Makefile.unix | 40 | ||||
-rw-r--r-- | qmake/Makefile.win32 | 3 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 39 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 3 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 33 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 19 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.h | 1 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 48 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 4 | ||||
-rw-r--r-- | qmake/library/proitems.cpp | 4 | ||||
-rw-r--r-- | qmake/library/proitems.h | 6 | ||||
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 43 | ||||
-rw-r--r-- | qmake/library/qmakeparser.cpp | 2 | ||||
-rw-r--r-- | qmake/library/qmakeparser.h | 1 | ||||
-rw-r--r-- | qmake/option.cpp | 3 | ||||
-rw-r--r-- | qmake/option.h | 1 |
19 files changed, 125 insertions, 194 deletions
diff --git a/qmake/.prev_CMakeLists.txt b/qmake/.prev_CMakeLists.txt index 085a4e7264..dfbafc4ef0 100644 --- a/qmake/.prev_CMakeLists.txt +++ b/qmake/.prev_CMakeLists.txt @@ -44,22 +44,12 @@ add_qt_executable(qmake ../src/corelib/tools/qarraydataops.h ../src/corelib/tools/qarraydatapointer.h ../src/corelib/tools/qbitarray.cpp ../src/corelib/tools/qbitarray.h - ../src/corelib/tools/qbytearray.cpp ../src/corelib/tools/qbytearray.h - ../src/corelib/tools/qbytearraymatcher.cpp ../src/corelib/tools/qbytearraymatcher.h - ../src/corelib/tools/qchar.h ../src/corelib/tools/qcryptographichash.cpp ../src/corelib/tools/qcryptographichash.h ../src/corelib/tools/qhash.cpp ../src/corelib/tools/qhash.h ../src/corelib/tools/qlist.cpp ../src/corelib/tools/qlist.h - ../src/corelib/tools/qlocale.cpp ../src/corelib/tools/qlocale.h - ../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h ../src/corelib/tools/qmap.cpp ../src/corelib/tools/qmap.h - ../src/corelib/tools/qregexp.cpp ../src/corelib/tools/qregexp.h - ../src/corelib/tools/qstring.cpp ../src/corelib/tools/qstring.h - ../src/corelib/tools/qstringlist.cpp ../src/corelib/tools/qstringlist.h - ../src/corelib/tools/qstringmatcher.h ../src/corelib/tools/qvector.h ../src/corelib/tools/qversionnumber.cpp ../src/corelib/tools/qversionnumber.h - ../src/corelib/tools/qvsnprintf.cpp cachekeys.h generators/mac/pbuilder_pbx.cpp generators/mac/pbuilder_pbx.h generators/makefile.cpp generators/makefile.h @@ -89,9 +79,18 @@ add_qt_executable(qmake option.cpp option.h project.cpp project.h property.cpp property.h + qbytearray.cpp-NOTFOUND qbytearray.h-NOTFOUND + qbytearraymatcher.cpp-NOTFOUND qbytearraymatcher.h-NOTFOUND + qchar.h-NOTFOUND qdatetime.cpp-NOTFOUND qdatetime.h-NOTFOUND qdatetime_p.h-NOTFOUND + qlocale.cpp-NOTFOUND qlocale.h-NOTFOUND + qlocale_tools.cpp-NOTFOUND qlocale_tools_p.h-NOTFOUND + qregexp.cpp-NOTFOUND qregexp.h-NOTFOUND + qstring.cpp-NOTFOUND qstring.h-NOTFOUND + qstringlist.cpp-NOTFOUND qstringlist.h-NOTFOUND + qstringmatcher.h-NOTFOUND + qvsnprintf.cpp-NOTFOUND DEFINES - =\"\" PROEVALUATOR_FULL QT_BOOTSTRAPPED QT_BUILD_QMAKE @@ -99,21 +98,23 @@ add_qt_executable(qmake QT_VERSION_MAJOR= QT_VERSION_MINOR= QT_VERSION_PATCH= + join(QT_VERSION_STR=\"\") INCLUDE_DIRECTORIES . - ../include - ../include/QtCore ../include/QtCore - ../include/QtCore//QtCore - ../src/corelib/global generators generators/mac generators/unix generators/win32 + join(..)/include + join(..)/include/QtCore join(..)/include/QtCore + join(..)/include/QtCore//QtCore + join(..)/src/corelib/global library + PUBLIC_LIBRARIES + Qt::Gui ) #### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>: -# CONFIG = "cmdline" "-qt" # PRECOMPILED_HEADER = "qmake_pch.h" # _OPTION = "host_build" @@ -128,7 +129,7 @@ extend_target(qmake CONDITION WIN32 ../src/corelib/io/qfsfileengine_win.cpp ../src/corelib/io/qsettings_win.cpp ../src/corelib/plugin/qsystemlibrary.cpp - ../src/corelib/tools/qlocale_win.cpp + qlocale_win.cpp-NOTFOUND registry.cpp-NOTFOUND DEFINES UNICODE @@ -148,7 +149,7 @@ extend_target(qmake CONDITION UNIX ../src/corelib/io/qfilesystemiterator_unix.cpp ../src/corelib/io/qfsfileengine_unix.cpp ../src/corelib/kernel/qcore_unix.cpp - ../src/corelib/tools/qlocale_unix.cpp + qlocale_unix.cpp-NOTFOUND ) extend_target(qmake CONDITION APPLE_OSX diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 438f21d767..fce7e536bd 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -51,24 +51,24 @@ add_qt_tool(qmake # special case ../src/corelib/tools/qarraydataops.h ../src/corelib/tools/qarraydatapointer.h ../src/corelib/tools/qbitarray.cpp ../src/corelib/tools/qbitarray.h - ../src/corelib/tools/qbytearray.cpp ../src/corelib/tools/qbytearray.h - ../src/corelib/tools/qbytearraymatcher.cpp ../src/corelib/tools/qbytearraymatcher.h - ../src/corelib/tools/qchar.h + ../src/corelib/text/qbytearray.cpp ../src/corelib/text/qbytearray.h + ../src/corelib/text/qbytearraymatcher.cpp ../src/corelib/text/qbytearraymatcher.h + ../src/corelib/text/qchar.h ../src/corelib/tools/qcryptographichash.cpp ../src/corelib/tools/qcryptographichash.h ../src/corelib/time/qdatetime.cpp ../src/corelib/time/qdatetime.h ../src/corelib/time/qdatetime_p.h # special case ../src/corelib/tools/qhash.cpp ../src/corelib/tools/qhash.h ../src/corelib/tools/qlist.cpp ../src/corelib/tools/qlist.h - ../src/corelib/tools/qlocale.cpp ../src/corelib/tools/qlocale.h - ../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h + ../src/corelib/text/qlocale.cpp ../src/corelib/text/qlocale.h + ../src/corelib/text/qlocale_tools.cpp ../src/corelib/text/qlocale_tools_p.h ../src/corelib/tools/qmap.cpp ../src/corelib/tools/qmap.h - ../src/corelib/tools/qregexp.cpp ../src/corelib/tools/qregexp.h + ../src/corelib/text/qregexp.cpp ../src/corelib/text/qregexp.h ../src/corelib/tools/qringbuffer.cpp # special case - ../src/corelib/tools/qstring.cpp ../src/corelib/tools/qstring.h - ../src/corelib/tools/qstringlist.cpp ../src/corelib/tools/qstringlist.h - ../src/corelib/tools/qstringmatcher.h + ../src/corelib/text/qstring.cpp ../src/corelib/text/qstring.h + ../src/corelib/text/qstringlist.cpp ../src/corelib/text/qstringlist.h + ../src/corelib/text/qstringmatcher.h ../src/corelib/tools/qvector.h ../src/corelib/tools/qversionnumber.cpp ../src/corelib/tools/qversionnumber.h - ../src/corelib/tools/qvsnprintf.cpp + ../src/corelib/text/qvsnprintf.cpp cachekeys.h generators/mac/pbuilder_pbx.cpp generators/mac/pbuilder_pbx.h generators/makefile.cpp generators/makefile.h @@ -108,8 +108,7 @@ add_qt_tool(qmake # special case QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} # special case INCLUDE_DIRECTORIES - # . # special case - library + # . # special case remove generators generators/mac generators/unix @@ -122,7 +121,6 @@ add_qt_tool(qmake # special case qt_internal_add_target_aliases(Bootstrap) # special case #### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>: -# CONFIG = "cmdline" "-qt" # PRECOMPILED_HEADER = "qmake_pch.h" # _OPTION = "host_build" @@ -137,7 +135,7 @@ extend_target(qmake CONDITION WIN32 ../src/corelib/io/qfsfileengine_win.cpp ../src/corelib/io/qsettings_win.cpp ../src/corelib/plugin/qsystemlibrary.cpp - ../src/corelib/tools/qlocale_win.cpp + ../src/corelib/text/qlocale_win.cpp # special case library/registry.cpp # special case DEFINES UNICODE @@ -157,7 +155,7 @@ extend_target(qmake CONDITION UNIX ../src/corelib/io/qfilesystemiterator_unix.cpp ../src/corelib/io/qfsfileengine_unix.cpp ../src/corelib/kernel/qcore_unix.cpp - ../src/corelib/tools/qlocale_unix.cpp + ../src/corelib/text/qlocale_unix.cpp ) extend_target(qmake CONDITION APPLE_OSX @@ -180,7 +178,7 @@ extend_target(qmake CONDITION WIN32 ../src/corelib/io/qfilesystemengine_win.cpp ../src/corelib/io/qfilesystemiterator_win.cpp ../src/corelib/io/qfsfileengine_win.cpp - ../src/corelib/tools/qlocale_win.cpp + ../src/corelib/text/qlocale_win.cpp ../src/corelib/io/qsettings_win.cpp # ../src/corelib/global/qoperatingsystemversion.cpp special case: remove this ../src/corelib/plugin/qsystemlibrary.cpp diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 069cb0f12d..68f173cd1b 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -105,24 +105,24 @@ DEPEND_SRC = \ $(SOURCE_PATH)/src/corelib/serialization/qtextstream.cpp \ $(SOURCE_PATH)/src/corelib/serialization/qxmlstream.cpp \ $(SOURCE_PATH)/src/corelib/serialization/qxmlutils.cpp \ + $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp\ + $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp \ + $(SOURCE_PATH)/src/corelib/text/qlocale.cpp \ + $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp \ + $(SOURCE_PATH)/src/corelib/text/qregexp.cpp \ + $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp \ + $(SOURCE_PATH)/src/corelib/text/qstring.cpp \ + $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp \ + $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp \ $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp \ $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \ $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\ - $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \ $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \ $(SOURCE_PATH)/src/corelib/tools/qhash.cpp \ $(SOURCE_PATH)/src/corelib/tools/qlist.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \ $(SOURCE_PATH)/src/corelib/tools/qmap.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \ $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qstring.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp \ $(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp \ - $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp \ $(QTSRCS) $(QTSRCS2) # QTSRCS and QTSRCS2 come from Makefile.unix.* (concatenated with this # by configure); QTSRCS2 may include *.mm entries on macOS. @@ -302,13 +302,13 @@ qglobal.o: $(SOURCE_PATH)/src/corelib/global/qglobal.cpp qarraydata.o: $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp +qbytearray.o: $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp +qvsnprintf.o: $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp +qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp @@ -338,22 +338,22 @@ qcore_foundation.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp +qstring.o: $(SOURCE_PATH)/src/corelib/text/qstring.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qstringbuilder.o: $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp +qstringbuilder.o: $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp +qlocale.o: $(SOURCE_PATH)/src/corelib/text/qlocale.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp +qlocale_tools.o: $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp +qlocale_unix.o: $(SOURCE_PATH)/src/corelib/text/qlocale_unix.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp +qlocale_win.o: $(SOURCE_PATH)/src/corelib/text/qlocale_win.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< qversionnumber.o: $(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp @@ -407,7 +407,7 @@ qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp +qregexp.o: $(SOURCE_PATH)/src/corelib/text/qregexp.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp @@ -428,7 +428,7 @@ qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp qdatetime.o: $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp +qstringlist.o: $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index d300e49215..43059f9af0 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -196,6 +196,9 @@ qmake_pch.obj: {$(SOURCE_PATH)\src\corelib\serialization}.cpp{}.obj:: $(CXX) $(CXXFLAGS) $< +{$(SOURCE_PATH)\src\corelib\text}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< + {$(SOURCE_PATH)\src\corelib\time}.cpp{}.obj:: $(CXX) $(CXXFLAGS) $< diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index ff936bf1ee..2082bd6dc3 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -167,14 +167,8 @@ MakefileGenerator::initOutPaths() ProString &pathRef = v[dkey].first(); pathRef = fileFixify(pathRef.toQString(), FileFixifyFromOutdir); -#ifdef Q_OS_WIN - // We don't want to add a separator for DLLDESTDIR on Windows (###why?) - if (dkey != "DLLDESTDIR") -#endif - { - if(!pathRef.endsWith(Option::dir_sep)) - pathRef += Option::dir_sep; - } + if (!pathRef.endsWith(Option::dir_sep)) + pathRef += Option::dir_sep; if (noIO() || (project->first("TEMPLATE") == "subdirs")) continue; @@ -2234,21 +2228,6 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t) } bool -MakefileGenerator::writeStubMakefile(QTextStream &t) -{ - t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl; - const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); - for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) - t << *it << " "; - //const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); - t << "first all clean install distclean uninstall: qmake\n" - << "qmake_all:\n"; - writeMakeQmake(t); - t << "FORCE:\n\n"; - return true; -} - -bool MakefileGenerator::writeMakefile(QTextStream &t) { t << "####### Compile\n\n"; @@ -2299,9 +2278,9 @@ QString MakefileGenerator::buildArgs(bool withExtra) //could get stored argv, but then it would have more options than are //probably necesary this will try to guess the bare minimum.. -QString MakefileGenerator::build_args() +QString MakefileGenerator::fullBuildArgs() { - QString ret = "$(QMAKE)"; + QString ret; //output QString ofile = fileFixify(Option::output.fileName()); @@ -2326,7 +2305,7 @@ MakefileGenerator::writeHeader(QTextStream &t) t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl; t << "# Template: " << var("TEMPLATE") << Qt::endl; if(!project->isActiveConfig("build_pass")) - t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << Qt::endl; + t << "# Command: " << var("QMAKE_QMAKE") << fullBuildArgs() << Qt::endl; t << "#############################################################################\n"; t << Qt::endl; QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); @@ -2792,7 +2771,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << Qt::endl; } - QString qmake = build_args(); + QString qmake = "$(QMAKE)" + fullBuildArgs(); if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) { t << escapeDependencyPath(ofile) << ": " << escapeDependencyPath(fileFixify(project->projectFile())) << " "; @@ -3429,9 +3408,9 @@ MakefileGenerator::writePkgConfigFile() t << Qt::endl; // requires - const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' '); - if (!requires.isEmpty()) { - t << "Requires: " << requires << Qt::endl; + const QString requiresString = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' '); + if (!requiresString.isEmpty()) { + t << "Requires: " << requiresString << Qt::endl; } t << Qt::endl; diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index c7b2bee0b4..ac1d5abb11 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -58,7 +58,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo bool resolveDependenciesInFrameworks = false; QHash<QString, bool> init_compiler_already; QString makedir, chkexists; - QString build_args(); + QString fullBuildArgs(); //internal caches mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache; @@ -90,7 +90,6 @@ protected: void writeExtraCompilerTargets(QTextStream &t); void writeExtraCompilerVariables(QTextStream &t); bool writeDummyMakefile(QTextStream &t); - virtual bool writeStubMakefile(QTextStream &t); virtual bool writeMakefile(QTextStream &t); virtual void writeDefaultVariables(QTextStream &t); diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index f9159ccd75..705ad7008a 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -57,6 +57,7 @@ private: QList<Build *> makefiles; void clearBuilds(); MakefileGenerator *processBuild(const ProString &); + void accumulateVariableFromBuilds(const ProKey &name, Build *build) const; public: @@ -95,9 +96,6 @@ BuildsMetaMakefileGenerator::init() if(builds.count() > 1 && Option::output.fileName() == "-") { use_single_build = true; warn_msg(WarnLogic, "Cannot direct to stdout when using multiple BUILDS."); - } else if(0 && !use_single_build && project->first("TEMPLATE") == "subdirs") { - use_single_build = true; - warn_msg(WarnLogic, "Cannot specify multiple builds with TEMPLATE subdirs."); } if(!use_single_build) { for(int i = 0; i < builds.count(); i++) { @@ -188,6 +186,7 @@ BuildsMetaMakefileGenerator::write() if(!build->makefile) { ret = false; } else if(build == glue) { + accumulateVariableFromBuilds("QMAKE_INTERNAL_INCLUDED_FILES", build); ret = build->makefile->writeProjectMakefile(); } else { ret = build->makefile->write(); @@ -230,6 +229,16 @@ MakefileGenerator return nullptr; } +void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &name, Build *dst) const +{ + ProStringList &values = dst->makefile->projectFile()->values(name); + for (auto build : makefiles) { + if (build != dst) + values += build->makefile->projectFile()->values(name); + } + values.removeDuplicates(); +} + class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator { protected: @@ -327,17 +336,13 @@ SubdirsMetaMakefileGenerator::init() hasError |= tmpError; } sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name); - if(0 && sub->makefile->type() == SUBDIRSMETATYPE) { - subs.append(sub); - } else { - const QString output_name = Option::output.fileName(); - Option::output.setFileName(sub->output_file); - hasError |= !sub->makefile->write(); - delete sub; - qmakeClearCaches(); - sub = nullptr; - Option::output.setFileName(output_name); - } + const QString output_name = Option::output.fileName(); + Option::output.setFileName(sub->output_file); + hasError |= !sub->makefile->write(); + delete sub; + qmakeClearCaches(); + sub = nullptr; + Option::output.setFileName(output_name); Option::output_dir = old_output_dir; qmake_setpwd(oldpwd); diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index ef55af365c..227dc8908a 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -497,21 +497,20 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) // Make sure we keep the dependency order of libraries lflags[arch].removeAll(opt); lflags[arch].append(opt); - } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) { - if (opt.length() > 10) { - opt = opt.mid(10).trimmed(); - } else { - opt = l.at(++lit); - if (opt.startsWith("-Xarch")) - opt = l.at(++lit); // The user has done the right thing and prefixed each part - } + } else if (target_mode == TARG_MAC_MODE + && (opt == "-framework" || opt == "-force_load")) { + // Handle space separated options + ProString dashOpt = opt; + opt = l.at(++lit); + if (opt.startsWith("-Xarch")) + opt = l.at(++lit); // The user has done the right thing and prefixed each part for(int x = 0; x < lflags[arch].size(); ++x) { - if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) { + if (lflags[arch].at(x) == dashOpt && lflags[arch].at(++x) == opt) { lflags[arch].remove(x - 1, 2); break; } } - lflags[arch].append("-framework"); + lflags[arch].append(dashOpt); lflags[arch].append(opt); } else { lflags[arch].append(opt); diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index 901419d3cc..79b161f6da 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -42,7 +42,6 @@ class UnixMakefileGenerator : public MakefileGenerator protected: virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); } - bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } #ifdef Q_OS_WIN // MinGW x-compiling for QNX QString installRoot() const override; #endif diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index c8efd0680b..8d1bd08197 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -66,8 +66,6 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t) if (project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib" || project->first("TEMPLATE") == "aux") { - if(Option::mkfile::do_stub_makefile && MakefileGenerator::writeStubMakefile(t)) - return true; writeMakeParts(t); return MakefileGenerator::writeMakefile(t); } else if (project->first("TEMPLATE") == "subdirs") { diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 6f80b93307..40114948c2 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -93,18 +93,6 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t) project->first("TEMPLATE") == "aux") { if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") writePkgConfigFile(); - - if(Option::mkfile::do_stub_makefile) { - t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl; - const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); - for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) - t << escapeDependencyPath(*it) << ' '; - t << "first all clean install distclean uninstall: qmake\n" - << "qmake_all:\n"; - writeMakeQmake(t); - t << "FORCE:\n\n"; - return true; - } writeMingwParts(t); return MakefileGenerator::writeMakefile(t); } @@ -127,7 +115,7 @@ QString MingwMakefileGenerator::installRoot() const return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)"); } -void createLdResponseFile(const QString &fileName, const ProStringList &objList) +static void createResponseFile(const QString &fileName, const ProStringList &objList) { QString filePath = Option::output_dir + QDir::separator() + fileName; QFile file(filePath); @@ -151,23 +139,6 @@ void createLdResponseFile(const QString &fileName, const ProStringList &objList) } } -void createArObjectScriptFile(const QString &fileName, const QString &target, const ProStringList &objList) -{ - QString filePath = Option::output_dir + QDir::separator() + fileName; - QFile file(filePath); - if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { - QTextStream t(&file); - // ### quoting? - t << "CREATE " << target << Qt::endl; - for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { - t << "ADDMOD " << *it << Qt::endl; - } - t << "SAVE\n"; - t.flush(); - file.close(); - } -} - void MingwMakefileGenerator::writeMingwParts(QTextStream &t) { writeStandardParts(t); @@ -294,26 +265,25 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t) if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) { objectsLinkLine = "$(OBJECTS)"; } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { - QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); + QString ar_response_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); if (!var("BUILD_NAME").isEmpty()) { - ar_script_file += "." + var("BUILD_NAME"); + ar_response_file += "." + var("BUILD_NAME"); } if (!var("MAKEFILE").isEmpty()) - ar_script_file += "." + var("MAKEFILE"); + ar_response_file += "." + var("MAKEFILE"); // QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix. - // Strip off any options since the ar commands will be read from file. - QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0); + QString ar_cmd = var("QMAKE_LIB"); if (ar_cmd.isEmpty()) - ar_cmd = "ar"; - createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS")); - objectsLinkLine = ar_cmd + " -M < " + escapeFilePath(ar_script_file); + ar_cmd = "ar -rc"; + createResponseFile(ar_response_file, project->values("OBJECTS")); + objectsLinkLine = ar_cmd + ' ' + var("DEST_TARGET") + " @" + escapeFilePath(ar_response_file); } else { QString ld_response_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); if (!var("BUILD_NAME").isEmpty()) ld_response_file += "." + var("BUILD_NAME"); if (!var("MAKEFILE").isEmpty()) ld_response_file += "." + var("MAKEFILE"); - createLdResponseFile(ld_response_file, project->values("OBJECTS")); + createResponseFile(ld_response_file, project->values("OBJECTS")); objectsLinkLine = "@" + escapeFilePath(ld_response_file); } Win32MakefileGenerator::writeObjectsPart(t); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 1f6223f01d..67b478ae28 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -48,10 +48,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib" || project->first("TEMPLATE") == "aux") { -#if 0 - if(Option::mkfile::do_stub_makefile) - return MakefileGenerator::writeStubMakefile(t); -#endif writeNmakeParts(t); return MakefileGenerator::writeMakefile(t); } diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index 41bed69f00..9330c2b1bf 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -238,7 +238,7 @@ ProString &ProString::append(const ProString &other, bool *pending) QChar *ptr; if (pending && !*pending) { ptr = prepareExtend(1 + other.m_length, 0, m_length); - *ptr++ = 32; + *ptr++ = QLatin1Char(' '); } else { ptr = prepareExtend(other.m_length, 0, m_length); } @@ -276,7 +276,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski QChar *ptr = prepareExtend(totalLength, 0, m_length); for (int i = startIdx; i < sz; ++i) { if (putSpace) - *ptr++ = 32; + *ptr++ = QLatin1Char(' '); else putSpace = true; const ProString &str = other.at(i); diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index cc65421556..4569d7c3ff 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -68,6 +68,7 @@ class ProString { public: ProString(); ProString(const ProString &other); + ProString &operator=(const ProString &) = default; PROITEM_EXPLICIT ProString(const QString &str); PROITEM_EXPLICIT ProString(const QStringRef &str); PROITEM_EXPLICIT ProString(const char *str); @@ -432,11 +433,12 @@ public: ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } ProFunctionDef(ProFunctionDef &&other) noexcept : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; } - ~ProFunctionDef() { m_pro->deref(); } + ~ProFunctionDef() { if (m_pro) m_pro->deref(); } ProFunctionDef &operator=(const ProFunctionDef &o) { if (this != &o) { - m_pro->deref(); + if (m_pro) + m_pro->deref(); m_pro = o.m_pro; m_pro->ref(); m_offset = o.m_offset; diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index ba617932ce..70897214b2 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1130,48 +1130,35 @@ bool QMakeEvaluator::prepareProject(const QString &inDir) } superdir = qdfi.path(); } + QString sdir = inDir; QString dir = m_outputDir; forever { + conffile = sdir + QLatin1String("/.qmake.conf"); + if (!m_vfs->exists(conffile, flags)) + conffile.clear(); cachefile = dir + QLatin1String("/.qmake.cache"); if (!m_vfs->exists(cachefile, flags)) cachefile.clear(); - if (!cachefile.isEmpty()) { + if (!conffile.isEmpty() || !cachefile.isEmpty()) { + if (dir != sdir) + m_sourceRoot = sdir; m_buildRoot = dir; break; } if (dir == superdir) goto no_cache; - QFileInfo qdfi(dir); - if (qdfi.isRoot()) { - cachefile.clear(); - break; - } - dir = qdfi.path(); - } - QString sdir = inDir; - forever { - conffile = sdir + QLatin1String("/.qmake.conf"); - if (!m_vfs->exists(conffile, flags)) - conffile.clear(); - if (!conffile.isEmpty()) { - if (sdir != m_buildRoot) - m_sourceRoot = sdir; - break; - } QFileInfo qsdfi(sdir); - if (qsdfi.isRoot()) { - conffile.clear(); - break; - } + QFileInfo qdfi(dir); + if (qsdfi.isRoot() || qdfi.isRoot()) + goto no_cache; sdir = qsdfi.path(); + dir = qdfi.path(); } } else { m_buildRoot = QFileInfo(cachefile).path(); } - if (!conffile.isEmpty()) - m_conffile = QDir::cleanPath(conffile); - if (!cachefile.isEmpty()) - m_cachefile = QDir::cleanPath(cachefile); + m_conffile = QDir::cleanPath(conffile); + m_cachefile = QDir::cleanPath(cachefile); } no_cache: @@ -1583,8 +1570,8 @@ void QMakeEvaluator::updateFeaturePaths() } for (int i = 0; i < feature_roots.count(); ++i) - if (!feature_roots.at(i).endsWith((ushort)'/')) - feature_roots[i].append((ushort)'/'); + if (!feature_roots.at(i).endsWith(QLatin1Char('/'))) + feature_roots[i].append(QLatin1Char('/')); feature_roots.removeDuplicates(); diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 4c8360b459..ffe90ebda7 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -621,7 +621,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar if (c != term) { parseError(fL1S("Missing %1 terminator [found %2]") .arg(QChar(term)) - .arg(c ? QString(c) : QString::fromLatin1("end-of-line"))); + .arg(c ? QString(QChar(c)) : QString::fromLatin1("end-of-line"))); m_inError = true; // Just parse on, as if there was a terminator ... } else { diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h index 7b96d4e88f..c8c5c7718e 100644 --- a/qmake/library/qmakeparser.h +++ b/qmake/library/qmakeparser.h @@ -111,7 +111,6 @@ private: struct BlockScope { BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {} - BlockScope(const BlockScope &other) { *this = other; } ushort *start; // Where this block started; store length here int braceLevel; // Nesting of braces in scope bool special; // Single-line conditionals inside loops, etc. cannot have else branches diff --git a/qmake/option.cpp b/qmake/option.cpp index dcebeadcb8..1e31ecd6b7 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -93,7 +93,6 @@ bool Option::mkfile::do_deps = true; bool Option::mkfile::do_mocs = true; bool Option::mkfile::do_dep_heuristics = true; bool Option::mkfile::do_preprocess = false; -bool Option::mkfile::do_stub_makefile = false; QStringList Option::mkfile::project_files; static Option::QMAKE_MODE default_mode(QString progname) @@ -254,8 +253,6 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state) Option::mkfile::do_deps = false; } else if (arg == "-nomoc") { Option::mkfile::do_mocs = false; - } else if (arg == "-createstub") { - Option::mkfile::do_stub_makefile = true; } else if (arg == "-nodependheuristics") { Option::mkfile::do_dep_heuristics = false; } else if (arg == "-E") { diff --git a/qmake/option.h b/qmake/option.h index 25b2d64aaa..d7f4e87c70 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -189,7 +189,6 @@ struct Option static bool do_mocs; static bool do_dep_heuristics; static bool do_preprocess; - static bool do_stub_makefile; static int cachefile_depth; static QStringList project_files; }; |