Skip to content

Commit

Permalink
Add new TranslateIncludes option in Options.Vc for vs2019+
Browse files Browse the repository at this point in the history
  • Loading branch information
belkiss committed Aug 13, 2021
1 parent e1999e8 commit 506aa1d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sharpmake.Generators/FastBuild/Bff.Template.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ public static class ConfigurationFile
+ ' /errorReport:queue'
// Character Set
// ---------------------------
+ ' [cmdLineOptions.TranslateIncludes]'
+ ' [cmdLineOptions.CharacterSet]'
// Additional compiler options
//--------------------------
Expand Down
5 changes: 5 additions & 0 deletions Sharpmake.Generators/VisualStudio/ProjectOptionsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,11 @@ private void GenerateCompilerOptions(IGenerationContext context, ProjectOptionsG
Options.Option(Options.Vc.General.DiagnosticsFormat.ColumnInfo, () => { context.Options["DiagnosticsFormat"] = "Column"; context.CommandLineOptions["DiagnosticsFormat"] = "/diagnostics:column"; })
);

context.SelectOption
(
Options.Option(Options.Vc.General.TreatAngleIncludeAsExternal.Enable, () => { context.Options["TreatAngleIncludeAsExternal"] = "true"; context.CommandLineOptions["TreatAngleIncludeAsExternal"] = "/external:anglebrackets"; }),
Options.Option(Options.Vc.General.TreatAngleIncludeAsExternal.Disable, () => { context.Options["TreatAngleIncludeAsExternal"] = FileGeneratorUtilities.RemoveLineTag; context.CommandLineOptions["TreatAngleIncludeAsExternal"] = FileGeneratorUtilities.RemoveLineTag; })
);

context.Options["TrackFileAccess"] = FileGeneratorUtilities.RemoveLineTag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public abstract partial class BasePlatform
<ConfigurationType>[options.ConfigurationType]</ConfigurationType>
<UseDebugLibraries>[options.UseDebugLibraries]</UseDebugLibraries>
<PreferredToolArchitecture>[options.PreferredToolArchitecture]</PreferredToolArchitecture>
<TranslateIncludes>[options.TranslateIncludes]</TranslateIncludes>
<CharacterSet>[options.CharacterSet]</CharacterSet>
<UseOfMfc>[options.UseOfMfc]</UseOfMfc>
<CLRSupport>[clrSupport]</CLRSupport>
Expand Down
13 changes: 13 additions & 0 deletions Sharpmake/Options.Vc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ public enum WindowsTargetPlatformVersion
Latest, // latest available in host machine
}

/// <summary>
/// Translate Includes to Imports
/// </summary>
/// <remarks>
/// Enables the compiler to translate #include directives into import directives for the available header units. (/translateInclude)
/// </remarks>
public enum TranslateIncludes
{
Enable,
[Default]
Disable
}

/// <summary>
/// Character Set
/// </summary>
Expand Down

0 comments on commit 506aa1d

Please sign in to comment.