forked from FlaxEngine/FlaxEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlaxEditor.Build.cs
74 lines (68 loc) · 2.6 KB
/
FlaxEditor.Build.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System.IO;
using Flax.Build;
using Flax.Build.NativeCpp;
/// <summary>
/// The Flax Editor target that builds a standalone editor application.
/// </summary>
public class FlaxEditor : EngineTarget
{
/// <inheritdoc />
public override void Init()
{
base.Init();
// Initialize
IsEditor = true;
OutputName = "FlaxEditor";
ConfigurationName = "Editor";
IsPreBuilt = false;
Platforms = new[]
{
TargetPlatform.Windows,
TargetPlatform.Linux,
TargetPlatform.Mac,
};
Architectures = new[]
{
TargetArchitecture.x64,
TargetArchitecture.ARM64,
};
GlobalDefinitions.Add("USE_EDITOR");
Win32ResourceFile = Path.Combine(Globals.EngineRoot, "Source", "FlaxEditor.rc");
Modules.Add("Editor");
Modules.Add("CSG");
Modules.Add("ShadowsOfMordor");
Modules.Add("ShadersCompilation");
Modules.Add("ContentExporters");
Modules.Add("ContentImporters");
}
/// <inheritdoc />
public override void SetupTargetEnvironment(BuildOptions options)
{
base.SetupTargetEnvironment(options);
// Setup output folder for Editor binaries
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
switch (options.Architecture)
{
case TargetArchitecture.x64:
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Win64", options.Configuration.ToString());
break;
case TargetArchitecture.x86:
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Win32", options.Configuration.ToString());
break;
default: throw new InvalidArchitectureException(options.Architecture, "Not supported Editor architecture.");
}
break;
case TargetPlatform.Linux:
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Linux", options.Configuration.ToString());
options.DependencyFiles.Add(Path.Combine(Globals.EngineRoot, "Source", "Logo.png"));
break;
case TargetPlatform.Mac:
options.OutputFolder = Path.Combine(options.WorkingDirectory, "Binaries", "Editor", "Mac", options.Configuration.ToString());
break;
default: throw new InvalidPlatformException(options.Platform.Target, "Not supported Editor platform.");
}
}
}