Fix code project files generation to properly handle path slashes and ignore binary modules without exports

#3086
This commit is contained in:
Wojtek Figat
2025-01-27 19:35:27 +01:00
parent 72f16d738f
commit aabd70fbe7
2 changed files with 6 additions and 3 deletions

View File

@@ -301,7 +301,7 @@ namespace Flax.Build
else
project.Path = targets[0].CustomExternalProjectFilePath;
if (project.WorkspaceRootPath.StartsWith(rootProject.ProjectFolderPath))
project.GroupName = Utilities.MakePathRelativeTo(project.WorkspaceRootPath, rootProject.ProjectFolderPath);
project.GroupName = Utilities.NormalizePath(Utilities.MakePathRelativeTo(project.WorkspaceRootPath, rootProject.ProjectFolderPath));
else if (projectInfo != Globals.Project)
project.GroupName = projectInfo.Name;
project.SourceDirectories = new List<string>
@@ -349,7 +349,10 @@ namespace Flax.Build
var referenceBinaryModules = referenceModules.Keys.GroupBy(x => x.BinaryModuleName).ToArray();
foreach (var binaryModule in referenceBinaryModules)
{
project.Defines.Add(binaryModule.Key.ToUpperInvariant() + "_API=");
var binaryModuleName = binaryModule.Key;
if (string.IsNullOrEmpty(binaryModuleName))
continue;
project.Defines.Add(binaryModuleName.ToUpperInvariant() + "_API=");
}
}
catch

View File

@@ -409,7 +409,7 @@ namespace Flax.Build
var referencedBuild = buildData.FinReferenceBuildModule(dependencyModule.BinaryModuleName);
if (referencedBuild != null && !string.IsNullOrEmpty(referencedBuild.ManagedPath))
{
// Reference binary module build build for referenced target
// Reference binary module build for referenced target
fileReferences.Add(referencedBuild.ManagedPath);
}
}