From ae52bba5d441ea5fa1a56b956e90e00e2f688765 Mon Sep 17 00:00:00 2001 From: Chris Gilbert Date: Thu, 24 Oct 2013 13:52:14 -0700 Subject: Fix msvc project dependencies as specificed by .depends Previously, the full path to the qmake project file was specified as the key for projGuids when inserting the project GUID into this hash table. The only place that items are inserted into projGuids is in VcprojGenerator::collectDependencies at: projGuids.insert(val.first, newDep->target); In this case, val.first contains the full path for the given project being processed at this point. (e.g.: c:\testproject\testproject.pro) Further in sln/vcproj generation, projGuids is queried with the contents of .depends so that users may specify another qmake project as a dependency for a given target. This occurs in two places, in two ways: 1) In VcprojGenerator::collectDependencies() at: QString depend = dep.toQString(); if (!projGuids[depend].isEmpty()) { ... In this case QString depend contains whatever is put into .depends. Typically this is the plain name of the project you depend on. (e.g.: testproj) 2) In VcprojGenerator::writeSubDirs(QTextStream &t) by proxy of extraSubdirs which is a QStringList of the project depends should the mapping in case 1 fail. This case works much like the above case, attempting to use each QString entry of the extraSubdirs list as a key in projGuids. If either of the above two attempts are successful, the msvc solution is configured in a way that creates a project dependency, ensuring correct compilation order and other related behavior. The fix here stores the target project (e.g.: testproject) as opposed to the full project path, as that is what is expected in the .depends statements contained in the qmake project. Change-Id: Iee05661a64d7a3e4467c5ade48d801fbbfe981b5 Reviewed-by: Andy Shaw Reviewed-by: Chris Gilbert --- qmake/generators/win32/msvc_vcproj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index a30129fa27..8a5c5b7032 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -514,7 +514,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHashtarget.endsWith(".dll")) newDep->target = newDep->target.left(newDep->target.length()-3) + "lib"; - projGuids.insert(val.first, newDep->target); + projGuids.insert(newDep->orig_target, newDep->target); if (val.second.size()) { const ProStringList depends = val.second; -- cgit v1.2.3