Merge branch 'ignore-specific-warnings' of https://github.com/Tryibion/FlaxEngine into Tryibion-ignore-specific-warnings

This commit is contained in:
Wojtek Figat
2024-12-16 23:03:53 +01:00
4 changed files with 35 additions and 0 deletions

View File

@@ -256,6 +256,13 @@ namespace Flax.Build
#endif
if (buildOptions.ScriptingAPI.IgnoreMissingDocumentationWarnings)
args.Add("-nowarn:1591");
if (buildOptions.ScriptingAPI.IgnoreSpecificWarnings.Any())
{
foreach (var warningString in buildOptions.ScriptingAPI.IgnoreSpecificWarnings)
{
args.Add($"-nowarn:{warningString}");
}
}
// Optimizations prevent debugging, only enable in release builds by default
var optimize = optimizeAssembly.HasValue ? optimizeAssembly.Value : buildData.Configuration == TargetConfiguration.Release;

View File

@@ -235,6 +235,11 @@ namespace Flax.Build.NativeCpp
/// </summary>
public HashSet<string> Analyzers;
/// <summary>
/// The specific warnings to ignore.
/// </summary>
public HashSet<string> IgnoreSpecificWarnings;
/// <summary>
/// True if ignore compilation warnings due to missing code documentation comments.
/// </summary>
@@ -265,6 +270,7 @@ namespace Flax.Build.NativeCpp
FileReferences.AddRange(other.FileReferences);
Analyzers.AddRange(other.Analyzers);
IgnoreMissingDocumentationWarnings |= other.IgnoreMissingDocumentationWarnings;
IgnoreSpecificWarnings.AddRange(other.IgnoreSpecificWarnings);
}
}
@@ -338,6 +344,7 @@ namespace Flax.Build.NativeCpp
},
FileReferences = new HashSet<string>(),
Analyzers = new HashSet<string>(),
IgnoreSpecificWarnings = new HashSet<string>(),
};
/// <summary>

View File

@@ -125,6 +125,13 @@ namespace Flax.Build.Projects.VisualStudio
csProjectFileContent.AppendLine(" <AllowUnsafeBlocks>true</AllowUnsafeBlocks>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreMissingDocumentationWarnings)
csProjectFileContent.AppendLine(" <NoWarn>1591</NoWarn>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings.Any())
{
foreach (var warningString in configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings)
{
csProjectFileContent.AppendLine($" <NoWarn>{warningString}</NoWarn>");
}
}
csProjectFileContent.AppendLine(string.Format(" <DocumentationFile>{0}\\{1}.CSharp.xml</DocumentationFile>", outputPath, project.BaseName));
csProjectFileContent.AppendLine(" <UseVSHostingProcess>true</UseVSHostingProcess>");
csProjectFileContent.AppendLine(" </PropertyGroup>");
@@ -156,6 +163,13 @@ namespace Flax.Build.Projects.VisualStudio
csProjectFileContent.AppendLine(" <AllowUnsafeBlocks>true</AllowUnsafeBlocks>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreMissingDocumentationWarnings)
csProjectFileContent.AppendLine(" <NoWarn>1591</NoWarn>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings.Any())
{
foreach (var warningString in configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings)
{
csProjectFileContent.AppendLine($" <NoWarn>{warningString}</NoWarn>");
}
}
csProjectFileContent.AppendLine(string.Format(" <DocumentationFile>{0}\\{1}.CSharp.xml</DocumentationFile>", outputPath, project.BaseName));
csProjectFileContent.AppendLine(" <UseVSHostingProcess>true</UseVSHostingProcess>");
csProjectFileContent.AppendLine(" </PropertyGroup>");

View File

@@ -284,6 +284,13 @@ namespace Flax.Build.Projects.VisualStudio
csProjectFileContent.AppendLine(" <AllowUnsafeBlocks>true</AllowUnsafeBlocks>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreMissingDocumentationWarnings)
csProjectFileContent.AppendLine(" <NoWarn>1591</NoWarn>");
if (configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings.Any())
{
foreach (var warningString in configuration.TargetBuildOptions.ScriptingAPI.IgnoreSpecificWarnings)
{
csProjectFileContent.AppendLine($" <NoWarn>{warningString}</NoWarn>");
}
}
csProjectFileContent.AppendLine(string.Format(" <DocumentationFile>{0}\\{1}.CSharp.xml</DocumentationFile>", outputPath, project.BaseName));
csProjectFileContent.AppendLine(" <UseVSHostingProcess>true</UseVSHostingProcess>");