summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:37:06 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-24 13:39:13 +0100
commit34aba4724f196e34ed02cf50073f41968f119bb6 (patch)
tree0ebdfcabda989ab76ee6de53c6461553c7a767a5 /qmake
parentb86b2a742afae118bf974c82ba966ddb0cae4afb (diff)
parentb1cf07f495e10c93e53651ac03e46ebdaea0a97e (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp59
-rw-r--r--qmake/generators/unix/unixmake2.cpp22
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp16
-rw-r--r--qmake/library/proitems.cpp4
4 files changed, 66 insertions, 35 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 3659621391..0ff42500de 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1029,6 +1029,21 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty("QMAKE_PRE_LINK")) {
QString phase_key = keyFor("QMAKE_PBX_PRELINK_BUILDPHASE");
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
+
+ ProStringList inputPaths;
+ ProStringList outputPaths;
+ const ProStringList &archs = project->values("QMAKE_XCODE_ARCHS");
+ if (!archs.isEmpty()) {
+ for (int i = 0; i < archs.size(); ++i) {
+ const ProString &arch = archs.at(i);
+ inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/" + arch + "/";
+ outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_" + arch + ")";
+ }
+ } else {
+ inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/";
+ outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))";
+ }
+
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("files", ProStringList(), SettingsAsList, 4) << ";\n"
@@ -1036,8 +1051,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// resolved dependenices, so we have to ensure that this phase is run after the
// compilation phase, and before the link phase. Making the phase depend on the
// object file directory, and "write" to the list of files to link achieves that.
- << "\t\t\t" << writeSettings("inputPaths", ProStringList("$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/$(CURRENT_ARCH)/"), SettingsAsList, 4) << ";\n"
- << "\t\t\t" << writeSettings("outputPaths", ProStringList("$(LINK_FILE_LIST_$(CURRENT_VARIANT)_$(CURRENT_ARCH))"), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("inputPaths", inputPaths, SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("outputPaths", outputPaths, SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Prelink") << ";\n"
@@ -1107,9 +1122,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("shellScript", fixForOutput("cp -r $BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME " + escapeFilePath(destDir))) << ";\n"
<< "\t\t};\n";
}
+ bool copyBundleResources = project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app";
+ ProStringList bundle_resources_files;
// Copy Bundle Data
if (!project->isEmpty("QMAKE_BUNDLE_DATA")) {
ProStringList bundle_file_refs;
+ bool ios = project->isActiveConfig("ios");
//all bundle data
const ProStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA");
@@ -1137,21 +1155,27 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t};\n";
}
- QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]);
- if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
- //###
- }
+ if (copyBundleResources && ((ios && path.isEmpty())
+ || (!ios && path == QLatin1String("Contents/Resources")))) {
+ foreach (const ProString &s, bundle_files)
+ bundle_resources_files << s;
+ } else {
+ QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]);
+ if (!project->isEmpty(ProKey(bundle_data[i] + ".version"))) {
+ //###
+ }
- project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
- t << "\t\t" << phase_key << " = {\n"
- << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
- << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
- << "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n"
- << "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n"
- << "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n"
- << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
- << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
- << "\t\t};\n";
+ project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
+ t << "\t\t" << phase_key << " = {\n"
+ << "\t\t\t" << writeSettings("name", "Copy '" + bundle_data[i] + "' Files to Bundle") << ";\n"
+ << "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("dstPath", escapeFilePath(path)) << ";\n"
+ << "\t\t\t" << writeSettings("dstSubfolderSpec", "1", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("isa", "PBXCopyFilesBuildPhase", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("files", bundle_files, SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
+ << "\t\t};\n";
+ }
}
QString bundle_data_key = keyFor("QMAKE_PBX_BUNDLE_DATA");
@@ -1166,8 +1190,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
// Copy bundle resources. Optimizes resources, and puts them into the Resources
// subdirectory on OSX, but doesn't support paths.
- if (project->isActiveConfig("app_bundle") && project->first("TEMPLATE") == "app") {
- ProStringList bundle_resources_files;
+ if (copyBundleResources) {
if (!project->isEmpty("ICON")) {
ProString icon = project->first("ICON");
if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0)))
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d9b0e10057..8270f02feb 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -814,22 +814,26 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" ";
+
+ QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
+ if (bundlePrefix.isEmpty())
+ bundlePrefix = "com.yourcompany";
+ if (bundlePrefix.endsWith("."))
+ bundlePrefix.chop(1);
+ QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
+ if (bundleIdentifier.endsWith(".app"))
+ bundleIdentifier.chop(4);
+ if (bundleIdentifier.endsWith(".framework"))
+ bundleIdentifier.chop(10);
+ commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
+
if (isApp) {
QString icon = fileFixify(var("ICON"));
- QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
- if (bundlePrefix.isEmpty())
- bundlePrefix = "com.yourcompany";
- if (bundlePrefix.endsWith("."))
- bundlePrefix.chop(1);
- QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
- if (bundleIdentifier.endsWith(".app"))
- bundleIdentifier.chop(4);
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
foreach (const ProString &arg, commonSedArgs)
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
- << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index f2d55d481d..4ddb76032e 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE
const char _CLCompile[] = "ClCompile";
const char _ItemGroup[] = "ItemGroup";
const char _Link[] = "Link";
+const char _Lib[] = "Lib";
const char _ManifestTool[] = "ManifestTool";
const char _Midl[] = "Midl";
const char _ResourceCompile[] = "ResourceCompile";
@@ -757,8 +758,11 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
// ClCompile
write(xml, config.compiler);
- // Link
- write(xml, config.linker);
+ // Librarian / Linker
+ if (config.ConfigurationType == typeStaticLibrary)
+ write(xml, config.librarian);
+ else
+ write(xml, config.linker);
// Midl
write(xml, config.idl);
@@ -1686,7 +1690,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool)
void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool)
{
xml
- << tag(_Link)
+ << tag(_Lib)
<< attrTagX(_AdditionalDependencies, tool.AdditionalDependencies, ";")
<< attrTagX(_AdditionalLibraryDirectories, tool.AdditionalLibraryDirectories, ";")
<< attrTagX(_AdditionalOptions, tool.AdditionalOptions, " ")
@@ -1706,7 +1710,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLibrarianTool &tool)
//unused << attrTagS(_TargetMachine, tool.TargetMachine)
//unused << attrTagT(_TreatLibWarningAsErrors, tool.TreatLibWarningAsErrors)
//unused << attrTagT(_Verbose, tool.Verbose)
- << closetag(_Link);
+ << closetag(_Lib);
}
void VCXProjectWriter::write(XmlOutput &xml, const VCResourceCompilerTool &tool)
@@ -1911,10 +1915,10 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
}
// Actual XML output ----------------------------------
- if (hasCustomBuildStep || filter.useCompilerTool
+ if (hasCustomBuildStep || filter.useCustomBuildTool || filter.useCompilerTool
|| !d->inBuild || filter.Name.startsWith("Deployment Files")) {
- if (hasCustomBuildStep)
+ if (hasCustomBuildStep || filter.useCustomBuildTool)
{
if (!fileAdded) {
fileAdded = true;
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index e4dc840b22..97cc590d84 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -416,8 +416,8 @@ QStringList ProStringList::toQStringList() const
{
QStringList ret;
ret.reserve(size());
- foreach (const ProString &str, *this)
- ret << str.toQString();
+ for (int i = 0; i < size(); i++) // foreach causes MSVC2010 ICE
+ ret << at(i).toQString();
return ret;
}