示例#1
0
        public static VcArgumentMap CreateMidlArgumentMap()
        {
            VcArgumentMap map = new VcArgumentMap();

            // General

            map.AddBool("IgnoreStandardIncludePath", "/no_def_idir");
            map.AddBool("MkTypLibCompatible", "/mktyplib203");
            map.AddEnum("WarningLevel", null, "/W0", "/W1", "/W2", "/W3", "/W4");
            map.AddBool("WarnAsError", "/WX");
            map.AddEnum("DefaultCharType", null, "unsigned", "signed", "ascii7");
            map.AddEnum("TargetEnvironment", null, null, "win32", "win64");
            map.AddBool("GenerateStublessProxies", "/Oicf");

            // Output
            map.AddBool("GenerateTypeLibrary", "/notlb", "false");

            // Advanced

            map.AddEnum("EnableErrorChecks", "/error ", null, "none", "all");
            map.AddBool("ErrorCheckAllocations", "/error allocation");
            map.AddBool("ErrorCheckBounds", "/error bounds_check");
            map.AddBool("ErrorCheckEnumRange", "/error enum");
            map.AddBool("ErrorCheckRefPointers", "/error ref");
            map.AddBool("ErrorCheckStubData", "/error stub_data");
            map.AddBool("ValidateParameters", "/robust");
            map.AddEnum("StructMemberAlignment", null, null, "/Zp1", "/Zp2", "/Zp4", "/Zp8");
            return(map);
        }
示例#2
0
        public override Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup)
        {
            ExpansionHandler expander = new ExpansionHandler(ExpandMacros);

            Hashtable args;

            if (_parentConfig != null)
            {
                args = _parentConfig.GetToolArguments(toolName, argMap, ignoreGroup, expander);
            }
            else
            {
                args = CollectionsUtil.CreateCaseInsensitiveHashtable();
            }

            Hashtable toolSettings = (Hashtable)Tools[toolName];

            if (toolSettings != null)
            {
                foreach (DictionaryEntry de in toolSettings)
                {
                    string arg = argMap.GetArgument((string)de.Key, ExpandMacros((string)de.Value), ignoreGroup);
                    if (arg != null)
                    {
                        args[(string)de.Key] = arg;
                    }
                }
            }
            return(args);
        }
