Beispiel #1
0
 public void ApplyFrom(DBuildArguments other)
 {
     IsDebug        = other.IsDebug;
     SoureCompiler  = other.SoureCompiler;
     Win32ExeLinker = other.Win32ExeLinker;
     ExeLinker      = other.ExeLinker;
     DllLinker      = other.DllLinker;
     LibLinker      = other.LibLinker;
 }
Beispiel #2
0
            /// <summary>
            /// (Re-)Sets all arguments back to what they were originally
            /// </summary>
            public static void ProvideDefaultBuildArguments(DBuildArguments args, bool DebugArguments = false)
            {
                string commonLinkerArgs = "";

                if (DebugArguments)
                {
                    commonLinkerArgs = "$objs -gc -debug ";

                    args.IsDebug       = true;
                    args.SoureCompiler = "-c \"$src\" -of\"$obj\" $importPaths -gc -debug";
                }
                else
                {
                    commonLinkerArgs = "$objs -release -O -inline ";

                    args.SoureCompiler = "-c \"$src\" -of\"$obj\" $importPaths -release -O -inline";
                }

                args.Win32ExeLinker = commonLinkerArgs + "-L/su:windows -L/exet:nt -of\"$exe\"";
                args.ExeLinker      = commonLinkerArgs + "-of\"$exe\"";
                args.DllLinker      = commonLinkerArgs + "-L/IMPLIB:$relativeTargetDir -of\"$dll\"";

                args.LibLinker = "-lib -of\"$lib\" $objs";
            }
Beispiel #3
0
        public void Load(XmlReader x)
        {
            if (x.LocalName != "dmd")
                return;

            if(x.MoveToAttribute("version"))
                Version = (DVersion)Convert.ToInt32( x.GetAttribute("version"));
            x.MoveToElement();

            var x2 = x.ReadSubtree();
            while (x2.Read())
            {
                switch (x2.LocalName)
                {
                    case "basedirectory":
                        baseDir = x2.ReadString();
                        break;
                    case "sourcecompiler":
                        SoureCompiler = x2.ReadString();
                        break;
                    case "exelinker":
                        ExeLinker = x2.ReadString();
                        break;
                    case "win32linker":
                        Win32ExeLinker = x2.ReadString();
                        break;
                    case "dlllinker":
                        DllLinker = x2.ReadString();
                        break;
                    case "liblinker":
                        LibLinker = x2.ReadString();
                        break;

                    case "buildarguments":
                        var args = new DBuildArguments();
                        args.Load(x2);
                        if (args.IsDebug)
                            DebugArgs = args;
                        else
                            ReleaseArgs = args;
                        break;

                    case "parsedDirectories":
                        if (x2.IsEmptyElement)
                            break;

                        var st = x2.ReadSubtree();
                        if(st!=null)
                            while (st.Read())
                            {
                                if (st.LocalName == "dir")
                                {
                                    var dir = st.ReadString();
                                    if(!string.IsNullOrWhiteSpace(dir))
                                        ASTCache.ParsedDirectories.Add(dir);
                                }
                            }
                        break;

                    case "DefaultLibs":
                        var xr2 = x2.ReadSubtree();
                        while (xr2.Read())
                        {
                            if (xr2.LocalName == "lib")
                            {
                                var libF = xr2.ReadString();
                                if(!DefaultLinkedLibraries.Contains(libF))
                                    DefaultLinkedLibraries.Add(libF);
                            }
                        }
                        break;
                }
            }

            // After having loaded the directory paths, parse them asynchronously
            ASTCache.BeginParse();
        }
Beispiel #4
0
 public void ApplyFrom(DBuildArguments other)
 {
     IsDebug = other.IsDebug;
     SoureCompiler = other.SoureCompiler;
     Win32ExeLinker = other.Win32ExeLinker;
     ExeLinker = other.ExeLinker;
     DllLinker = other.DllLinker;
     LibLinker = other.LibLinker;
 }
Beispiel #5
0
            /// <summary>
            /// (Re-)Sets all arguments back to what they were originally
            /// </summary>
            public static void ProvideDefaultBuildArguments(DBuildArguments args, bool DebugArguments = false)
            {
                string commonLinkerArgs = "";
                if (DebugArguments)
                {
                    commonLinkerArgs = "$objs -gc -debug ";

                    args.IsDebug = true;
                    args.SoureCompiler = "-c \"$src\" -of\"$obj\" $importPaths -gc -debug";
                }
                else
                {
                    commonLinkerArgs = "$objs -release -O -inline ";

                    args.SoureCompiler = "-c \"$src\" -of\"$obj\" $importPaths -release -O -inline";
                }

                args.Win32ExeLinker = commonLinkerArgs + "-L/su:windows -L/exet:nt -of\"$exe\"";
                args.ExeLinker = commonLinkerArgs + "-of\"$exe\"";
                args.DllLinker = commonLinkerArgs + "-L/IMPLIB:$relativeTargetDir -of\"$dll\"";

                args.LibLinker = "-lib -of\"$lib\" $objs";
            }
Beispiel #6
0
        public void Load(XmlReader x)
        {
            if (x.LocalName != "dmd")
            {
                return;
            }

            if (x.MoveToAttribute("version"))
            {
                Version = (DVersion)Convert.ToInt32(x.GetAttribute("version"));
            }
            x.MoveToElement();

            var x2 = x.ReadSubtree();

            while (x2.Read())
            {
                switch (x2.LocalName)
                {
                case "basedirectory":
                    baseDir = x2.ReadString();
                    break;

                case "sourcecompiler":
                    SoureCompiler = x2.ReadString();
                    break;

                case "exelinker":
                    ExeLinker = x2.ReadString();
                    break;

                case "win32linker":
                    Win32ExeLinker = x2.ReadString();
                    break;

                case "dlllinker":
                    DllLinker = x2.ReadString();
                    break;

                case "liblinker":
                    LibLinker = x2.ReadString();
                    break;

                case "buildarguments":
                    var args = new DBuildArguments();
                    args.Load(x2);
                    if (args.IsDebug)
                    {
                        DebugArgs = args;
                    }
                    else
                    {
                        ReleaseArgs = args;
                    }
                    break;

                case "parsedDirectories":
                    if (x2.IsEmptyElement)
                    {
                        break;
                    }

                    var st = x2.ReadSubtree();
                    if (st != null)
                    {
                        while (st.Read())
                        {
                            if (st.LocalName == "dir")
                            {
                                var dir = st.ReadString();
                                if (!string.IsNullOrWhiteSpace(dir))
                                {
                                    ASTCache.ParsedDirectories.Add(dir);
                                }
                            }
                        }
                    }
                    break;

                case "DefaultLibs":
                    var xr2 = x2.ReadSubtree();
                    while (xr2.Read())
                    {
                        if (xr2.LocalName == "lib")
                        {
                            var libF = xr2.ReadString();
                            if (!DefaultLinkedLibraries.Contains(libF))
                            {
                                DefaultLinkedLibraries.Add(libF);
                            }
                        }
                    }
                    break;
                }
            }

            // After having loaded the directory paths, parse them asynchronously
            ASTCache.BeginParse();
        }