Add support for binary modules with native-code only
This commit is contained in:
@@ -23,6 +23,8 @@ namespace Flax.Build
|
||||
var buildOptions = buildData.TargetOptions;
|
||||
foreach (var binaryModule in buildData.BinaryModules)
|
||||
{
|
||||
if (binaryModule.All(x => !x.BuildCSharp))
|
||||
continue;
|
||||
var binaryModuleName = binaryModule.Key;
|
||||
using (new ProfileEventScope(binaryModuleName))
|
||||
{
|
||||
@@ -71,6 +73,7 @@ namespace Flax.Build
|
||||
var dependencyModule = buildData.Rules.GetModule(dependencyName);
|
||||
if (dependencyModule != null &&
|
||||
!string.IsNullOrEmpty(dependencyModule.BinaryModuleName) &&
|
||||
dependencyModule.BuildCSharp &&
|
||||
dependencyModule.BinaryModuleName != binaryModuleName &&
|
||||
buildData.Modules.TryGetValue(dependencyModule, out var dependencyModuleOptions))
|
||||
{
|
||||
|
||||
@@ -37,6 +37,11 @@ namespace Flax.Build
|
||||
/// </summary>
|
||||
public bool BuildNativeCode = true;
|
||||
|
||||
/// <summary>
|
||||
/// True if module has C# code to build. Can be used for native modules without C# bindings nor code.
|
||||
/// </summary>
|
||||
public bool BuildCSharp = true;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Module"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -831,6 +831,11 @@ namespace Flax.Build
|
||||
// C#-only binary module
|
||||
binaryModuleInfo.NativePath = string.Empty;
|
||||
}
|
||||
if (!binaryModule.Any(x => x.BuildCSharp))
|
||||
{
|
||||
// Skip C#
|
||||
binaryModuleInfo.ManagedPath = string.Empty;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetLinkType.Modular:
|
||||
@@ -850,6 +855,11 @@ namespace Flax.Build
|
||||
// C#-only binary module
|
||||
binaryModuleInfo.NativePath = string.Empty;
|
||||
}
|
||||
if (!module.BuildCSharp)
|
||||
{
|
||||
// Skip C#
|
||||
binaryModuleInfo.ManagedPath = string.Empty;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: throw new ArgumentOutOfRangeException();
|
||||
|
||||
Reference in New Issue
Block a user