示例#3
0
        /// <summary>
        /// Creates a mapping between configuration properties for the Visual
        /// C++ compiler and corresponding command-line arguments.
        /// </summary>
        /// <returns>
        /// A mapping between configuration properties for the Visual C++
        /// compiler and corresponding command-line arguments.
        /// </returns>
        /// <remarks>
        ///   <para>
        ///   The following configuration properties are processed by
        ///   <see cref="VcProject" />:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Addtional Include Directories (/I[path])</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Resolve #using References (/AI[path])</description>
        ///     </item>
        ///     <item>
        ///       <term>Preprocessor</term>
        ///       <description>Preprocessor Definitions (/D[macro])</description>
        ///     </item>
        ///     <item>
        ///       <term>Code Generation</term>
        ///       <description>Enable C++ Exceptions (/EHsc)</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Create/Use Precompiled Header</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Create/Use PCH Through File</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Precompiled Header File</description>
        ///     </item>
        ///     <item>
        ///       <term>Output Files</term>
        ///       <description>Assembler Output</description>
        ///     </item>
        ///     <item>
        ///       <term>Output Files</term>
        ///       <description>ASM List Location</description>
        ///     </item>
        ///     <item>
        ///       <term>Browse Information</term>
        ///       <description>Enable Browse Information</description>
        ///     </item>
        ///     <item>
        ///       <term>Browse Information</term>
        ///       <description>Browse File</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Force Includes (/FI[name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Force #using (/FU[name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Undefine Preprocessor Definitions (/U[macro])</description>
        ///     </item>
        ///   </list>
        /// </remarks>
        public static VcArgumentMap CreateCLArgumentMap()
        {
            VcArgumentMap map = new VcArgumentMap();

            // General
            map.AddEnum("DebugInformationFormat", null, null, "/Z7", "/Zd", "/Zi", "/ZI");
            map.AddEnum("CompileAsManaged", null, null, null, "/clr"); // file-level only
            map.AddEnum("WarningLevel", null, "/W0", "/W1", "/W2", "/W3", "/W4");
            map.AddBool("Detect64BitPortabilityProblems", "/Wp64");
            map.AddBool("WarnAsError", "/WX");

            // Optimization
            map.AddEnum("Optimization", null, "/Od", "/O1", "/O2", "/Ox");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "GlobalOptimizations", "/Og");
            map.AddEnum(ArgGroup.OptiIgnoreGroup, "InlineFunctionExpansion", null, "/Ob0", "/Ob1", "/Ob2");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "EnableIntrinsicFunctions", "/Oi");
            map.AddBool("ImproveFloatingPointConsistency", "/Op");
            map.AddEnum("FavorSizeOrSpeed", null, null, "/Ot", "/Os");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "OmitFramePointers", "/Oy");
            map.AddBool("EnableFiberSafeOptimizations", "/GT");
            map.AddEnum("OptimizeForProcessor", null, null, "/G5", "/G6", "/G7");
            map.AddBool("OptimizeForWindowsApplication", "/GA");

            // Preprocessor
            map.AddBool("IgnoreStandardIncludePath", "/X");
            map.AddEnum("GeneratePreprocessedFile", null, null, "/P", "/EP /P");
            map.AddBool("KeepComments", "/C");

            // Code Generation
            map.AddBool(ArgGroup.OptiIgnoreGroup, "StringPooling", "/GF");
            map.AddBool("MinimalRebuild", "/Gm");
            map.AddBool("SmallerTypeCheck", "/RTCc");
            map.AddEnum("BasicRuntimeChecks", null, null, "/RTCs", "/RTCu", "/RTC1");
            map.AddEnum("RuntimeLibrary", null, "/MT", "/MTd", "/MD", "/MDd", "/ML", "/MLd");
            map.AddEnum("StructMemberAlignment", null, null, "/Zp1", "/Zp2", "/Zp4", "/Zp8", "/Zp16");
            map.AddBool("BufferSecurityCheck", "/GS");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "EnableFunctionLevelLinking", "/Gy");
            map.AddEnum("EnableEnhancedInstructionSet", null, null, "/arch:SSE", "/arch:SSE2");

            // Language

            map.AddBool("DisableLanguageExtensions", "/Za");
            map.AddBool("DefaultCharIsUnsigned", "/J");
            map.AddBool("TreatWChar_tAsBuiltInType", "/Zc:wchar_t");
            map.AddBool("ForceConformanceInForLoopScope", "/Zc:forScope");
            map.AddBool("RuntimeTypeInfo", "/GR");

            // Output Files
            map.AddBool("ExpandAttributedSource", "/Fx");
            map.AddEnum("AssemblerOutput", null, null, "/FA", "/FAcs", "/FAc", "/FAs");

            // Advanced
            map.AddEnum("CallingConvention", null, null, "/Gr", "/Gz");
            map.AddEnum("CompileAs", null, null, "/TC", "/TP");
            map.AddBool("ShowIncludes", "/showIncludes");
            map.AddBool("UndefineAllPreprocessorDefinitions", "/u");

            return(map);
        }
