Ejemplo n.º 1
0
        private void buildBoost_1_51_0_x64(string destinationFolder)
        {
            Process          p    = new Process();
            ProcessStartInfo info = CreateVisualStudioCommandPromptProcessStartInfo(compilerType, platform);

            info.RedirectStandardInput  = true;
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;
            info.WindowStyle            = ProcessWindowStyle.Hidden;

            p.StartInfo = info;
            p.Start();

            using (StreamWriter sw = p.StandardInput)
            {
                if (sw.BaseStream.CanWrite)
                {
                    if (compilerType == eCompiler.VS2010)
                    {
                        eBoostVersion version           = boostVersion;
                        string        extractFolderName = BoostInfo.GetBoostInfo(version).ExtractFolderName;

                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName); //"boost_1_51_0-x64");
                        sw.WriteLine("bootstrap");
                        sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-10.0 address-model=64 --build-type=complete stage");
                    }
                    else
                    {
                        eBoostVersion version           = boostVersion;
                        string        extractFolderName = BoostInfo.GetBoostInfo(version).ExtractFolderName;

                        // go to boost root directory
                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName);

                        // should work like this

                        //sw.WriteLine("bootstrap.bat");
                        //sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-11.0 address-model=64 --build-type=complete stage"); // todo find out number of cores...

                        // workaround

                        // change directory to boost_1_51_0-x64\tools\build\v2
                        string path = System.Windows.Forms.Application.StartupPath;
                        if (!File.Exists(Path.Combine(destinationFolder, extractFolderName, "b2.exe")) && File.Exists(Path.Combine(path, "b2.exe")))
                        {
                            File.Copy(Path.Combine(path, "b2.exe"), Path.Combine(destinationFolder, extractFolderName, "b2.exe"));
                        }

                        sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-11.0 address-model=64 --build-type=complete stage"); // todo find out number of cores...
                    }
                }
            }

            readStandardOutput(p);
            readStandardError(p);

            p.WaitForExit();
            p.Close();
        }
Ejemplo n.º 2
0
        BoostInfo(string filename, List <string> downloadURLDestinations, eBoostVersion version)
        {
            this.zipFilename = filename;
            foreach (string url in downloadURLDestinations)
            {
                this.downloadURLDestinations.Add(url);
            }

            this.version = version;
        }
Ejemplo n.º 3
0
        public static string BoostVersionToString(eBoostVersion version)
        {
            switch (version)
            {
            case eBoostVersion.Boost1_44_0:
                return("1.44.0");

            case eBoostVersion.Boost1_51_0:
                return("1.51.0");

            case eBoostVersion.Boost1_52_0:
                return("1.52.0");

            case eBoostVersion.Boost1_53_0:
                return("1.53.0");

            case eBoostVersion.Boost1_54_0:
                return("1.54.0");

            case eBoostVersion.Boost1_55_0:
                return("1.55.0");

            case eBoostVersion.Boost1_56_0:
                return("1.56.0");

            case eBoostVersion.Boost1_57_0:
                return("1.57.0");

            case eBoostVersion.Boost1_58_0:
                return("1.58.0");

            case eBoostVersion.Boost1_59_0:
                return("1.59.0");

            case eBoostVersion.Boost1_60_0:
                return("1.60.0");

            case eBoostVersion.Boost1_61_0:
                return("1.61.0");

            case eBoostVersion.Boost1_62_0:
                return("1.62.0");

            case eBoostVersion.Boost1_63_0:
                return("1.63.0");

            case eBoostVersion.Boost1_75_0:
                return("1.75.0");

            case eBoostVersion.FromSourceSVN:
                return("From Source (SVN)");
            }

            throw new Exception("Unknown boost version");
        }
Ejemplo n.º 4
0
        public static string GetBoostZipFileName(eBoostVersion version)
        {
            foreach (BoostInfo bi in CreateInfoList())
            {
                if (bi.version == version)
                {
                    return(bi.ZIPFilename);
                }
            }

            throw new Exception("Unknown boost version");
        }
Ejemplo n.º 5
0
        public static string GetDownloadURL(eBoostVersion version)
        {
            foreach (BoostInfo info in CreateInfoList())
            {
                if (info.version == version)
                {
                    return(info.DownloadURL);
                }
            }

            throw new Exception("Unknown boost version.");
        }
Ejemplo n.º 6
0
        public static BoostInfo GetBoostInfo(eBoostVersion version)
        {
            foreach (BoostInfo info in CreateInfoList())
            {
                if (info.version == version)
                {
                    return(new BoostInfo(info.ZIPFilename, info.downloadURLDestinations, info.version)); // hand back a copy
                }
            }

            throw new Exception("Unknown boost version.");
        }
Ejemplo n.º 7
0
            public void DownloadBoost()
            {
                try
                {
                    eBoostVersion boostVersion = eBoostVersion.Boost1_52_0;

                    string destinationFolder = GlobalVariables.destinationFolder + @"DownloadBoost\";

                    if (!Directory.Exists(destinationFolder))
                    {
                        Directory.CreateDirectory(destinationFolder);
                    }

                    string boostDownloadURL = BoostInfo.GetDownloadURL(boostVersion);
                    string boostZIPFilename = BoostInfo.GetBoostZipFileName(boostVersion);

                    // Download boost
                    // Check if URL is valid
                    bool validUrl = DownloadHelper.RemoteFileExists(boostDownloadURL);
                    Assert.True(validUrl);

                    DownloadHelper.DownloadFileFromURL(boostDownloadURL, destinationFolder + boostZIPFilename);

                    if (boostVersion == eBoostVersion.Boost1_51_0)
                    {
                        FileInfo fi         = new FileInfo(destinationFolder + boostZIPFilename);
                        long     fileLength = fi.Length;

                        Assert.True(fileLength == 91365553);
                    }

                    if (boostVersion == eBoostVersion.Boost1_52_0)
                    {
                        FileInfo fi         = new FileInfo(destinationFolder + boostZIPFilename);
                        long     fileLength = fi.Length;

                        Assert.True(fileLength == 95342510);
                    }

                    // Delete File
                    System.IO.File.Delete(destinationFolder + boostZIPFilename);
                }
                catch (System.Exception ex)
                {
                    Assert.True(false);
                }
            }
