Ejemplo n.º 1
0
        /// <summary>
        /// Sets up the parser options to work with the given Visual Studio toolchain.
        /// </summary>
        /// <param name="vsVersion">The version of Visual Studio to look for.</param>
        public void SetupMSVC(VisualStudioVersion vsVersion)
        {
            MicrosoftMode = true;
            Abi           = CppAbi.Microsoft;

            var clVersion = MSVCToolchain.GetCLVersion(vsVersion);

            ToolSetToUse = clVersion.Major * 10000000 + clVersion.Minor * 100000;

            if (!ForceClangToolchainLookup)
            {
                NoStandardIncludes = true;
                NoBuiltinIncludes  = true;

                vsVersion = MSVCToolchain.FindVSVersion(vsVersion);
                foreach (var include in MSVCToolchain.GetSystemIncludes(vsVersion))
                {
                    AddSystemIncludeDirs(include);
                }
            }

            // do not remove the CppSharp prefix becase the Mono C# compiler breaks
            if (!LanguageVersion.HasValue)
            {
                LanguageVersion = CppSharp.Parser.LanguageVersion.CPP14_GNU;
            }

            AddArguments("-fms-extensions");
            AddArguments("-fms-compatibility");
            AddArguments("-fdelayed-template-parsing");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets up the parser options to work with the given Visual Studio toolchain.
        /// </summary>
        /// <param name="vsVersion">The version of Visual Studio to look for.</param>
        public void SetupMSVC(VisualStudioVersion vsVersion)
        {
            MicrosoftMode = true;

            var clVersion = MSVCToolchain.GetCLVersion(vsVersion);

            ToolSetToUse = clVersion.Major * 10000000 + clVersion.Minor * 100000;

            // do not remove the CppSharp prefix becase the Mono C# compiler breaks
            if (!LanguageVersion.HasValue)
            {
                LanguageVersion = CppSharp.Parser.LanguageVersion.CPP14_GNU;
            }

            AddArguments("-fms-extensions");
            AddArguments("-fms-compatibility");
            AddArguments("-fdelayed-template-parsing");
        }
Ejemplo n.º 3
0
        /// Sets up the parser options to work with the given Visual Studio toolchain.
        public void SetupMSVC(VisualStudioVersion vsVersion = VisualStudioVersion.Latest)
        {
            MicrosoftMode      = true;
            NoBuiltinIncludes  = true;
            NoStandardIncludes = true;
            Abi          = CppAbi.Microsoft;
            ToolSetToUse = MSVCToolchain.GetCLVersion(vsVersion) * 10000000;

            addArguments("-fms-extensions");
            addArguments("-fms-compatibility");
            addArguments("-fdelayed-template-parsing");

            var includes = MSVCToolchain.GetSystemIncludes(vsVersion);

            foreach (var include in includes)
            {
                addSystemIncludeDirs(include);
            }
        }