⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cppnetcompilerparameters.cs

📁 c#源代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
				}
				if (IsNotEmpty(addModuleToAssembly)) 
				{
					AppendList(result, "/ASSEMBLYMODULE:", addModuleToAssembly);
				}
				if (IsNotEmpty(embedResourceToAssembly)) 
				{
					AppendList(result, "/ASSEMBLYRESOURCE:", embedResourceToAssembly);
				}
				if (IsNotEmpty(forcedSymbolLinks)) 
				{
					AppendList(result, "/INCLUDE:", forcedSymbolLinks);
				}
				if (IsNotEmpty(laterLoadedDLLs)) 
				{
					AppendList(result, "/DELAYLOAD:", laterLoadedDLLs);
				}
				return result.ToString();
			}
			
			public string AdditionalDependencies {
				get {
					return additionalDependencies;
				}
				set {
					additionalDependencies = value;
				}
			}
			
			public bool IgnoreStandardLibrary {
				get {
					return ignoreStandardLibrary;
				}
				set {
					ignoreStandardLibrary = value;
				}
			}
			public string IgnoreLibrary {
				get {
					return ignoreLibrary;
				}
				set {
					ignoreLibrary = value;
				}
			}
			public string ModuleDefinition {
				get {
					return moduleDefinition;
				}
				set {
					moduleDefinition = value;
				}
			}
			public string AddModuleToAssembly {
				get {
					return addModuleToAssembly;
				}
				set {
					addModuleToAssembly = value;
				}
			}
			public string EmbedResourceToAssembly {
				get {
					return embedResourceToAssembly;
				}
				set {
					embedResourceToAssembly = value;
				}
			}
			public string ForcedSymbolLinks {
				get {
					return forcedSymbolLinks;
				}
				set {
					forcedSymbolLinks = value;
				}
			}
			public string LaterLoadedDLLs {
				get {
					return laterLoadedDLLs;
				}
				set {
					laterLoadedDLLs = value;
				}
			}
			
		}
		#endregion
		
		#region Debug Linker Options
		[XmlNodeName("DebugLinkerOptions")]
		public class DebugLinkerOptions
		{
			[XmlAttribute("generateDebugInfo")]
			public bool generateDebugInfo = false;
			
			[XmlAttribute("generatedProgramDatabase")]
			public string generatedProgramDatabase = "";
			
			[XmlAttribute("removePrivateSymbols")]
			public string removePrivateSymbols = "";
			
			[XmlAttribute("generateMapFile")]
			public bool generateMapFile = false;
			
			[XmlAttribute("mapFile")]
			public string mapFile = "";
			
			[XmlAttribute("mapExport")]
			public bool mapExport = false;
			
			[XmlAttribute("mapLines")]
			public bool mapLines = false;
			
			[XmlAttribute("debuggableAssembly")]
			public DebuggableAssembly debuggableAssembly;
			
			public bool GenerateDebugInfo {
				get {
					return generateDebugInfo;
				}
				set {
					generateDebugInfo = value;
				}
			}
			public string GeneratedProgramDatabase {
				get {
					return generatedProgramDatabase;
				}
				set {
					generatedProgramDatabase = value;
				}
			}
			public string RemovePrivateSymbols {
				get {
					return removePrivateSymbols;
				}
				set {
					removePrivateSymbols = value;
				}
			}
			public bool GenerateMapFile {
				get {
					return generateMapFile;
				}
				set {
					generateMapFile = value;
				}
			}
			public string MapFile {
				get {
					return mapFile;
				}
				set {
					mapFile = value;
				}
			}
			public bool MapExport {
				get {
					return mapExport;
				}
				set {
					mapExport = value;
				}
			}
			public bool MapLines {
				get {
					return mapLines;
				}
				set {
					mapLines = value;
				}
			}
			public DebuggableAssembly DebuggableAssembly {
				get {
					return debuggableAssembly;
				}
				set {
					debuggableAssembly = value;
				}
			}
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
				
				if (generateDebugInfo)
				{
					result.Append("/DEBUG\n");
				}
			
				if (IsNotEmpty(generatedProgramDatabase))
				{
					result.Append("/PDB:");
					result.Append(generatedProgramDatabase);
					result.Append("\n");
				}
			
				if (IsNotEmpty(removePrivateSymbols))
				{
					result.Append("/PDBSTRIPPED:");
					result.Append(removePrivateSymbols);
					result.Append("\n");
				}
			
				if (generateMapFile)
				{
					result.Append("/MAP");
					if (IsNotEmpty(mapFile))
					{
						result.Append(":");
						result.Append(mapFile);
					}
					result.Append("\n");
					
				}
				
				if (mapExport)
				{
					result.Append("/MAPINFO:EXPORTS\n");
				}
			
				if (mapLines)
				{
					result.Append("/MAPINFO:LINES\n");
				}
				
				switch (debuggableAssembly) {
					case DebuggableAssembly.DontEmitDebuggable:
						break;
					case DebuggableAssembly.DisableDebugToRuntimEnableOptimization:
						result.Append("/ASSEMBLYDEBUG:DISABLE\n");
						break;
					case DebuggableAssembly.EnableDebugToRuntimeDisableOptimization:
						result.Append("/ASSEMBLYDEBUG\n");
						break;
				}
			
				return result.ToString();
			}
			
		}
		#endregion

		#region System Linker Options
		[XmlNodeName("SystemLinkerOptions")]
		public class SystemLinkerOptions
		{
			[XmlAttribute("linkerSubSystem")]
			public LinkerSubSystem linkerSubSystem = LinkerSubSystem.Unselected;
			
			[XmlAttribute("heapAllocationSize")]
			public int heapAllocationSize = 0;
			
			[XmlAttribute("heapCommitSize")]
			public int heapCommitSize = 0;
			
			[XmlAttribute("stackAllocationSize")]
			public int stackAllocationSize = 0;
			
			[XmlAttribute("stackCommitSize")]
			public int stackCommitSize= 0;
			
			[XmlAttribute("activateBigAddresses")]
			public ActivateBigAddresses activateBigAddresses = ActivateBigAddresses.Standard;
			
			[XmlAttribute("terminalServer")]
			public TerminalServer terminalServer = TerminalServer.Standard;
			
			[XmlAttribute("runFromCDROM")]
			public bool runFromCDROM = false;
			
			[XmlAttribute("runFromNetwork")]
			public bool runFromNetwork = false;
			
			public LinkerSubSystem LinkerSubSystem {
				get {
					return linkerSubSystem;
				}
				set {
					linkerSubSystem = value;
				}
			}
			public int HeapAllocationSize {
				get {
					return heapAllocationSize;
				}
				set {
					heapAllocationSize = value;
				}
			}
			public int HeapCommitSize {
				get {
					return heapCommitSize;
				}
				set {
					heapCommitSize = value;
				}
			}
			public int StackAllocationSize {
				get {
					return stackAllocationSize;
				}
				set {
					stackAllocationSize = value;
				}
			}
			public int StackCommitSize {
				get {
					return stackCommitSize;
				}
				set {
					stackCommitSize = value;
				}
			}
			public ActivateBigAddresses ActivateBigAddresses {
				get {
					return activateBigAddresses;
				}
				set {
					activateBigAddresses = value;
				}
			}
			public TerminalServer TerminalServer {
				get {
					return terminalServer;
				}
				set {
					terminalServer = value;
				}
			}
			public bool RunFromCDROM {
				get {
					return runFromCDROM;
				}
				set {
					runFromCDROM = value;
				}
			}
			public bool RunFromNetwork {
				get {
					return runFromNetwork;
				}
				set {
					runFromNetwork = value;
				}
			}
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();

				switch (LinkerSubSystem) {
					case LinkerSubSystem.Console:
						result.Append("/SUBSYSTEM:CONSOLE\n");
						break;
					case LinkerSubSystem.Unselected:
						break;
					case LinkerSubSystem.Windows:
						result.Append("/SUBSYSTEM:WINDOWS\n");
						break;
				}
			
				if (heapAllocationSize > 0) 
				{
					result.Append("/HEAP:");
					result.Append(heapAllocationSize);
					if (heapCommitSize > 0) 
					{
						result.Append(",");
						result.Append(heapCommitSize);
					}
					result.Append("\n");
				}

				if (stackAllocationSize > 0)
				{
					result.Append("/STACK:");
					result.Append(stackAllocationSize);
					if (stackCommitSize > 0) 
					{
						result.Append(",");
						result.Append(stackCommitSize);
					}
					result.Append("\n");
				}
				
				switch (ActivateBigAddresses) {
					case ActivateBigAddresses.NoSupport:
						result.Append("/LARGEADDRESSAWARE:NO\n");
						break;
					case ActivateBigAddresses.Standard:
						break;
					case ActivateBigAddresses.Supported:
						result.Append("/LARGEADDRESSAWARE\n");
						break;
				}
			
				switch (TerminalServer) {
					case TerminalServer.Bound:
						result.Append("/TSAWARE\n");
						break;
					case TerminalServer.NotBound:
						result.Append("/TSAWARE:NO\n");
						break;
					case TerminalServer.Standard:
						break;
				}
			
				if (runFromCDROM)
				{
					result.Append("/SWAPRUN:CD\n");
				}
			
				if (runFromNetwork)
				{
					result.Append("/SWAPRUN:NET\n");
				}
				
				return result.ToString();
			}
			
		}
		#endregion
		
		
		public bool PreCompileHeader {
			get {
				return preCompiledHeaderCPPOptions.PreCompileHeader;
			}
		}
			
		public string GetPreCompiledHeaderOptions()
		{
			return generalCPPOptions.GetCommandLineParameters() +
			       optimizeCPPOptions.GetCommandLineParameters() +
			       preProcessorCPPOptions.GetCommandLineParameters() +
			       codeGenerationCPPOptions.GetCommandLineParameters() +
			       languageCPPOptions.GetCommandLineParameters() +
			       preCompiledHeaderCPPOptions.GetCreatePreCompiledHeaderParameter() +
			       outputFileCPPOptions.GetCommandLineParameters() +
			       informationSearchCPPOptions.GetCommandLineParameters() +
			       extendedCPPOptions.GetCommandLineParameters();
		}
		
		public string GetCompilerOptions()
		{
			return generalCPPOptions.GetCommandLineParameters() +
			       optimizeCPPOptions.GetCommandLineParameters() +
			       preProcessorCPPOptions.GetCommandLineParameters() +
			       codeGenerationCPPOptions.GetCommandLineParameters() +
			       languageCPPOptions.GetCommandLineParameters() +
			       preCompiledHeaderCPPOptions.GetCommandLineParameters() +
			       outputFileCPPOptions.GetCommandLineParameters() +
			       informationSearchCPPOptions.GetCommandLineParameters() +
			       extendedCPPOptions.GetCommandLineParameters();
		}
		
		public string GetLinkerOptions()
		{
			return generalLinkerOptions.GetCommandLineParameters() +
			       inputLinkerOptions.GetCommandLineParameters() +
			       debugLinkerOptions.GetCommandLineParameters() +
			       systemLinkerOptions.GetCommandLineParameters();
		}
		
		public string GetLinkerOptionsForCompiler()
		{
			StringBuilder result = new StringBuilder();
			foreach (string val in GetLinkerOptions().Split('\n'))
			{
				result.Append(val);
				result.Append("\n");
			}
			return result.ToString();
		}
			
		public GeneralCPPOptions generalCPPOptions = new GeneralCPPOptions();
		public OptimizeCPPOptions optimizeCPPOptions = new OptimizeCPPOptions();
		public PreProcessorCPPOptions preProcessorCPPOptions     = new PreProcessorCPPOptions();
		public CodeGenerationCPPOptions codeGenerationCPPOptions = new CodeGenerationCPPOptions();
		public LanguageCPPOptions languageCPPOptions             = new LanguageCPPOptions();
		public PreCompiledHeaderCPPOptions preCompiledHeaderCPPOptions = new PreCompiledHeaderCPPOptions();
		public OutputFileCPPOptions outputFileCPPOptions = new OutputFileCPPOptions();
		public InformationSearchCPPOptions informationSearchCPPOptions = new InformationSearchCPPOptions();
		public ExtendedCPPOptions extendedCPPOptions = new ExtendedCPPOptions();
		
		public GeneralLinkerOptions generalLinkerOptions = new GeneralLinkerOptions();
		public InputLinkerOptions inputLinkerOptions = new InputLinkerOptions();
		public DebugLinkerOptions debugLinkerOptions = new DebugLinkerOptions();
		public SystemLinkerOptions systemLinkerOptions = new SystemLinkerOptions();
		
		MiscCPPOptions     miscCPPOptions                 = new MiscCPPOptions();
		
		public override string OutputDirectory {
			get {
				return miscCPPOptions.outputDirectory;
			}
			set {
				miscCPPOptions.outputDirectory = value;
			}
		}

		public string OutputFile {
			get {
				return generalLinkerOptions.OutputFile;
			}
			set {
				generalLinkerOptions.OutputFile = value;
			}
		}
		
		public string IntermediateDirectory {
			get {
				return miscCPPOptions.intermediateDirectory;
			}
			set {
				miscCPPOptions.intermediateDirectory = value;
			}
		}
		
		public ConfigurationType ConfigurationType {
			get {
				return miscCPPOptions.configurationType;
			}
			set {
				miscCPPOptions.configurationType = value;
			}
		}
		
		public bool UseManagedExtensions {
			get {
				return miscCPPOptions.useManagedExtensions;
			}
			set {
				miscCPPOptions.useManagedExtensions = value;
			}
		}
		
		public string AdditionalCompilerOptions {
			get {
				return miscCPPOptions.additionalCompilerOptions;
			}
			set {
				miscCPPOptions.additionalCompilerOptions = value;
			}
		}
		
//		public CPPCompilerParameters(string[] additionalCompilerOptions)
//		{
//			this.AdditionalCompilerOptions = additionalCompilerOptions;
//		}
		 
		public CPPCompilerParameters()
		{
		}
		
		public CPPCompilerParameters(string name)
		{
			this.name = name;
			
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -