UE4中 -skipbuild -nocompile 有什么区别

在项目开发中,我看到了在调用 Engine\\Build\\BatchFiles\\RunUAT.bat 相关的命令行中,有 -skipbuild、 -nocompile 两个很像的参数,于是想探究一下它们的区别与含义。

-skipbuild 参数

到底有没有 -skipbuild 这个参数?根据 https://blog.csdn.net/u010385624/article/details/89916184 的介绍,有skip这个参数,但没有搜索到 -skipbuild 这个参数。我们可以在 AutomationTool.ProjectParams 看到所有的命令行传参,其中只有

CommandUtils.LogLog("Build={0}", Build);

CommandUtils.LogLog("SkipBuildClient={0}", SkipBuildClient);

CommandUtils.LogLog("SkipBuildEditor={0}", SkipBuildEditor);

但是,在这里发现了有skipbuild开关。

复制代码
this.Build = GetParamValueIfNotSpecified(Command, Build, this.Build, "build");
bool bSkipBuild = GetParamValueIfNotSpecified(Command, null, false, "skipbuild");
if (bSkipBuild)
{
	this.Build = false;
}

验证方式:如果同时传 -skipbuild 和 -build ,就会发现后文中的 Project.Build 无法进入到Build方法中。

-build 开关的含义

AutomationTool.ProjectParams.Build

作用1:AutomationTool.ProjectParams.AutodetectSettings

复制代码
else if (!this.Build) // 如果不选build,那么就自动重置Target
{
    var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath);
    GameTarget = Client ? (ShortName + "Client") : ShortName;
    EditorTarget = ShortName + "Editor";
    ServerTarget = ShortName + "Server";
}

作用2:一个限制验证(AutomationTool.ProjectParams.Validate),具体含义暂不解释。

复制代码
if (Build && !HasCookedTargets && !HasEditorTargets && !HasProgramTargets)
{
    throw new AutomationException("-build is specified but there are no targets to build.");
}

作用3:决定了是否运行 Project.Build。对应的日志是:

********** BUILD COMMAND STARTED **********

调试时的注意事项

根据我之前写的博文(UE4如何调试BuildCookRun_ue 的 automationtool如何debug-CSDN博客), UAT的调试对应的是:

要注意,只有BuildCookRun命令才有ProjectParams的解析,而UBT的调试中,不会涉及ProjectParams 的解析,因此调试时不要断点到那里去了。

未完待续

相关推荐
Yuk丶3 天前
LPM的AI 角色三大核心技术实现:长效记忆、人格锁定、低延迟口语化
人工智能·ai·ue4·虚幻·ue4客户端开发
归真仙人5 天前
【UE】Lightmass可执行文件已经过时
ue5·游戏引擎·ue4·虚幻·unreal engine
DoomGT6 天前
Design - 一些免费图标网站
ue5·ue4·虚幻·虚幻引擎·unreal engine
归真仙人9 天前
【UE】VR一体机转场
ue5·ue4·vr·虚幻引擎·unreal engine
洋洋06179 天前
UE4/UE5 引擎常见面试题总结(1)
ue5·ue4
Yuk丶13 天前
UE4 与 UE5:技术差异深度解析
c++·ue5·游戏引擎·ue4·游戏程序·虚幻
晴夏。17 天前
unlua实现原理
游戏·ue5·ue4·lua·ue·unlua
晴夏。17 天前
UE Spawn出来的Actor的生命周期和管理方法
游戏·ue5·ue4·ue
晴夏。24 天前
UE原生第三人称相机源码分析
游戏·ue5·ue4·相机·ue·3c
Yuk丶1 个月前
Procedural Dialogue Engine - UE4程序化对话系统的技术实现
c++·游戏引擎·ue4·游戏程序·虚幻