示例#4
0
        /// <summary>
        /// Creates a mapping between configuration properties for the Visual
        /// C++ linker and corresponding command-line arguments.
        /// </summary>
        /// <returns>
        /// A mapping between configuration properties for the Visual C++
        /// linker and corresponding command-line arguments.
        /// </returns>
        /// <remarks>
        ///   <para>
        ///   The following configuration properties are processed by
        ///   <see cref="VcProject" />:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Output File (/OUT:[file])</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Additional Library Directories (/LIBPATH:[dir])</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Additional Dependencies</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Add Module to Assembly (/ASSEMBLYMODULE:file)</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Embed Managed Resource File (/ASSEMBLYRESOURCE:file)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Debug Info (/DEBUG)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Program Database File (/PDB:name)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Map File (/MAP)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Map File Name (/MAP:[filename])</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Heap Reserve Size (/HEAP:reserve)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Heap Commit Size (/HEAP:reserve, commit)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Stack Reserve Size (/STACK:reserve)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Stack Commit Size (/STACK:reserve, commit)</description>
        ///     </item>
        ///   </list>
        ///   <para>
        ///   The following configuration properties are ignored:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Show Progress (/VERBOSE, /VERBOSE:LIB)</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Suppress Startup Banner (/NOLOGO)</description>
        ///     </item>
        ///   </list>
        ///   <para>
        ///   Support for the following configuration properties still needs to
        ///   be implemented:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Ignore Import Library</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Register Output</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Delay Loaded DLLs (/DELAYLOAD:[dll_name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Embedded IDL</term>
        ///       <description>MIDL Commands (/MIDL:[file])</description>
        ///     </item>
        ///   </list>
        /// </remarks>
        public static VcArgumentMap CreateLinkerArgumentMap()
        {
            VcArgumentMap map = new VcArgumentMap();

            // General
            map.AddEnum("LinkIncremental", null, null, "/INCREMENTAL:NO", "/INCREMENTAL");
            map.AddLinkerString("Version", "/VERSION:", true);

            // Input
            map.AddBool("IgnoreAllDefaultLibraries", "/NODEFAULTLIB");
            map.AddQuotedLinkerString("ModuleDefinitionFile", "/DEF:", true);

            // Debugging
            map.AddQuotedLinkerString("StripPrivateSymbols", "/PDBSTRIPPED:", true);
            map.AddBool("MapExports", "/MAPINFO:EXPORTS");
            map.AddBool("MapLines", "/MAPINFO:LINES");
            map.AddEnum("AssemblyDebug", null, null, "/ASSEMBLYDEBUG", "/ASSEMBLYDEBUG:DISABLE");

            // System
            map.AddEnum("SubSystem", "/SUBSYSTEM:", null, "CONSOLE", "WINDOWS");
            map.AddEnum("LargeAddressAware", null, null, "/LARGEADDRESSAWARE:NO", "/LARGEADDRESSAWARE");
            map.AddEnum("TerminalServerAware", null, null, "/TSAWARE:NO", "/TSAWARE");
            map.AddBool("SwapRunFromCD", "/SWAPRUN:CD");
            map.AddBool("SwapRunFromNet", "/SWAPRUN:NET");

            // Optimization
            map.AddEnum("OptimizeReferences", "/OPT:", null, "NOREF", "REF");
            map.AddEnum("EnableCOMDATFolding", "/OPT:", null, "NOICF", "ICF");
            map.AddEnum("OptimizeForWindows98", "/OPT:", null, "NOWIN98", "WIN98");
            map.AddQuotedLinkerString("FunctionOrder", "/ORDER:", true);

            // Embedded IDL
            map.AddBool("IgnoreEmbeddedIDL", "/IGNOREIDL");
            map.AddQuotedLinkerString("MergedIDLBaseFileName", "/IDLOUT:", true);
            map.AddQuotedLinkerString("TypeLibraryFile", "/TLBOUT:", true);
            map.AddLinkerString("TypeLibraryResourceID", "/TLBID:");

            // Advanced
            map.AddQuotedLinkerString("EntryPointSymbol", "/ENTRY:", true);
            map.AddBool("ResourceOnlyDLL", "/NOENTRY");
            map.AddBool("SetChecksum", "/RELEASE");
            map.AddQuotedLinkerString("BaseAddress", "/BASE:", true);
            map.AddEnum("FixedBaseAddress", null, null, "/FIXED:NO", "/FIXED");
            map.AddBool("TurnOffAssemblyGeneration", "/NOASSEMBLY");
            map.AddBool("SupportUnloadOfDelayLoadedDLL", "/DELAY:UNLOAD");
            map.AddQuotedLinkerString("MergeSections", "/MERGE:", true);
            map.AddEnum("TargetMachine", null, null, "/MACHINE:X86");

            return(map);
        }
        internal Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup, ExpansionHandler expander)
        {
            Hashtable args = CollectionsUtil.CreateCaseInsensitiveHashtable();

            Hashtable toolSettings = (Hashtable)Tools[toolName];

            if (toolSettings != null)
            {
                foreach (DictionaryEntry de in toolSettings)
                {
                    string arg = argMap.GetArgument((string)de.Key, expander((string)de.Value), ignoreGroup);
                    if (arg != null)
                    {
                        args[(string)de.Key] = arg;
                    }
                }
            }
            return(args);
        }
