| | |
| | | **
|
| | | ****************************************************************************/
|
| | |
|
| | | using Microsoft.VisualStudio.VCProjectEngine;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.IO;
|
| | | using System.Reflection;
|
| | | using Microsoft.VisualStudio.VCProjectEngine;
|
| | |
|
| | | namespace QtVsTools.Core
|
| | | {
|
| | |
| | | /// Using VCCLCompilerTool directly will break the VS integration for Win CE.
|
| | | class CompilerToolWrapper
|
| | | {
|
| | | private VCCLCompilerTool compilerTool;
|
| | | private readonly VCCLCompilerTool compilerTool;
|
| | | private readonly Object compilerObj;
|
| | | private readonly Type compilerType;
|
| | |
|
| | |
| | | return GetStringProperty("AdditionalIncludeDirectories");
|
| | | }
|
| | |
|
| | | public string GetPrecompiledHeaderFile()
|
| | | {
|
| | | if (compilerTool != null)
|
| | | return compilerTool.PrecompiledHeaderFile;
|
| | | return GetStringProperty("PrecompiledHeaderFile");
|
| | | }
|
| | |
|
| | | public string GetPrecompiledHeaderThrough()
|
| | | {
|
| | | if (compilerTool != null)
|
| | |
| | | if (obj == null)
|
| | | return pchOption.pchNone;
|
| | | return (pchOption)obj;
|
| | | }
|
| | |
|
| | | public void SetDebugInformationFormat(debugOption value)
|
| | | {
|
| | | if (compilerTool != null) {
|
| | | compilerTool.DebugInformationFormat = value;
|
| | | } else {
|
| | | compilerType.InvokeMember(
|
| | | "DebugInformationFormat",
|
| | | BindingFlags.SetProperty,
|
| | | null,
|
| | | compilerObj,
|
| | | new object[] { value });
|
| | | }
|
| | | }
|
| | |
|
| | | public runtimeLibraryOption RuntimeLibrary
|
| | |
| | | } else {
|
| | | compilerTool.RuntimeLibrary = value;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetOptimization(optimizeOption value)
|
| | | {
|
| | | if (compilerTool != null) {
|
| | | compilerTool.Optimization = value;
|
| | | } else {
|
| | | compilerType.InvokeMember(
|
| | | "Optimization",
|
| | | BindingFlags.SetProperty,
|
| | | null,
|
| | | compilerObj,
|
| | | new object[] { value });
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetTreatWChar_tAsBuiltInType(bool value)
|
| | | {
|
| | | if (compilerTool != null) {
|
| | | compilerTool.TreatWChar_tAsBuiltInType = value;
|
| | | } else {
|
| | | compilerType.InvokeMember(
|
| | | "TreatWChar_tAsBuiltInType",
|
| | | BindingFlags.SetProperty,
|
| | | null,
|
| | | compilerObj,
|
| | | new object[] { value });
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetPrecompiledHeaderFile(string file)
|
| | | {
|
| | | if (compilerTool != null) {
|
| | | compilerTool.PrecompiledHeaderFile = file;
|
| | | } else {
|
| | | compilerType.InvokeMember(
|
| | | "PrecompiledHeaderFile",
|
| | | BindingFlags.SetProperty,
|
| | | null,
|
| | | compilerObj,
|
| | | new object[] { file });
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetPrecompiledHeaderThrough(string value)
|
| | | {
|
| | | if (compilerTool != null) {
|
| | | compilerTool.PrecompiledHeaderThrough = value;
|
| | | } else {
|
| | | compilerType.InvokeMember(
|
| | | "PrecompiledHeaderThrough",
|
| | | BindingFlags.SetProperty,
|
| | | null,
|
| | | compilerObj,
|
| | | new object[] { value });
|
| | | }
|
| | | }
|
| | |
|