Exemple #1
0
        public virtual IEnumerable <string> GetPlatformLibraryPaths(Project.Configuration configuration)
        {
            var    dirs            = new List <string>();
            var    dotnet          = Util.IsDotNet(configuration) ? configuration.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?);
            string platformDirsStr = configuration.Target.GetFragment <DevEnv>().GetWindowsLibraryPath(configuration.Target.GetPlatform(), dotnet);

            dirs.AddRange(EnumerateSemiColonSeparatedString(platformDirsStr));

            return(dirs);
        }
            public override IEnumerable <string> GetPlatformLibraryPaths(IGenerationContext context)
            {
                var    dirs            = new List <string>(base.GetPlatformLibraryPaths(context));
                var    dotnet          = Util.IsDotNet(context.Configuration) ? context.Configuration.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?);
                string platformDirsStr = context.DevelopmentEnvironment.GetWindowsLibraryPath(context.Configuration.Platform, dotnet);

                dirs.AddRange(EnumerateSemiColonSeparatedString(platformDirsStr));

                return(dirs);
            }
            public override void SetupSdkOptions(IGenerationContext context)
            {
                var options = context.Options;
                var conf    = context.Configuration;
                var devEnv  = context.DevelopmentEnvironment;

                bool clrSupport = Util.IsDotNet(conf);

                if (devEnv >= DevEnv.vs2012 && devEnv.OverridenWindowsPath())
                {
                    options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform);
                    options["IncludePath"]    = devEnv.GetWindowsIncludePath();
                    options["LibraryPath"]    = devEnv.GetWindowsLibraryPath(conf.Platform, clrSupport ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                    options["ExcludePath"]    = devEnv.GetWindowsIncludePath();
                }
            }
        public virtual IEnumerable <string> GetPlatformLibraryPaths(Project.Configuration configuration)
        {
            var dirs   = new List <string>();
            var dotnet = Util.IsDotNet(configuration) ? configuration.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?);

            var platformToolset = Options.GetObject <Options.Vc.General.PlatformToolset>(configuration);

            if (platformToolset.IsLLVMToolchain())
            {
                Options.Vc.General.PlatformToolset overridenPlatformToolset = Options.Vc.General.PlatformToolset.Default;
                if (Options.WithArgOption <Options.Vc.General.PlatformToolset> .Get <Options.Clang.Compiler.LLVMVcPlatformToolset>(configuration, ref overridenPlatformToolset))
                {
                    platformToolset = overridenPlatformToolset;
                }
            }

            var devEnv = platformToolset.GetDefaultDevEnvForToolset() ?? configuration.Target.GetFragment <DevEnv>();

            string platformDirsStr = devEnv.GetWindowsLibraryPath(configuration.Target.GetPlatform(), dotnet);

            dirs.AddRange(EnumerateSemiColonSeparatedString(platformDirsStr));

            return(dirs);
        }
            public override void SetupSdkOptions(IGenerationContext context)
            {
                var conf   = context.Configuration;
                var devEnv = context.DevelopmentEnvironment;

                // vs2012 and vs2013 do not support overriding windows kits using the underlying variables
                // so we need to change the VC++ directories path.
                // We need to override the executable path for vs2015 because WindowsKit UAP.props does not
                // correctly set the WindowsSDK_ExecutablePath to the bin folder of its current version.
                if ((devEnv == DevEnv.vs2012 || devEnv == DevEnv.vs2013 || devEnv == DevEnv.vs2015) && !KitsRootPaths.UsesDefaultKitRoot(devEnv))
                {
                    var options = context.Options;
                    options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (devEnv != DevEnv.vs2015)
                    {
                        options["IncludePath"] = devEnv.GetWindowsIncludePath();
                        options["LibraryPath"] = devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                        options["ExcludePath"] = devEnv.GetWindowsIncludePath();
                    }
                }

                var systemIncludes = new OrderableStrings(conf.DependenciesIncludeSystemPaths);

                systemIncludes.AddRange(conf.IncludeSystemPaths);
                if (systemIncludes.Count > 0)
                {
                    systemIncludes.Sort();
                    if (context.Options["IncludePath"] == FileGeneratorUtilities.RemoveLineTag)
                    {
                        context.Options["IncludePath"] = "$(VC_IncludePath);$(WindowsSDK_IncludePath);" + systemIncludes.JoinStrings(";");
                    }
                    else
                    {
                        context.Options["IncludePath"] += ";" + systemIncludes.JoinStrings(";");
                    }
                }
            }
