• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# VCConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VCConfiguration的典型用法代码示例。如果您正苦于以下问题:C# VCConfiguration类的具体用法?C# VCConfiguration怎么用?C# VCConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VCConfiguration类属于命名空间,在下文中一共展示了VCConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ProjectConfiguration

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="configuration">The base Visual Studio project configuration which is to be adapted</param>
        public ProjectConfiguration(VCConfiguration configuration)
        {
            if (configuration == null) throw new ArgumentNullException("configuration");

            this._configuration = configuration;
            this.PrimaryOutput = configuration.PrimaryOutput;
        }
开发者ID:ETAS-Eder,项目名称:vs-boost-unit-test-adapter,代码行数:11,代码来源:ProjectConfiguration.cs


示例2: CleanLibraries

 private void CleanLibraries(VCProject oProject, VCConfiguration oConfiguration)
 {
     VCLinkerTool Linker = (VCLinkerTool)((IVCCollection)oConfiguration.Tools).Item("VCLinkerTool");
     if (Linker != null)
     {
         List<String> Libraries = GetLibraries(Linker);
         for (int i=0; i<Libraries.Count; i++)
         {
             List<String> NewLibs = Libraries.GetRange(i, 1);
             Libraries.RemoveRange(i, 1);
             Linker.AdditionalDependencies = String.Join(" ", Libraries.ToArray());
             oProject.Save();
             if (BuildOperations.BuildConfiguration(oProject, oConfiguration))
             {
                 i--;
                 mLogger.PrintMessage("Library " + String.Join(" ", NewLibs.ToArray()) + " in project '" + oProject.Name + "'has been found unnesessary and removed.");
             }
             else
             {
                 Libraries.InsertRange(i, NewLibs);
             }
         }
         Libraries.Sort();
         Linker.AdditionalDependencies = String.Join(" ", Libraries.ToArray());
         oProject.Save();
     }
 }
开发者ID:kreuzerkrieg,项目名称:DotNetJunk,代码行数:27,代码来源:LinkCleaner.cs


示例3: CompilerToolWrapper

 public CompilerToolWrapper(VCConfiguration config)
 {
     compilerTool = ((IVCCollection)config.Tools).Item("VCCLCompilerTool") as VCCLCompilerTool;
     if (compilerTool == null)
     {
         compilerObj = ((IVCCollection)config.Tools).Item("VCCLCompilerTool");
         compilerType = compilerObj.GetType();
     }
 }
开发者ID:Xenioz,项目名称:qt-labs-vstools,代码行数:9,代码来源:CompilerToolWrapper.cs


示例4: Create

 public static DeploymentToolWrapper Create(VCConfiguration config)
 {
     DeploymentToolWrapper wrapper = null;
     try
     {
         wrapper = new DeploymentToolWrapper(config.DeploymentTool);
     }
     catch
     {
     }
     return (wrapper.deploymentToolObj == null) ? null : wrapper;
 }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:12,代码来源:DeploymentToolWrapper.cs


示例5: parseConfiguration_Folder

        /// <summary>
        /// Gets a folder name from the function passed in, and returns it as a path
        /// relative to the project root folder.
        /// </summary>
        private string parseConfiguration_Folder(VCConfiguration vcConfiguration, Func<string> folderFn)
        {
            // We get the folder name, which may contain symbols e.g. £(ConfgurationName)...
            string pathWithSymbols = Utils.call(folderFn);

            // We resolve the symbols...
            string evaluatedPath = Utils.call(() => (vcConfiguration.Evaluate(pathWithSymbols)));

            // If we ave an absolute path, we convert it to a relative one...
            string relativePath = evaluatedPath;
            if (Path.IsPathRooted(evaluatedPath))
            {
                relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, evaluatedPath);
            }

            return relativePath;
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:21,代码来源:ProjectParser_CPP.cs