示例#6
0
        public VcProject(SolutionBase solution, string projectPath, XmlElement xmlDefinition, 
                SolutionTask solutionTask, 
                TempFileCollection tfc, 
                GacCache gacCache, 
                ReferencesResolver refResolver, 
                DirectoryInfo outputDir)
            : base(xmlDefinition, solutionTask, tfc, gacCache, refResolver, outputDir)
        {
            if (projectPath == null) {
                throw new ArgumentNullException("projectPath");
            }

            _references = new ArrayList();
            _clArgMap = VcArgumentMap.CreateCLArgumentMap();
            _linkerArgMap = VcArgumentMap.CreateLinkerArgumentMap();
            _midlArgMap = VcArgumentMap.CreateMidlArgumentMap();
            _projectPath = FileUtils.GetFullPath(projectPath);

            _name = xmlDefinition.GetAttribute("Name");
            _guid = xmlDefinition.GetAttribute("ProjectGUID");

            XmlNodeList configurationNodes = xmlDefinition.SelectNodes("//Configurations/Configuration");
            foreach (XmlElement configElem in configurationNodes) {
                VcProjectConfiguration config = new VcProjectConfiguration(configElem, this, OutputDir);
                ProjectConfigurations[new Configuration (config.Name, config.PlatformName)] = config;
            }

            XmlNodeList references = xmlDefinition.SelectNodes("//References/child::*");
            foreach (XmlElement referenceElem in references) {
                ReferenceBase reference = CreateReference(solution, referenceElem);
                _references.Add(reference);
            }

            XmlNodeList fileNodes = xmlDefinition.SelectNodes("//File");
            _projectFiles = new ArrayList(fileNodes.Count);
            foreach (XmlElement fileElem in fileNodes) {
                string parentName = Name;

                // determine name of parent
                if (fileElem.ParentNode != null && fileElem.ParentNode.Name == "Filter") {
                    XmlNode filterName = fileElem.ParentNode.Attributes.GetNamedItem("Name");
                    if (filterName != null) {
                        parentName = filterName.Value;
                    }
                }

                string relPath = fileElem.GetAttribute("RelativePath");

                Hashtable htFileConfigurations = null;

                XmlNodeList fileConfigList = fileElem.GetElementsByTagName("FileConfiguration");
                if (fileConfigList.Count > 0) {
                    htFileConfigurations = CollectionsUtil.CreateCaseInsensitiveHashtable(fileConfigList.Count);
                    foreach (XmlElement fileConfigElem in fileConfigList) {
                        Configuration fileConfig = Configuration.Parse (
                            fileConfigElem.GetAttribute("Name"));
                        VcProjectConfiguration projectConfig = (VcProjectConfiguration) ProjectConfigurations[fileConfig];
                        htFileConfigurations[projectConfig.Name] = new VcFileConfiguration(
                            relPath, parentName, fileConfigElem, projectConfig, outputDir);
                    }
                }

                // TODO: refactor this together with the Build methods

                // we'll always create a file configuration for IDL and res
                // files as macro's in the configuration properties for these
                // files will always need to be expanded on the file level
                string ext = Path.GetExtension(relPath).ToLower(CultureInfo.InvariantCulture);
                switch (ext) {
                    case ".idl":
                    case ".odl":
                    case ".rc":
                        // ensure there's a file configuration for each project
                        // configuration
                        foreach (VcProjectConfiguration projectConfig in ProjectConfigurations.Values) {
                            // if file configuration for project config existed
                            // in project file, then skip this project config
                            if (htFileConfigurations != null && htFileConfigurations.ContainsKey(projectConfig.Name)) {
                                continue;
                            }

                            // lazy initialize hashtable
                            if (htFileConfigurations == null) {
                                htFileConfigurations = CollectionsUtil.CreateCaseInsensitiveHashtable();
                            }

                            // create the file configuration
                            htFileConfigurations[projectConfig.Name] = new
                                VcFileConfiguration(relPath, parentName, projectConfig, outputDir);
                        }
                        break;
                }

                if (htFileConfigurations != null) {
                    _projectFiles.Add(htFileConfigurations);
                } else {
                    _projectFiles.Add(relPath);
                }
            }
        }
 public override Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup)
 {
     return(GetToolArguments(toolName, argMap, ignoreGroup, new ExpansionHandler(ExpandMacros)));
 }
示例#8
0
        public override Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup)
        {
            ExpansionHandler expander = new ExpansionHandler(ExpandMacros);

            Hashtable args;
            if (_parentConfig != null) {
                args = _parentConfig.GetToolArguments(toolName, argMap, ignoreGroup, expander);
            } else {
                args = CollectionsUtil.CreateCaseInsensitiveHashtable();
            }

            Hashtable toolSettings = (Hashtable) Tools[toolName];
            if (toolSettings != null) {
                foreach (DictionaryEntry de in toolSettings) {
                    string arg = argMap.GetArgument((string) de.Key, ExpandMacros((string) de.Value), ignoreGroup);
                    if (arg != null) {
                        args[(string) de.Key] = arg;
                    }
                }
            }
            return args;
        }
示例#9
0
 public abstract Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup);
示例#10
0
 public Hashtable GetToolArguments(string toolName, VcArgumentMap argMap)
 {
     return GetToolArguments(toolName, argMap, VcArgumentMap.ArgGroup.Unassigned);
 }
示例#11
0
        /// <summary>
        /// Creates a mapping between configuration properties for the Visual
        /// C++ linker and corresponding command-line arguments.
        /// </summary>
        /// <returns>
        /// A mapping between configuration properties for the Visual C++
        /// linker and corresponding command-line arguments.
        /// </returns>
        /// <remarks>
        ///   <para>
        ///   The following configuration properties are processed by
        ///   <see cref="VcProject" />:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Output File (/OUT:[file])</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Additional Library Directories (/LIBPATH:[dir])</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Additional Dependencies</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Add Module to Assembly (/ASSEMBLYMODULE:file)</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Embed Managed Resource File (/ASSEMBLYRESOURCE:file)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Debug Info (/DEBUG)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Program Database File (/PDB:name)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Generate Map File (/MAP)</description>
        ///     </item>
        ///     <item>
        ///       <term>Debugging</term>
        ///       <description>Map File Name (/MAP:[filename])</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Heap Reserve Size (/HEAP:reserve)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Heap Commit Size (/HEAP:reserve, commit)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Stack Reserve Size (/STACK:reserve)</description>
        ///     </item>
        ///     <item>
        ///       <term>System</term>
        ///       <description>Stack Commit Size (/STACK:reserve, commit)</description>
        ///     </item>
        ///   </list>
        ///   <para>
        ///   The following configuration properties are ignored:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Show Progress (/VERBOSE, /VERBOSE:LIB)</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Suppress Startup Banner (/NOLOGO)</description>
        ///     </item>
        ///   </list>
        ///   <para>
        ///   Support for the following configuration properties still needs to
        ///   be implemented:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Ignore Import Library</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Register Output</description>
        ///     </item>
        ///     <item>
        ///       <term>Input</term>
        ///       <description>Delay Loaded DLLs (/DELAYLOAD:[dll_name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Embedded IDL</term>
        ///       <description>MIDL Commands (/MIDL:[file])</description>
        ///     </item>
        ///   </list>
        /// </remarks>
        public static VcArgumentMap CreateLinkerArgumentMap() {
            VcArgumentMap map = new VcArgumentMap();

            // General
            map.AddEnum("LinkIncremental", null, null, "/INCREMENTAL:NO", "/INCREMENTAL");
            map.AddLinkerString("Version", "/VERSION:", true);

            // Input
            map.AddBool("IgnoreAllDefaultLibraries", "/NODEFAULTLIB");
            map.AddQuotedLinkerString("ModuleDefinitionFile", "/DEF:", true);

            // Debugging
            map.AddQuotedLinkerString("StripPrivateSymbols", "/PDBSTRIPPED:", true);
            map.AddBool("MapExports", "/MAPINFO:EXPORTS");
            map.AddBool("MapLines", "/MAPINFO:LINES");
            map.AddEnum("AssemblyDebug", null, null, "/ASSEMBLYDEBUG", "/ASSEMBLYDEBUG:DISABLE");
            
            // System
            map.AddEnum("SubSystem", "/SUBSYSTEM:", null, "CONSOLE", "WINDOWS");
            map.AddEnum("LargeAddressAware", null, null, "/LARGEADDRESSAWARE:NO", "/LARGEADDRESSAWARE");
            map.AddEnum("TerminalServerAware", null, null, "/TSAWARE:NO", "/TSAWARE");
            map.AddBool("SwapRunFromCD", "/SWAPRUN:CD");
            map.AddBool("SwapRunFromNet", "/SWAPRUN:NET");

            // Optimization
            map.AddEnum("OptimizeReferences", "/OPT:", null, "NOREF", "REF");
            map.AddEnum("EnableCOMDATFolding", "/OPT:", null, "NOICF", "ICF");
            map.AddEnum("OptimizeForWindows98", "/OPT:", null, "NOWIN98", "WIN98");
            map.AddQuotedLinkerString("FunctionOrder", "/ORDER:", true);

            // Embedded IDL
            map.AddBool("IgnoreEmbeddedIDL", "/IGNOREIDL");
            map.AddQuotedLinkerString("MergedIDLBaseFileName", "/IDLOUT:", true);
            map.AddQuotedLinkerString("TypeLibraryFile", "/TLBOUT:", true);
            map.AddLinkerString("TypeLibraryResourceID", "/TLBID:");
            
            // Advanced
            map.AddQuotedLinkerString("EntryPointSymbol", "/ENTRY:", true);
            map.AddBool("ResourceOnlyDLL", "/NOENTRY");
            map.AddBool("SetChecksum", "/RELEASE");
            map.AddQuotedLinkerString("BaseAddress", "/BASE:", true);
            map.AddEnum("FixedBaseAddress", null, null, "/FIXED:NO", "/FIXED");
            map.AddBool("TurnOffAssemblyGeneration", "/NOASSEMBLY");
            map.AddBool("SupportUnloadOfDelayLoadedDLL", "/DELAY:UNLOAD");
            map.AddQuotedLinkerString("MergeSections", "/MERGE:", true);
            map.AddEnum("TargetMachine", null, null, "/MACHINE:X86");

            return map;
        }
