示例#1
0
        private void GenerateProjectConfiguration(Project project)
        {
            string projectGuid = projectGuidManagement.GetGuid(project).ToString("B").ToUpperInvariant();
            string platform    = projectPlatformManagement.GetDefaultPlatform(project);

            output.WriteLine("\t\t{0}.Bari|Bari.ActiveCfg = Bari|{1}", projectGuid, platform);
            output.WriteLine("\t\t{0}.Bari|Bari.Build.0 = Bari|{1}", projectGuid, platform);
        }
示例#2
0
        public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context)
        {
            var platform = platformManagement.GetDefaultPlatform(project);
            var cliMode  = project.GetCLIMode();

            writer.WriteStartElement("ItemGroup");
            writer.WriteAttributeString("Label", "ProjectConfigurations");
            writer.WriteStartElement("ProjectConfiguration");
            writer.WriteAttributeString("Include", string.Format("Bari|{0}", platform));
            writer.WriteElementString("Configuration", "Bari");
            writer.WriteElementString("Platform", platform);
            writer.WriteEndElement();
            writer.WriteEndElement();

            writer.WriteStartElement("PropertyGroup");
            writer.WriteAttributeString("Label", "Globals");
            writer.WriteElementString("ProjectGuid", projectGuidManagement.GetGuid(project).ToString("B"));

            if (cliMode == CppCliMode.Disabled)
            {
                writer.WriteElementString("Keyword", "Win32Proj");
            }
            else
            {
                VCppProjectCompilerParameters compilerParameters = project.GetInheritableParameters <VCppProjectCompilerParameters, VCppProjectCompilerParametersDef>("cpp-compiler");
                compilerParameters.WriteGlobalProperties(writer);

                writer.WriteElementString("Keyword", "ManagedCProj");
                writer.WriteElementString("RootNamespace", project.Name);
            }

            writer.WriteEndElement();

            writer.WriteStartElement("PropertyGroup");
            writer.WriteAttributeString("Condition", string.Format("'$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
            writer.WriteAttributeString("Label", "Configuration");
            WriteHighLevelConfigurationSpecificPart(writer, project);
            writer.WriteEndElement();

            writer.WriteStartElement("Import");
            writer.WriteAttributeString("Project", @"$(VCTargetsPath)\Microsoft.Cpp.props");
            writer.WriteEndElement();

            writer.WriteStartElement("PropertyGroup");
            writer.WriteAttributeString("Condition", string.Format("'$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
            WriteConfigurationSpecificPart(writer, project);
            writer.WriteEndElement();

            writer.WriteStartElement("ItemDefinitionGroup");
            writer.WriteAttributeString("Condition", string.Format(" '$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
            WriteMIDLParameters(writer, project);
            WriteCompilerParameters(writer, project);
            WriteLinkerParameters(writer, project);
            WriteManifestParameters(writer, project);
            WriteResourceCompilerParameters(writer, project);
            writer.WriteEndElement();
        }
        public string GetDefaultPlatform(Project project)
        {
            var suite = project.Module.Suite;

            if (project.HasNonEmptySourceSet("cpp"))
            {
                return(suite.ActiveGoal.Has("x64") ? "x64" : "Win32");
            }
            else
            {
                return(baseImpl.GetDefaultPlatform(project));
            }
        }
示例#4
0
        /// <summary>
        /// Provides the ability to add extra content to a given project source file
        /// </summary>
        /// <param name="writer">The project file writer</param>
        /// <param name="project">Project model</param>
        /// <param name="suiteRelativePath">Suite relative path of the source item</param>
        protected override void WriteAdditionalOptions(XmlWriter writer, Project project, SuiteRelativePath suiteRelativePath)
        {
            base.WriteAdditionalOptions(writer, project, suiteRelativePath);

            var projectRelativePath = ToProjectRelativePath(project, suiteRelativePath, ProjectSourceSetName);

            if (projectRelativePath == "stdafx.cpp")
            {
                var platform = platformManagement.GetDefaultPlatform(project);

                writer.WriteStartElement("PrecompiledHeader");
                writer.WriteAttributeString("Condition", string.Format("'$(Configuration)|$(Platform)' == 'Bari|{0}' ", platform));
                writer.WriteString("Create");
                writer.WriteEndElement();
            }
        }