Exemple #6
0
            public override void SetupSdkOptions(IGenerationContext context)
            {
                var conf   = context.Configuration;
                var devEnv = context.DevelopmentEnvironment;

                // We need to override the executable path for vs2015 because WindowsKit UAP.props does not
                // correctly set the WindowsSDK_ExecutablePath to the bin folder of its current version.
                if (devEnv == DevEnv.vs2015 && !KitsRootPaths.UsesDefaultKitRoot(devEnv))
                {
                    context.Options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform);
                }

                Options.Vc.General.PlatformToolset platformToolset = Options.GetObject <Options.Vc.General.PlatformToolset>(conf);
                if (Options.Vc.General.PlatformToolset.LLVM == platformToolset)
                {
                    Options.Vc.General.PlatformToolset overridenPlatformToolset = Options.Vc.General.PlatformToolset.Default;
                    if (Options.WithArgOption <Options.Vc.General.PlatformToolset> .Get <Options.Clang.Compiler.LLVMVcPlatformToolset>(conf, ref overridenPlatformToolset))
                    {
                        platformToolset = overridenPlatformToolset;
                    }

                    devEnv = platformToolset.GetDefaultDevEnvForToolset() ?? devEnv;

                    context.Options["ExecutablePath"] = ClangForWindows.GetWindowsClangExecutablePath() + ";" + devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (Options.GetObject <Options.Vc.LLVM.UseClangCl>(conf) == Options.Vc.LLVM.UseClangCl.Enable)
                    {
                        context.Options["IncludePath"] = ClangForWindows.GetWindowsClangIncludePath() + ";" + devEnv.GetWindowsIncludePath();
                        context.Options["LibraryPath"] = ClangForWindows.GetWindowsClangLibraryPath() + ";" + devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                    }
                }

                var systemIncludes = new OrderableStrings(conf.DependenciesIncludeSystemPaths);

                systemIncludes.AddRange(conf.IncludeSystemPaths);
                if (systemIncludes.Count > 0)
                {
                    systemIncludes.Sort();
                    string systemIncludesString = Util.PathGetRelative(context.ProjectDirectory, systemIncludes).JoinStrings(";");

                    // this option is mandatory when using /external:I with msvc, so if the user has selected it
                    // we consider that the vcxproj supports ExternalIncludePath
                    if (Options.HasOption <Options.Vc.General.ExternalWarningLevel>(conf))
                    {
                        if (context.Options["ExternalIncludePath"] == FileGeneratorUtilities.RemoveLineTag)
                        {
                            context.Options["ExternalIncludePath"] = systemIncludesString;
                        }
                        else
                        {
                            context.Options["ExternalIncludePath"] += ";" + systemIncludesString;
                        }
                    }
                    else
                    {
                        if (context.Options["IncludePath"] == FileGeneratorUtilities.RemoveLineTag)
                        {
                            context.Options["IncludePath"] = "$(VC_IncludePath);$(WindowsSDK_IncludePath);" + systemIncludesString;
                        }
                        else
                        {
                            context.Options["IncludePath"] += ";" + systemIncludesString;
                        }
                    }
                }
            }
            public override void SetupSdkOptions(IGenerationContext context)
            {
                var conf   = context.Configuration;
                var devEnv = context.DevelopmentEnvironment;

                // vs2012 and vs2013 do not support overriding windows kits using the underlying variables
                // so we need to change the VC++ directories path.
                // We need to override the executable path for vs2015 because WindowsKit UAP.props does not
                // correctly set the WindowsSDK_ExecutablePath to the bin folder of its current version.
                if ((devEnv == DevEnv.vs2012 || devEnv == DevEnv.vs2013 || devEnv == DevEnv.vs2015) && !KitsRootPaths.UsesDefaultKitRoot(devEnv))
                {
                    var options = context.Options;
                    options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (devEnv != DevEnv.vs2015)
                    {
                        options["IncludePath"] = devEnv.GetWindowsIncludePath();
                        options["LibraryPath"] = devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                        options["ExcludePath"] = devEnv.GetWindowsIncludePath();
                    }
                }

                Options.Vc.General.PlatformToolset platformToolset = Options.GetObject <Options.Vc.General.PlatformToolset>(conf);
                if (platformToolset.IsLLVMToolchain())
                {
                    Options.Vc.General.PlatformToolset overridenPlatformToolset = Options.Vc.General.PlatformToolset.Default;
                    if (Options.WithArgOption <Options.Vc.General.PlatformToolset> .Get <Options.Clang.Compiler.LLVMVcPlatformToolset>(conf, ref overridenPlatformToolset))
                    {
                        platformToolset = overridenPlatformToolset;
                    }

                    devEnv = platformToolset.GetDefaultDevEnvForToolset() ?? devEnv;

                    context.Options["ExecutablePath"] = ClangForWindows.GetWindowsClangExecutablePath() + ";" + devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (Options.GetObject <Options.Vc.LLVM.UseClangCl>(conf) == Options.Vc.LLVM.UseClangCl.Enable)
                    {
                        context.Options["IncludePath"] = ClangForWindows.GetWindowsClangIncludePath() + ";" + devEnv.GetWindowsIncludePath();
                        context.Options["LibraryPath"] = ClangForWindows.GetWindowsClangLibraryPath() + ";" + devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                    }
                }

                var systemIncludes = new OrderableStrings(conf.DependenciesIncludeSystemPaths);

                systemIncludes.AddRange(conf.IncludeSystemPaths);
                if (systemIncludes.Count > 0)
                {
                    systemIncludes.Sort();
                    if (context.Options["IncludePath"] == FileGeneratorUtilities.RemoveLineTag)
                    {
                        context.Options["IncludePath"] = "$(VC_IncludePath);$(WindowsSDK_IncludePath);" + systemIncludes.JoinStrings(";");
                    }
                    else
                    {
                        context.Options["IncludePath"] += ";" + systemIncludes.JoinStrings(";");
                    }
                }
            }
            public override void SetupSdkOptions(IGenerationContext context)
            {
                var conf   = context.Configuration;
                var devEnv = context.DevelopmentEnvironment;

                // vs2012 and vs2013 do not support overriding windows kits using the underlying variables
                // so we need to change the VC++ directories path.
                // We need to override the executable path for vs2015 because WindowsKit UAP.props does not
                // correctly set the WindowsSDK_ExecutablePath to the bin folder of its current version.
                if ((devEnv == DevEnv.vs2012 || devEnv == DevEnv.vs2013 || devEnv == DevEnv.vs2015) && !KitsRootPaths.UsesDefaultKitRoot(devEnv))
                {
                    var options = context.Options;
                    options["ExecutablePath"] = devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (devEnv != DevEnv.vs2015)
                    {
                        options["IncludePath"] = devEnv.GetWindowsIncludePath();
                        options["LibraryPath"] = devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                        options["ExcludePath"] = devEnv.GetWindowsIncludePath();
                    }
                }

                if (Options.GetObject <Options.Vc.General.PlatformToolset>(conf).IsLLVMToolchain())
                {
                    context.Options["ExecutablePath"] = ClangForWindows.GetWindowsClangExecutablePath() + ";" + devEnv.GetWindowsExecutablePath(conf.Platform);
                    if (Options.GetObject <Options.Vc.LLVM.UseClangCl>(conf) == Options.Vc.LLVM.UseClangCl.Enable)
                    {
                        context.Options["IncludePath"] = ClangForWindows.GetWindowsClangIncludePath() + ";" + devEnv.GetWindowsIncludePath();
                        context.Options["LibraryPath"] = ClangForWindows.GetWindowsClangLibraryPath() + ";" + devEnv.GetWindowsLibraryPath(conf.Platform, Util.IsDotNet(conf) ? conf.Target.GetFragment <DotNetFramework>() : default(DotNetFramework?));
                    }
                }
            }