示例#12
0
        /// <summary>
        /// Creates a mapping between configuration properties for the Visual
        /// C++ compiler and corresponding command-line arguments.
        /// </summary>
        /// <returns>
        /// A mapping between configuration properties for the Visual C++
        /// compiler and corresponding command-line arguments.
        /// </returns>
        /// <remarks>
        ///   <para>
        ///   The following configuration properties are processed by
        ///   <see cref="VcProject" />:
        ///   </para>
        ///   <list type="table">
        ///     <listheader>
        ///       <term>Category</term>
        ///       <description>Property</description>
        ///     </listheader>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Addtional Include Directories (/I[path])</description>
        ///     </item>
        ///     <item>
        ///       <term>General</term>
        ///       <description>Resolve #using References (/AI[path])</description>
        ///     </item>
        ///     <item>
        ///       <term>Preprocessor</term>
        ///       <description>Preprocessor Definitions (/D[macro])</description>
        ///     </item>
        ///     <item>
        ///       <term>Code Generation</term>
        ///       <description>Enable C++ Exceptions (/EHsc)</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Create/Use Precompiled Header</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Create/Use PCH Through File</description>
        ///     </item>
        ///     <item>
        ///       <term>Precompiled Headers</term>
        ///       <description>Precompiled Header File</description>
        ///     </item>
        ///     <item>
        ///       <term>Output Files</term>
        ///       <description>Assembler Output</description>
        ///     </item>
        ///     <item>
        ///       <term>Output Files</term>
        ///       <description>ASM List Location</description>
        ///     </item>
        ///     <item>
        ///       <term>Browse Information</term>
        ///       <description>Enable Browse Information</description>
        ///     </item>
        ///     <item>
        ///       <term>Browse Information</term>
        ///       <description>Browse File</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Force Includes (/FI[name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Force #using (/FU[name])</description>
        ///     </item>
        ///     <item>
        ///       <term>Advanced</term>
        ///       <description>Undefine Preprocessor Definitions (/U[macro])</description>
        ///     </item>
        ///   </list>
        /// </remarks>
        public static VcArgumentMap CreateCLArgumentMap() {
            VcArgumentMap map = new VcArgumentMap();

            // General
            map.AddEnum("DebugInformationFormat", null, null, "/Z7", "/Zd", "/Zi", "/ZI");
            map.AddEnum("CompileAsManaged", null, null, null, "/clr"); // file-level only
            map.AddEnum("WarningLevel", null, "/W0", "/W1", "/W2", "/W3", "/W4");
            map.AddBool("Detect64BitPortabilityProblems", "/Wp64");
            map.AddBool("WarnAsError", "/WX");
            
            // Optimization
            map.AddEnum("Optimization", null, "/Od", "/O1", "/O2", "/Ox");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "GlobalOptimizations", "/Og");
            map.AddEnum(ArgGroup.OptiIgnoreGroup, "InlineFunctionExpansion", null, "/Ob0", "/Ob1", "/Ob2");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "EnableIntrinsicFunctions", "/Oi");
            map.AddBool("ImproveFloatingPointConsistency", "/Op");
            map.AddEnum("FavorSizeOrSpeed", null, null, "/Ot", "/Os");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "OmitFramePointers", "/Oy");
            map.AddBool("EnableFiberSafeOptimizations", "/GT");
            map.AddEnum("OptimizeForProcessor", null, null, "/G5", "/G6", "/G7");
            map.AddBool("OptimizeForWindowsApplication", "/GA");

            // Preprocessor
            map.AddBool("IgnoreStandardIncludePath", "/X");
            map.AddEnum("GeneratePreprocessedFile", null, null, "/P", "/EP /P");
            map.AddBool("KeepComments", "/C");
            
            // Code Generation
            map.AddBool(ArgGroup.OptiIgnoreGroup, "StringPooling", "/GF");
            map.AddBool("MinimalRebuild", "/Gm");
            map.AddBool("SmallerTypeCheck", "/RTCc");
            map.AddEnum("BasicRuntimeChecks", null, null, "/RTCs", "/RTCu", "/RTC1");
            map.AddEnum("RuntimeLibrary", null, "/MT", "/MTd", "/MD", "/MDd", "/ML", "/MLd");
            map.AddEnum("StructMemberAlignment", null, null, "/Zp1", "/Zp2", "/Zp4", "/Zp8", "/Zp16");
            map.AddBool("BufferSecurityCheck", "/GS");
            map.AddBool(ArgGroup.OptiIgnoreGroup, "EnableFunctionLevelLinking", "/Gy");
            map.AddEnum("EnableEnhancedInstructionSet", null, null, "/arch:SSE", "/arch:SSE2");

            // Language

            map.AddBool("DisableLanguageExtensions", "/Za");
            map.AddBool("DefaultCharIsUnsigned", "/J");
            map.AddBool("TreatWChar_tAsBuiltInType", "/Zc:wchar_t");
            map.AddBool("ForceConformanceInForLoopScope", "/Zc:forScope");
            map.AddBool("RuntimeTypeInfo", "/GR");

            // Output Files
            map.AddBool("ExpandAttributedSource", "/Fx");
            map.AddEnum("AssemblerOutput", null, null, "/FA", "/FAcs", "/FAc", "/FAs");

            // Advanced
            map.AddEnum("CallingConvention", null, null, "/Gr", "/Gz");
            map.AddEnum("CompileAs", null, null, "/TC", "/TP");
            map.AddBool("ShowIncludes", "/showIncludes");  
            map.AddBool("UndefineAllPreprocessorDefinitions", "/u");

            return map;
        }
