#304 C++ Solution task does not link against Project Dependencies

0.85
closed-fixed
Tasks (408)
5
2005-05-29
2005-02-16
No

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).

Discussion

  • Henry

    Henry - 2005-03-30

    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);
    }

     
  • Gert Driesen

    Gert Driesen - 2005-04-10

    Logged In: YES
    user_id=707851

    Can you attach a repro for this issue covering as much
    corner cases as possible ?

    Thanks !

     
  • Gert Driesen

    Gert Driesen - 2005-05-29
    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed
     
  • Gert Driesen

    Gert Driesen - 2005-05-29

    Logged In: YES
    user_id=707851

    This is now fixed in cvs.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks