Bugs item #1124296, was opened at 2005-02-16 22:34 Message generated for change (Comment added) made by drieseng You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1124296&group_id=31650
Category: Tasks Group: 0.85 Status: Open Resolution: None Priority: 5 Submitted By: Scott Hunter (huntes) Assigned to: Nobody/Anonymous (nobody) Summary: C++ Solution task does not link against Project Dependencies Initial Comment: It seems that when building a C++ solution with the <solution> task, the Project Dependencies are not being included in the link command. VC++ itself builds the solution fine, and includes the other project's lib files in the linker line (if I look at Command Line in the properties for the executable project) It looks like someone else had this problem and provided the appropriate fix here: http://www.mail-archive.com/nant-developers@lists.sourceforge.net/msg05097.html but the part dealing with project dependencies doesn't seem to have made it into the code. I get the same results with 0.85 RC2 and with the latest nightly (2/8/2005). ---------------------------------------------------------------------- >Comment By: Gert Driesen (drieseng) Date: 2005-04-10 18:56 Message: Logged In: YES user_id=707851 Can you attach a repro for this issue covering as much corner cases as possible ? Thanks ! ---------------------------------------------------------------------- Comment By: Henry (henryl) Date: 2005-03-30 17:48 Message: Logged In: YES user_id=1083163 I've made the following patch. Seems to work for me, but it will have issues if a dependent project is also added as an input. Not very tested; I've only used it on the one solution. diff -u -r src/NAnt.VSNet/ProjectBase.cs src/NAnt.VSNet/ProjectBase.cs --- src/NAnt.VSNet/ProjectBase.cs 2005-01-29 15:58:06.000000000 +0000 +++ src/NAnt.VSNet/ProjectBase.cs 2005-03-30 15:52:07.866501100 +0100 @@ -66,6 +66,8 @@ _buildConfigurations = CollectionsUtil.CreateCaseInsensitiveHashtable(); _extraOutputFiles = CollectionsUtil.CreateCaseInsensitiveHashtable(); + _dependencyOutputs = new ArrayList(); + // ensure the specified project is actually supported by this project VerifyProjectXml(xmlDefinition); @@ -187,6 +189,17 @@ get; } + /// <summary> + /// Outputs of upstream dependencies + /// </summary> + public ArrayList DependencyOutputs + { + get + { + return _dependencyOutputs; + } + } + public SolutionTask SolutionTask { get { return _solutionTask; } } @@ -707,6 +720,7 @@ private GacCache _gacCache; private ReferencesResolver _refResolver; private Hashtable _extraOutputFiles; + private ArrayList _dependencyOutputs; #endregion Private Instance Fields } diff -u -r src/NAnt.VSNet/SolutionBase.cs src/NAnt.VSNet/SolutionBase.cs --- src/NAnt.VSNet/SolutionBase.cs 2005-01-31 21:44:08.000000000 +0000 +++ src/NAnt.VSNet/SolutionBase.cs 2005-03-30 16:09:14.952446000 +0100 @@ -447,6 +467,15 @@ } } } + + // Add all of the output files of dependencies as files + foreach (ProjectBase project in _htProjects.Values) + { + foreach (string dependencyGuid in GetProjectDependencies(project.Guid)) + { + project.DependencyOutputs.AddRange(GetProjectFromGuid(dependencyGuid).GetOutputFiles(buildConfig).Keys); + } + } } /// <summary> diff -u -r src/NAnt.VSNet/VcProject.cs src/NAnt.VSNet/VcProject.cs --- src/NAnt.VSNet/VcProject.cs 2005-01-31 21:46:20.000000000 +0000 +++ src/NAnt.VSNet/VcProject.cs 2005-03-30 15:54:46.930153700 +0100 @@ -1264,6 +1264,12 @@ } } + // Add all upstream dependency outputs + foreach (string dependency in DependencyOutputs) + { + linkTask.Sources.FileNames.Add(dependency); + } + foreach (string defaultLib in _defaultLibraries) { linkTask.Sources.FileNames.Add(defaultLib); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1124296&group_id=31650 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers