Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,16 @@ private void GenerateCompilerOptions(IGenerationContext context, ProjectOptionsG
Options.Option(Options.Vc.Compiler.EnableAsan.Enable, () => { context.Options["EnableASAN"] = "true"; context.CommandLineOptions["EnableASAN"] = "/fsanitize=address"; })
);

context.SelectOption
(
Options.Option(Options.Vc.Compiler.JumboBuild.Disable, () => { context.Options["JumboBuild"] = FileGeneratorUtilities.RemoveLineTag; context.Options["MaxFilesPerJumboFile"] = FileGeneratorUtilities.RemoveLineTag; }),
Options.Option(Options.Vc.Compiler.JumboBuild.Enable, () =>
{
context.Options["JumboBuild"] = "true";
context.Options["MaxFilesPerJumboFile"] = context.Configuration.MaxFilesPerJumboFile.ToString();
})
);

if (context.DevelopmentEnvironment.IsVisualStudio() && context.DevelopmentEnvironment >= DevEnv.vs2017)
{
//Options.Vc.Compiler.DefineCPlusPlus. See: https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ public abstract partial class BasePlatform
<WindowsTargetPlatformVersion>[options.WindowsTargetPlatformVersion]</WindowsTargetPlatformVersion>
<SpectreMitigation>[options.SpectreMitigation]</SpectreMitigation>
<EnableASAN>[options.EnableASAN]</EnableASAN>
<EnableUnitySupport>[options.JumboBuild]</EnableUnitySupport>
<MaxFilesInUnityFile>[options.MaxFilesPerJumboFile]</MaxFilesInUnityFile>
</PropertyGroup>
";

Expand Down
14 changes: 14 additions & 0 deletions Sharpmake/Options.Vc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,20 @@ public enum EnableAsan
[DevEnvVersion(minimum = DevEnv.vs2019)]
Enable
}

/// <summary>
/// Enable Jumbo/Unity builds
Comment thread
Say-Y marked this conversation as resolved.
Outdated
/// </summary>
/// <remarks>
/// Merges multiple translation units together
/// </remarks>
public enum JumboBuild
{
[Default]
Disable,
[DevEnvVersion(minimum = DevEnv.vs2019)]
Enable
}
}

public static class CodeAnalysis
Expand Down
3 changes: 3 additions & 0 deletions Sharpmake/Project.Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,9 @@ public string FastBuildUnityPath
/// </remarks>
public bool DoNotGenerateFastBuild = false;

// Jumbo builds support
Comment thread
Say-Y marked this conversation as resolved.
Outdated
public int MaxFilesPerJumboFile = 0;

// container for executable
/// <summary>
/// Represents a build step that invokes an executable on the file system.
Expand Down