Fix VC++ project file building on macOS Rider

This commit is contained in:
2025-04-20 01:11:29 +03:00
parent c40c31fbb7
commit c7be6f6e0e

View File

@@ -114,6 +114,7 @@ namespace Flax.Build.Projects.VisualStudio
if (Version >= VisualStudioVersion.VisualStudio2022) if (Version >= VisualStudioVersion.VisualStudio2022)
vcProjectFileContent.AppendLine(" <ResolveNuGetPackages>false</ResolveNuGetPackages>"); vcProjectFileContent.AppendLine(" <ResolveNuGetPackages>false</ResolveNuGetPackages>");
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux'))\">./</VCTargetsPath>"); vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Linux'))\">./</VCTargetsPath>");
vcProjectFileContent.AppendLine(" <VCTargetsPath Condition=\"$(Configuration.Contains('Mac'))\">./</VCTargetsPath>");
vcProjectFileContent.AppendLine(" </PropertyGroup>"); vcProjectFileContent.AppendLine(" </PropertyGroup>");
// Default properties // Default properties
@@ -376,9 +377,9 @@ namespace Flax.Build.Projects.VisualStudio
vcUserFileContent.AppendLine("</Project>"); vcUserFileContent.AppendLine("</Project>");
if (platforms.Any(x => x.Target == TargetPlatform.Linux)) if (platforms.Any(x => x.Target == TargetPlatform.Linux || x.Target == TargetPlatform.Mac))
{ {
// Override MSBuild .targets file with one that runs NMake commands (workaround for Rider on Linux) // Override MSBuild .targets file with one that runs NMake commands (workaround for Rider not finding "Microsoft.Cpp.Default.props" file)
var cppTargetsFileContent = new StringBuilder(); var cppTargetsFileContent = new StringBuilder();
cppTargetsFileContent.AppendLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" TreatAsLocalProperty=\"Platform\">"); cppTargetsFileContent.AppendLine("<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" TreatAsLocalProperty=\"Platform\">");
cppTargetsFileContent.AppendLine(" <Target Name=\"Build\">"); cppTargetsFileContent.AppendLine(" <Target Name=\"Build\">");