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 的解析,因此调试时不要断点到那里去了。

未完待续

相关推荐
Kin__Zhang6 天前
随手记录 UE4/CARLA 仿真器 segmentation fault
android·java·ue4
小江村儿的文杰7 天前
UE4在MacOS上将Commit.gitdeps.xml设为Git LFS文件的潜在弊端
xml·ue4
李岱诚12 天前
epic商城下载,ue4报错处理
游戏引擎·ue4
爆米花煮鸡蛋12 天前
UE4.27生成sln时失败:Missing .../DotNET/UnrealBuildTool/UnrealBuildTool/UnrealBuildTool.exe after build
ue4
海中有金12 天前
UE4 内存池浅谈[3]——3代内存池对比总观
ue4·图形渲染
询问QQ:6882388613 天前
Labview交通灯程序设计——机动车道与人行道绿灯时间设置带报告
ue4
倾心唯恋14 天前
更新Epic后通过工程路径和Epic双击打不开UE4项目,提示Failed to launch editor的解决办法
ue4
2501_9389313314 天前
UE4SS-RE 安装全指南:基础环境变量设置到高级跨版本部署适配
ue4
小宝哥Code14 天前
UE5在布局自定义上的UE4ClassicLayout.ini文件源码解读分析
java·ue5·ue4
T***u33315 天前
PHP在电商中的会员管理
开发语言·wireshark·php·ue4·jina