Ejemplo n.º 8
0
        private void buildBoost_1_52_0_AndLaterVersion()
        {
            Process          p    = new Process();
            ProcessStartInfo info = CreateVisualStudioCommandPromptProcessStartInfo(compilerType, platform);

            info.RedirectStandardInput  = true;
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;
            info.WindowStyle            = ProcessWindowStyle.Hidden;
            info.CreateNoWindow         = true;

            p.StartInfo = info;
            p.Start();

            using (StreamWriter sw = p.StandardInput)
            {
                if (sw.BaseStream.CanWrite)
                {
                    eBoostVersion version           = boostVersion;
                    string        extractFolderName = BoostInfo.GetBoostInfo(version).ExtractFolderName;

                    if (!File.Exists(Path.Combine(destinationFolder, extractFolderName, "b2.exe")) && File.Exists(Path.Combine(destinationFolder, extractFolderName, @"tools\build\v2", "b2.exe")))
                    {
                        File.Copy(Path.Combine(destinationFolder, extractFolderName, @"tools\build\v2", "b2.exe"), Path.Combine(destinationFolder, extractFolderName, "b2.exe"));
                    }

                    sw.WriteLine("cd /D " + destinationFolder + extractFolderName);

                    if (platform == ePlatform.x64)
                    {
                        if (compilerType == eCompiler.VS2015)
                        {
                            if (version == eBoostVersion.Boost1_58_0)
                            {
                                sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --build-type=complete stage" + withLibraries);
                            }
                            else
                            {
                                sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-14.0 address-model=64 --build-type=complete stage" + withLibraries);
                            }
                        }
                        if (compilerType == eCompiler.VS2013)
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-12.0 address-model=64 --build-type=complete stage" + withLibraries); // -sBZIP2_SOURCE=C:\thirdparty\vs2012\x64\zlib-1.2.7");
                        }
                        else if (compilerType == eCompiler.VS2012)
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-11.0 address-model=64 --build-type=complete stage" + withLibraries); // -sBZIP2_SOURCE=C:\thirdparty\vs2012\x64\zlib-1.2.7");
                        }
                        else
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-10.0 address-model=64 --build-type=complete stage" + withLibraries);
                        }
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(platform == ePlatform.x86);

                        if (compilerType == eCompiler.VS2013)
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-12.0 address-model=32 --build-type=complete stage" + withLibraries);
                        }
                        else if (compilerType == eCompiler.VS2012)
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-11.0 address-model=32 --build-type=complete stage" + withLibraries);
                        }
                        else
                        {
                            sw.WriteLine(@".\b2 -j" + Math.Max(2, coreCount) + " --toolset=msvc-10.0 address-model=32 --build-type=complete stage" + withLibraries);
                        }
                    }
                }
            }

            readStandardOutput(p);
            readStandardError(p);

            p.WaitForExit();
            p.Close();
        }
Ejemplo n.º 9
0
        private void bootstrapBoost_1_52_0_AndLaterVersion()
        {
            Process p = new Process();

            ProcessStartInfo info = null;

            if (compilerType == eCompiler.VS2015 ||
                compilerType == eCompiler.VS2013)
            {
                if (platform == ePlatform.x64)
                {
                    info = new ProcessStartInfo("cmd.exe", @"%comspec% /k """ + Compiler.GetCompilerPath(compilerType) + @"\VC\vcvarsall.bat"" amd64");
                }
                else if (platform == ePlatform.x86)
                {
                    info = new ProcessStartInfo("cmd.exe", @"%comspec% /k """ + Compiler.GetCompilerPath(compilerType) + @"\VC\vcvarsall.bat"" x86");
                }
                else
                {
                    throw new Exception("Unknown platform.");
                }
            }
            else if (compilerType == eCompiler.VS2012)
            {
                info = new ProcessStartInfo("cmd.exe");
            }
            else
            {
                throw new Exception("Unknown compiler.");
            }

            info.RedirectStandardInput  = true;
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;
            info.WindowStyle            = ProcessWindowStyle.Hidden;

            p.StartInfo = info;
            p.Start();

            using (StreamWriter sw = p.StandardInput)
            {
                if (sw.BaseStream.CanWrite)
                {
                    eBoostVersion version           = boostVersion;
                    string        extractFolderName = BoostInfo.GetBoostInfo(version).ExtractFolderName;
                    if (Directory.Exists(destinationFolder + extractFolderName + @"\tools\build\v2"))
                    {
                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName + @"\tools\build\v2");
                    }
                    else
                    {
                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName);
                    }
                    sw.WriteLine("bootstrap");
                }
            }

            readStandardOutput(p);
            readStandardError(p);

            p.WaitForExit();
            p.Close();
        }
Ejemplo n.º 10
0
 BoostInfo(string filename, string downloadURL, eBoostVersion version)
 {
     this.zipFilename = filename;
     downloadURLDestinations.Add(downloadURL);
     this.version = version;
 }