Ejemplo n.º 1
0
        private void AddHeaderFiles(Project project)
        {
            var dir = SpecDirectory.ToString(Context.PathTable);

            foreach (var headerFile in System.IO.Directory.GetFiles(dir, "*.h"))
            {
                project.AddItem("ClInclude", AbsolutePath.Create(Context.PathTable, headerFile));
            }
        }
Ejemplo n.º 2
0
        internal void AddSourceItem(AbsolutePath path, Project project, string tag)
        {
            var item = project.AddItem(tag, path);

            if (!Context.CanWriteToSrc)
            {
                // We only need link if the file goes outside of the projects cone.
                // If the item path and the link are the same path. VisualStudio will not render the file in the project tree.
                RelativePath relativePath;
                if (SpecDirectory.TryGetRelative(Context.PathTable, path, out relativePath) && relativePath.GetAtoms().Length > 1)
                {
                    item.SetMetadata("Link", relativePath.ToString(Context.StringTable));
                }
            }
        }