Esempio 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();
        }
Esempio n. 2
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();
        }
Esempio n. 3
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();
        }