示例#13
0
        internal Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup, ExpansionHandler expander)
        {
            Hashtable args = CollectionsUtil.CreateCaseInsensitiveHashtable();

            Hashtable toolSettings = (Hashtable) Tools[toolName];
            if (toolSettings != null) {
                foreach (DictionaryEntry de in toolSettings) {
                    string arg = argMap.GetArgument((string) de.Key, expander((string) de.Value), ignoreGroup);
                    if (arg != null) {
                        args[(string) de.Key] = arg;
                    }
                }
            }
            return args;
        }
示例#14
0
 /// <summary>
 /// Gets the tool arguments.
 /// </summary>
 /// <param name="toolName">Name of the tool.</param>
 /// <param name="argMap">The argument map.</param>
 /// <param name="ignoreGroup">The ignore group.</param>
 /// <returns>A hashtable contianing the tool arguments.</returns>
 public override Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup)
 {
     return GetToolArguments(toolName, argMap, ignoreGroup, new ExpansionHandler(ExpandMacros));
 }
示例#15
0
 public Hashtable GetToolArguments(string toolName, VcArgumentMap argMap)
 {
     return(GetToolArguments(toolName, argMap, VcArgumentMap.ArgGroup.Unassigned));
 }
示例#16
0
 public abstract Hashtable GetToolArguments(string toolName, VcArgumentMap argMap, VcArgumentMap.ArgGroup ignoreGroup);
示例#17
0
        public static VcArgumentMap CreateMidlArgumentMap() {
            VcArgumentMap map = new VcArgumentMap();

            // General

            map.AddBool("IgnoreStandardIncludePath", "/no_def_idir");
            map.AddBool("MkTypLibCompatible", "/mktyplib203");
            map.AddEnum("WarningLevel", null, "/W0", "/W1", "/W2", "/W3", "/W4");
            map.AddBool("WarnAsError", "/WX");
            map.AddEnum("DefaultCharType", null, "unsigned", "signed", "ascii7");
            map.AddEnum("TargetEnvironment", null, null, "win32", "win64");
            map.AddBool("GenerateStublessProxies", "/Oicf");

            // Output
            map.AddBool("GenerateTypeLibrary", "/notlb", "false");

            // Advanced

            map.AddEnum("EnableErrorChecks", "/error ", null, "none", "all");
            map.AddBool("ErrorCheckAllocations", "/error allocation");
            map.AddBool("ErrorCheckBounds", "/error bounds_check");
            map.AddBool("ErrorCheckEnumRange", "/error enum");
            map.AddBool("ErrorCheckRefPointers", "/error ref");
            map.AddBool("ErrorCheckStubData", "/error stub_data");
            map.AddBool("ValidateParameters", "/robust");
            map.AddEnum("StructMemberAlignment", null, null, "/Zp1", "/Zp2", "/Zp4", "/Zp8");
            return map;
        }