示例6: parseConfiguration

        /// <summary>
        /// Parses the configuration (e.g. Debug, Release) passed in.
        /// </summary>
        private void parseConfiguration(VCConfiguration vcConfiguration)
        {
            ProjectConfigurationInfo_CPP configurationInfo = new ProjectConfigurationInfo_CPP();
            configurationInfo.ParentProjectInfo = m_projectInfo;

            // The configuration name...
            configurationInfo.Name = Utils.call(() => (vcConfiguration.ConfigurationName));

            // The project type.
            // Note: we are assuming that all the configurations for the project build the
            //       same type of target.
            m_projectInfo.ProjectType = parseConfiguration_Type(vcConfiguration);

            // We get the intermediates and output folder, and the Target Name.
            configurationInfo.IntermediateFolder = parseConfiguration_Folder(vcConfiguration, () => (vcConfiguration.IntermediateDirectory));
            configurationInfo.OutputFolder = parseConfiguration_Folder(vcConfiguration, () => (vcConfiguration.OutputDirectory));
            configurationInfo.TargetName = parseConfiguration_TargetName(vcConfiguration);

            // We get compiler settings, such as the include path and
            // preprocessor definitions...
            parseConfiguration_CompilerSettings(vcConfiguration, configurationInfo);

            // We get linker settings, such as any libs to link and the library path...
            parseConfiguration_LinkerSettings(vcConfiguration, configurationInfo);

            // We parse librarian settings (how libraries are linked)...
            parseConfiguration_LibrarianSettings(vcConfiguration, configurationInfo);

            // We see if there are any pre- or post- build events set up for this
            // configuration. The only types of events we know how to deal with are
            // ones that invoke a .cmd file. For these we convert them to invoke
            // a .sh file with the same name.
            parseConfiguration_PreBuildEvent(vcConfiguration, configurationInfo);
            parseConfiguration_PostBuildEvent(vcConfiguration, configurationInfo);

            // We add the configuration to the collection of them for the project...
            m_projectInfo.addConfigurationInfo(configurationInfo);
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:41,代码来源:ProjectParser_CPP.cs


示例7: parseConfiguration_CompilerSettings

        /// <summary>
        /// Finds compiler settings, such as the include path, for the configuration
        /// passed in.
        /// </summary>
        private void parseConfiguration_CompilerSettings(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We get the compiler-settings 'tool'...
            IVCCollection tools = Utils.call(() => (vcConfiguration.Tools as IVCCollection));
            VCCLCompilerTool compilerTool = Utils.call(() => (tools.Item("VCCLCompilerTool") as VCCLCompilerTool));

            // And extract various details from it...
            parseCompilerSettings_IncludePath(vcConfiguration, compilerTool, configurationInfo);
            parseCompilerSettings_PreprocessorDefinitions(vcConfiguration, compilerTool, configurationInfo);
            parseCompilerSettings_CompilerFlags(vcConfiguration, compilerTool, configurationInfo);

            IVCCollection sheets = Utils.call(() => (vcConfiguration.PropertySheets as IVCCollection));
            int numSheets = Utils.call(() => (sheets.Count));
            for (int i = 1; i <= numSheets; ++i)
            {
                VCPropertySheet sheet = Utils.call(() => (sheets.Item(i) as VCPropertySheet));

                if (!sheet.IsSystemPropertySheet)
                {
                    // 1. The thing is that VCPropertySheet and VCConfiguration have more-or-less
                    //    identical interfaces. So we should be able to merge them fairly easily.
                    //
                    // 2. We should try multiple layers of inheritance

                    IVCCollection toolsInSheet = Utils.call(() => (sheet.Tools as IVCCollection));
                    VCCLCompilerTool compilerToolInSheet = Utils.call(() => (toolsInSheet.Item("VCCLCompilerTool") as VCCLCompilerTool));

                    // And extract various details from it...
                    if (compilerToolInSheet != null)
                    {
                        parseCompilerSettings_IncludePath(vcConfiguration, compilerToolInSheet, configurationInfo);
                        parseCompilerSettings_PreprocessorDefinitions(vcConfiguration, compilerToolInSheet, configurationInfo);
                        //parseCompilerSettings_CompilerFlags(vcConfiguration, compilerToolInSheet, configurationInfo);
                    }
                }
            }
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:41,代码来源:ProjectParser_CPP.cs


示例8: parseCompilerSettings_CompilerFlags

        /// <summary>
        /// Finds compiler flags.
        /// </summary>
        private void parseCompilerSettings_CompilerFlags(VCConfiguration vcConfiguration, VCCLCompilerTool compilerTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // Warning level...
            warningLevelOption warningLevel = Utils.call(() => (compilerTool.WarningLevel));
            switch (warningLevel)
            {
                case warningLevelOption.warningLevel_0:
                    configurationInfo.addCompilerFlag("-w");
                    break;

                case warningLevelOption.warningLevel_4:
                    configurationInfo.addCompilerFlag("-Wall");
                    break;
            }

            // Warnings as errors...
            bool warningsAsErrors = Utils.call(() => (compilerTool.WarnAsError));
            if (warningsAsErrors == true)
            {
                configurationInfo.addCompilerFlag("-Werror");
            }

            // Optimization...
            optimizeOption optimization = Utils.call(() => (compilerTool.Optimization));
            switch (optimization)
            {
                case optimizeOption.optimizeDisabled:
                    configurationInfo.addCompilerFlag("-O0");
                    break;

                case optimizeOption.optimizeMinSpace:
                    configurationInfo.addCompilerFlag("-Os");
                    break;

                case optimizeOption.optimizeMaxSpeed:
                    configurationInfo.addCompilerFlag("-O2");
                    break;

                case optimizeOption.optimizeFull:
                    configurationInfo.addCompilerFlag("-O3");
                    break;
            }
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:46,代码来源:ProjectParser_CPP.cs


示例9: parseCompilerSettings_PreprocessorDefinitions

        /// <summary>
        /// Finds the collection of preprocessor definitions for the configuration passed in.
        /// </summary>
        private void parseCompilerSettings_PreprocessorDefinitions(VCConfiguration vcConfiguration, VCCLCompilerTool compilerTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We read the delimited string of preprocessor definitions, and
            // split them...
            string strPreprocessorDefinitions = Utils.call(() => (compilerTool.PreprocessorDefinitions));
            if (strPreprocessorDefinitions == null)
            {
                return;
            }
            List<string> preprocessorDefinitions = Utils.split(strPreprocessorDefinitions, ';');

            // We add the definitions to the parsed configuration (removing ones that
            // aren't relevant to a linux build)...
            foreach (string definition in preprocessorDefinitions)
            {
                configurationInfo.addPreprocessorDefinition(definition);
            }
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:21,代码来源:ProjectParser_CPP.cs


示例10: parseConfiguration_PreBuildEvent

 /// <summary>
 /// We parse the pre-build events.
 /// </summary>
 private void parseConfiguration_PreBuildEvent(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
 {
     // We see if there is a pre-build event...
     IVCCollection tools = Utils.call(() => (vcConfiguration.Tools as IVCCollection));
     VCPreBuildEventTool preBuildEvent = Utils.call(() => (tools.Item("VCPreBuildEventTool") as VCPreBuildEventTool));
     if (preBuildEvent == null)
     {
         return;
     }
     string commandLine = Utils.call(() => (preBuildEvent.CommandLine));
     configurationInfo.PreBuildEvent = convertBuildEventCommandLine(commandLine);
 }
开发者ID:nakdai,项目名称:makeitso,代码行数:15,代码来源:ProjectParser_CPP.cs


示例11: RemovePlatformDependencies

 public static void RemovePlatformDependencies(VCConfiguration config, VersionInformation viOld)
 {
     CompilerToolWrapper compiler = CompilerToolWrapper.Create(config);
     SimpleSet minuend = new SimpleSet(compiler.PreprocessorDefinitions);
     SimpleSet subtrahend = new SimpleSet(viOld.GetQMakeConfEntry("DEFINES").Split(new char[] { ' ', '\t' }));
     compiler.SetPreprocessorDefinitions(minuend.Minus(subtrahend).JoinElements(','));
 }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:7,代码来源:QtProject.cs


示例12: GetActiveVCFile

        /// <summary>
        /// Get the active code file, project and configuration 
        /// </summary>
        /// <returns>true if we have found an active C/C++ document</returns>
        private bool GetActiveVCFile(out VCFile vcFile, out VCProject vcProject, out VCConfiguration vcCfg)
        {
            vcFile = null;
              vcProject = null;
              vcCfg = null;

              if (_applicationObject.ActiveDocument != null)
              {
            // GUID equates to 'code file' as far as I can make out
            if (_applicationObject.ActiveDocument.Kind == "{8E7B96A8-E33D-11D0-A6D5-00C04FB67F6A}" &&
            _applicationObject.ActiveDocument.Language == "C/C++")
            {
              // GUID equates to physical file on disk [http://msdn.microsoft.com/en-us/library/z4bcch80(VS.80).aspx]
              if (_applicationObject.ActiveDocument.ProjectItem.Kind == "{6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C}")
              {
            // leap of faith
            vcFile = (VCFile)_applicationObject.ActiveDocument.ProjectItem.Object;
            vcProject = (VCProject)vcFile.project;

            if (vcFile.FileType != eFileType.eFileTypeCppCode)
              return false;

            // save the file (should be optional!)
            if (!_applicationObject.ActiveDocument.Saved)
              _applicationObject.ActiveDocument.Save(vcFile.FullPath);

            // get current configuration to pass to the bridge
            Configuration cfg =
                _applicationObject.ActiveDocument.ProjectItem.ConfigurationManager.ActiveConfiguration;

            try
            {
              var cfgArray = (IVCCollection)vcProject.Configurations;
              foreach (VCConfiguration vcr in cfgArray)
              {
                if (vcr.ConfigurationName == cfg.ConfigurationName &&
                    vcr.Platform.Name == cfg.PlatformName)
                {
                  vcCfg = vcr;
                }
              }
            }
            catch (Exception)
            {
              return false;
            }

            return true;
              }
            }
              }

              return false;
        }
开发者ID:tigaliang,项目名称:ClangVSx,代码行数:58,代码来源:CVXConnect.cs


示例13: parseLinkerSettings_LibraryPath

        /// <summary>
        /// Finds the library path for the configuration passed in.
        /// </summary>
        private void parseLinkerSettings_LibraryPath(VCConfiguration vcConfiguration, VCLinkerTool linkerTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We:
            // 1. Read the additional library paths (which are in a semi-colon-delimited string)
            // 2. Split it into separate paths
            // 3. Resolve any symbols
            // 4. Make sure all paths are relative to the project root folder

            // 1 & 2...
            string strAdditionalLibraryDirectories = Utils.call(() => (linkerTool.AdditionalLibraryDirectories));
            if (strAdditionalLibraryDirectories == null)
            {
                return;
            }

            List<string> additionalLibraryDirectories = Utils.split(strAdditionalLibraryDirectories, ';', ',');
            foreach (string additionalLibraryDirectory in additionalLibraryDirectories)
            {
                // The string may be quoted. We need to remove the quotes...
                string unquotedLibraryDirectory = additionalLibraryDirectory.Trim('"');
                if (unquotedLibraryDirectory == "")
                {
                    continue;
                }

                // 3 & 4...
                string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(unquotedLibraryDirectory)));
                if (resolvedPath != "")
                {
                    string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
                    configurationInfo.addLibraryPath(relativePath);
                }
            }
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:37,代码来源:ProjectParser_CPP.cs


示例14: RemoveDeploySettings

        private void RemoveDeploySettings(DeploymentToolWrapper deploymentTool, QtModule module,
                                       VCConfiguration config, QtModuleInfo moduleInfo)
        {
            if (moduleInfo == null)
                moduleInfo = QtModules.Instance.ModuleInformation(module);
            if (deploymentTool == null)
                deploymentTool = DeploymentToolWrapper.Create(config);
            if (deploymentTool == null)
                return;

            string destDir = deploymentTool.RemoteDirectory;
            const string qtSrcDir = "$(QTDIR)\\lib";
            string filename = moduleInfo.GetDllFileName(IsDebugConfiguration(config));

            if (deploymentTool.GetAdditionalFiles().IndexOf(filename) >= 0)
                deploymentTool.Remove(filename, qtSrcDir, destDir);

            // remove dependent modules
            foreach (QtModule dependentModule in moduleInfo.dependentModules)
            {
                if (!HasModule(dependentModule))
                    RemoveDeploySettings(deploymentTool, dependentModule, config, null);
            }
        }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:24,代码来源:QtProject.cs


示例15: RemoveQtDeploys

 private static void RemoveQtDeploys(VCConfiguration config)
 {
     DeploymentToolWrapper deploymentTool = DeploymentToolWrapper.Create(config);
     if (deploymentTool == null)
         return;
     string additionalFiles = deploymentTool.GetAdditionalFiles();
     additionalFiles = Regex.Replace(additionalFiles, "Qt[^\\|]*\\|[^\\|]*\\|[^\\|]*\\|[^;^$]*[;$]{0,1}", "");
     if (additionalFiles.EndsWith(";"))
         additionalFiles = additionalFiles.Substring(0, additionalFiles.Length - 1);
     deploymentTool.SetAdditionalFiles(additionalFiles);
 }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:11,代码来源:QtProject.cs


示例16: AddDeploySettings

        private void AddDeploySettings(DeploymentToolWrapper deploymentTool, QtModule module,
                                       VCConfiguration config, QtModuleInfo moduleInfo,
                                       VersionInformation versionInfo)
        {
            // for static Qt builds it doesn't make sense
            // to add deployment settings for Qt modules
            if (versionInfo.IsStaticBuild())
                return;

            if (moduleInfo == null)
                moduleInfo = QtModules.Instance.ModuleInformation(module);

            if (moduleInfo == null || !moduleInfo.HasDLL)
                return;

            if (deploymentTool == null)
                deploymentTool = DeploymentToolWrapper.Create(config);
            if (deploymentTool == null)
                return;

            string destDir = deploymentTool.RemoteDirectory;
            const string qtSrcDir = "$(QTDIR)\\lib";
            string filename = moduleInfo.GetDllFileName(IsDebugConfiguration(config));

            if (deploymentTool.GetAdditionalFiles().IndexOf(filename) < 0)
                deploymentTool.Add(filename, qtSrcDir, destDir);

            // add dependent modules
            foreach (QtModule dependentModule in moduleInfo.dependentModules)
                AddDeploySettings(deploymentTool, dependentModule, config, null, versionInfo);
        }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:31,代码来源:QtProject.cs


示例17: UsesPrecompiledHeaders

 public static bool UsesPrecompiledHeaders(VCConfiguration config)
 {
     CompilerToolWrapper compiler = CompilerToolWrapper.Create(config);
     return UsesPrecompiledHeaders(compiler);
 }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:5,代码来源:QtProject.cs


示例18: IsDebugConfiguration

 private static bool IsDebugConfiguration(VCConfiguration conf)
 {
     VCCLCompilerTool compiler = (VCCLCompilerTool)((IVCCollection)conf.Tools).Item("VCCLCompilerTool");
     if (compiler != null && (compiler.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebug || compiler.RuntimeLibrary == runtimeLibraryOption.rtMultiThreadedDebugDLL))
         return true;
     return false;
 }
开发者ID:ago1024,项目名称:Qt4VSAddin,代码行数:7,代码来源:QtProject.cs


示例19: parseConfiguration_LibrarianSettings

        /// <summary>
        /// We parse the librarian settings, ie link options for libraries.
        /// </summary>
        private void parseConfiguration_LibrarianSettings(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We get the librarian 'tool'...
            IVCCollection tools = Utils.call(() => (vcConfiguration.Tools as IVCCollection));
            VCLibrarianTool librarianTool = Utils.call(() => (tools.Item("VCLibrarianTool") as VCLibrarianTool));
            if (librarianTool == null)
            {
                // Not all projects have a librarian tool...
                return;
            }

            // We find if this library is set to link together other libraries it depends on...
            // (We are assuming that all configurations of the project have the same link-library-dependencies setting.)
            m_projectInfo.LinkLibraryDependencies = Utils.call(() => (librarianTool.LinkLibraryDependencies));

            parseLibrarianSettings_LibraryPath(vcConfiguration, librarianTool, configurationInfo);
            parseLibrarianSettings_Libraries(vcConfiguration, librarianTool, configurationInfo);
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:21,代码来源:ProjectParser_CPP.cs


示例20: parseConfiguration_Type

        /// <summary>
        /// Gets the configuration type.
        /// </summary>
        private ProjectInfo.ProjectTypeEnum parseConfiguration_Type(VCConfiguration vcConfiguration)
        {
            ProjectInfo.ProjectTypeEnum result = ProjectInfo.ProjectTypeEnum.INVALID;

            // We get the Visual Studio confiuration type...
            ConfigurationTypes configurationType = Utils.call(() => (vcConfiguration.ConfigurationType));

            // And convert it to our enum type...
            switch (configurationType)
            {
                case ConfigurationTypes.typeApplication:
                    result = ProjectInfo.ProjectTypeEnum.CPP_EXECUTABLE;
                    break;

                case ConfigurationTypes.typeStaticLibrary:
                    result = ProjectInfo.ProjectTypeEnum.CPP_STATIC_LIBRARY;
                    break;

                case ConfigurationTypes.typeDynamicLibrary:
                    result = ProjectInfo.ProjectTypeEnum.CPP_DLL;
                    break;
            }

            return result;
        }
开发者ID:nakdai,项目名称:makeitso,代码行数:28,代码来源:ProjectParser_CPP.cs



注:本文中的VCConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VCFile类代码示例发布时间:2022-05-24
下一篇:
C# VBox类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap