1、*.Target.cs
需要对TargetRules的构造函数进行修改,增加:
// Compile out references from Core to the rest of the engine
bCompileAgainstEngine = true;
2、*.Build.cs
1)添加对执行 Module 的源文件依赖,自动添加所依赖 Module 的 Public
和 Private
源文件包含,因为用了Private,所以所依赖的 Module 中的源文件只可以在 Private
中使用。
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
...
2)可以根据目标的编译配置进行模块添加或宏定义,比如:
if ((Target.Platform == UnrealTargetPlatform.Win32) ||
(Target.Platform == UnrealTargetPlatform.Win64) ||
(Target.IsInPlatformGroup(UnrealPlatformGroup.Linux) && Target.Type != TargetType.Server))
{
// TODO: re-enable after implem