From d8f940930e0dbcea4ee136550b4ca5a38f03b1dc Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 20 Oct 2014 14:40:15 +0200 Subject: vcxproj: fix writing of librarian settings The settings of the librarian were never written. Creation of static libraries only worked by accident. Adapted the code from the vcproj code path. Task-number: QTBUG-30712 Change-Id: I69917f44305eb458647392d222db477fe5a5b7c8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann Reviewed-by: Andy Shaw --- qmake/generators/win32/msbuild_objectmodel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 5fdfc52dba..1ca2c3ae41 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -54,6 +54,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"; @@ -754,8 +755,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); @@ -1683,7 +1687,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, " ") @@ -1703,7 +1707,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) -- cgit v1.2.3 From 87eb3ea1904756362ce5474838b25b5b00193dc5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 20 Oct 2014 20:43:48 +0200 Subject: work around MSVC2010 ICE Task-number: QTBUG-42064 Change-Id: Ifffcc0cf9109b76d79f603a13792d7fd9979761c Reviewed-by: Joerg Bornemann --- qmake/library/proitems.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake') 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; } -- cgit v1.2.3 From af5f6e35b6f17e06a85aee445d97e61b6b4bba3e Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Wed, 22 Oct 2014 17:37:02 +0200 Subject: xcodegenerator: use a copy resource phase if possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commmit 0127962e4772d6c758b954b2fe1d4b676d366b4c the PBXResourcesBuildPhase is used only for ICONS, because the old behavior of using it when target path is not given differed from the documentation and behavior of the makefile generator by using Contents/Resources as target directory when targeting osx. The PBXResouceBuildPhase optimizes png, compiles xib or asset catalogs and copies the rest. The advantage is that it makes it easy to add resources to the bundle, the only problem is that the target directory is always the resource directory. The copy operation currently used does not compile resources, which makes adding .xib (for the Launch File required to support iphone 6) and asset catalogs difficult. So we restore the old 5.3 behavior for ios, and use the build resources phase when possible on osx (target Contents/Resources). On osx this still implies a difference between the makefile generator and the xcode generator: only the latter compiles resources. Change-Id: Id1853693e88fc46562b044efdea2bf5f9da2c98c Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 40 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 3659621391..4624496e99 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1107,9 +1107,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 +1140,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 +1175,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))) -- cgit v1.2.3 From ade8e0fc9b216190328b6fd3375796e82e34c323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 14 Oct 2014 15:05:23 +0200 Subject: Add CFBundleIdentifier to the bundle Info.plist's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor the current app CFBundleIdentifier support: handle frameworks as well. Add @BUNDLEIDENTIFIER@ placeholder to the OS X info.plist.lib templates. This means the Qt frameworks will now get a valid CFBundleIdentifier entry the same way as app bundles: by extracting the identifier prefix from Xcode settings and appending framework name. Task-number: QTBUG-32896 Change-Id: Ica8f28332a88e37a823c46fca7a2c373157af020 Reviewed-by: Tor Arne Vestbø Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'qmake') 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\" " -- cgit v1.2.3 From 91e53a7b9cb30e330c86c8bc460159fe14945042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 6 Nov 2014 16:11:01 +0100 Subject: Xcode: Make sure QMAKE_PRE_LINK dependencies are complete for multi-arch builds With multi-architecture builds and ONLY_ACTIVE_ARCH set to NO, Xcode will build the final target for multiple architectures at the same time, but CURRENT_ARCH will only match one of them, so we failed to set up the right dependencies for our pre-link step, causing the step to happen after linking in some cases. We now build an exhaustive dependency list based on QMAKE_XCODE_ARCHS, so that ONLY_ACTIVE_ARCH=NO can be used for release builds targeted at the App Store. Change-Id: I6702f020a6970807adc624779f6dde09be62beb9 Reviewed-by: Andy Shaw --- qmake/generators/mac/pbuilder_pbx.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 4624496e99..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" -- cgit v1.2.3 From 5c58db516a55d4f6a5e5899617505898ce7bd969 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 12 Nov 2014 13:55:25 +0100 Subject: Add the custom build step for PCH generated through source This fixes a regression introduced by 04d3a89e20d49a3b5015b071bfdedc81973b090c as it left out the custom build step for the source code file generated for PCH. Task-number: QTBUG-42596 Change-Id: I53d5a36b842dcffbde2657910e6a96dca0e99c7b Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 7effbaa8c4..1f51ff0342 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1915,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; -- cgit v1.2.3