|
| 1 | +// Copyright (c) Ubisoft. All Rights Reserved. |
| 2 | +// Licensed under the Apache 2.0 License. See LICENSE.md in the project root for license information. |
| 3 | + |
| 4 | +using Sharpmake; |
| 5 | + |
| 6 | +namespace JumboBuild |
| 7 | +{ |
| 8 | + [Sharpmake.Generate] |
| 9 | + public class JumboBuildProject : Project |
| 10 | + { |
| 11 | + public JumboBuildProject() |
| 12 | + { |
| 13 | + Name = "JumboBuild"; |
| 14 | + |
| 15 | + AddTargets(new Target( |
| 16 | + Platform.win32 | Platform.win64, |
| 17 | + DevEnv.vs2019, |
| 18 | + Optimization.Debug | Optimization.Release |
| 19 | + )); |
| 20 | + |
| 21 | + SourceRootPath = @"[project.SharpmakeCsPath]\codebase"; |
| 22 | + } |
| 23 | + |
| 24 | + [Configure] |
| 25 | + public void ConfigureAll(Configuration conf, Target target) |
| 26 | + { |
| 27 | + conf.ProjectFileName = "[project.Name]_[target.DevEnv]_[target.Platform]"; |
| 28 | + conf.ProjectPath = @"[project.SharpmakeCsPath]\projects"; |
| 29 | + |
| 30 | + conf.Defines.Add("_HAS_EXCEPTIONS=0"); |
| 31 | + |
| 32 | + conf.CustomProperties.Add("CustomOptimizationProperty", $"Custom-{target.Optimization}"); |
| 33 | + |
| 34 | + conf.Options.Add(Options.Vc.Compiler.JumboBuild.Enable); |
| 35 | + conf.MaxFilesPerJumboFile = 0; |
| 36 | + conf.MinFilesPerJumboFile = 2; |
| 37 | + conf.MinJumboFiles = 1; |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + [Sharpmake.Generate] |
| 42 | + public class JumboBuildSolution : Sharpmake.Solution |
| 43 | + { |
| 44 | + public JumboBuildSolution() |
| 45 | + { |
| 46 | + Name = "JumboBuild"; |
| 47 | + |
| 48 | + AddTargets(new Target( |
| 49 | + Platform.win32 | Platform.win64, |
| 50 | + DevEnv.vs2019, |
| 51 | + Optimization.Debug | Optimization.Release |
| 52 | + )); |
| 53 | + } |
| 54 | + |
| 55 | + [Configure()] |
| 56 | + public void ConfigureAll(Configuration conf, Target target) |
| 57 | + { |
| 58 | + conf.SolutionFileName = "[solution.Name]_[target.DevEnv]_[target.Platform]"; |
| 59 | + conf.SolutionPath = @"[solution.SharpmakeCsPath]\projects"; |
| 60 | + conf.AddProject<JumboBuildProject>(target); |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + public static class Main |
| 65 | + { |
| 66 | + [Sharpmake.Main] |
| 67 | + public static void SharpmakeMain(Sharpmake.Arguments arguments) |
| 68 | + { |
| 69 | + KitsRootPaths.SetUseKitsRootForDevEnv(DevEnv.vs2019, KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_19041_0); |
| 70 | + arguments.Generate<JumboBuildSolution>(); |
| 71 | + } |
| 72 | + } |
| 73 | +} |
0 commit comments