Ejemplo n.º 1
0
        public static string GetLLVMOverridesSection(IVcxprojGenerationContext context, Resolver resolver)
        {
            if (Settings.OverridenLLVMInstallDir)
            {
                var allPlatformToolsets = context.ProjectConfigurations.Select(Options.GetObject <Options.Vc.General.PlatformToolset>);
                var llvmToolsets        = allPlatformToolsets.Where(t => t.IsLLVMToolchain()).Distinct().ToList();
                if (llvmToolsets.Count > 0)
                {
                    if (llvmToolsets.Count == 1)
                    {
                        if (context.DevelopmentEnvironmentsRange.MinDevEnv != context.DevelopmentEnvironmentsRange.MaxDevEnv)
                        {
                            throw new Error("Different vs versions not supported in the same vcxproj");
                        }
                        var devEnv = context.DevelopmentEnvironmentsRange.MinDevEnv;

                        var llvmInstallDir = llvmToolsets[0] == Options.Vc.General.PlatformToolset.ClangCL ? Settings.LLVMInstallDirVsEmbedded(devEnv) : Settings.LLVMInstallDir;
                        using (resolver.NewScopedParameter("custompropertyname", "LLVMInstallDir"))
                            using (resolver.NewScopedParameter("custompropertyvalue", llvmInstallDir.TrimEnd(Util._pathSeparators))) // trailing separator will be added by LLVM.Cpp.Common.props
                                return(resolver.Resolve(Vcxproj.Template.Project.CustomProperty));
                    }
                    else
                    {
                        throw new Error("Varying llvm platform toolsets in the same vcxproj file! That's not supported");
                    }
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
 public string Resolve(Resolver resolver, string customTemplate)
 {
     using (resolver.NewScopedParameter("packageName", Name))
         using (resolver.NewScopedParameter("packageVersion", Version))
         {
             return(resolver.Resolve(customTemplate));
         }
 }
Ejemplo n.º 3
0
        public static string GetLLVMOverridesSection(IVcxprojGenerationContext context, Resolver resolver)
        {
            if (Settings.OverridenLLVMInstallDir)
            {
                bool hasClangConfiguration = context.ProjectConfigurations.Any(conf => Options.GetObject <Options.Vc.General.PlatformToolset>(conf).IsLLVMToolchain());

                if (hasClangConfiguration)
                {
                    using (resolver.NewScopedParameter("custompropertyname", "LLVMInstallDir"))
                        using (resolver.NewScopedParameter("custompropertyvalue", Settings.LLVMInstallDir.TrimEnd(Util._pathSeparators))) // trailing separator will be added by LLVM.Cpp.Common.props
                            return(resolver.Resolve(Vcxproj.Template.Project.CustomProperty));
                }
            }

            return(null);
        }
Ejemplo n.º 4
0
 public string Resolve(Resolver resolver)
 {
     using (resolver.NewScopedParameter("packageName", Name))
         using (resolver.NewScopedParameter("packageVersion", Version))
         {
             if (PrivateAssets == DefaultPrivateAssets)
             {
                 return(resolver.Resolve($"{TemplateBeginPackageReference} />\n"));
             }
             else
             {
                 using (resolver.NewScopedParameter("privateAssets", string.Join(";", GetFormatedAssetsDependency(PrivateAssets))))
                     return(resolver.Resolve($"{TemplateBeginPackageReference}>\n{TemplatePackagePrivateAssets}{TemplateEndPackageReference}"));
             }
         }
 }