mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Files
930e33cb4873ae02027182feb2c779fed4085a1f
30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
INTSourceChangelist:3372845
|
|||
Availability:Public
|
|||
Title:虚幻编译系统模块文件
|
|||
Crumbs: %ROOT%, Programming, Programming\UnrealBuildSystem
|
|||
Description:虚幻编译系统编译目标时使用的目标文件引用。
|
|||
Version:4.16
|
|||
|
|||
[TOC (start:2 end:3)]
|
|||
|
|||
### 总览
|
|||
|
|||
模块是 UE4 的编译块。引擎作为模块的一个大集合而实现,而游戏则提供其自身的模块进行扩大。每个模块都封装了一套功能,可提供一个公共接口和编译环境(利用宏、包含路径等),以便其他模块使用。
|
|||
|
|||
模块通过带 .build.cs 扩展名的 C# 源文件进行声明,保存在项目的 *Source* 目录下。属于模块的 C++ 源代码保存在 .build.cs 文件旁,或其子目录中。每个 .build.cs 文件声明派生自 ModuleRules 基类的类,并设置属性控制器从构造函数进行编译的方式。这些 .build.cs 文件由虚幻编译工具编译,并被构造来确定整体编译环境。
|
|||
|
|||
.build.cs 文件的典型结构如下。
|
|||
|
|||
using UnrealBuildTool;
|
|||
using System.Collections.Generic;
|
|||
|
|||
public class MyModule :ModuleRules
|
|||
{
|
|||
public MyModule(ReadOnlyTargetRules Target) : base(Target)
|
|||
{
|
|||
// Settings go here
|
|||
}
|
|||
}
|
|||
|
|||
[INCLUDE:Programming/UnrealBuildSystem/ModuleFiles/ModuleFilesProperties]
|