Horde fails multi-configuration build task when using ConditionalAddModuleDirectory() to compile optional files.

So just for clarity now I realise I didn’t include this in the original post, the errors we see are essentially these:

`\OptionalCodeFolder\MyOptionalObject.h(#): fatal error C1083. Cannot open include file: ‘MyOptionalObject.generated.h’: No such file or directory.

\MyProject\Intermediatte\Build\Win64\x64\MyGameClient\Development\MyPlugin\Module.MyPlugin.2.cpp(#): fatal error C1083: Cannot open include file: ‘../../MyProject/Intermediate/Build/Win64/MyGameClient/Inc/MyPlugin/UHT/MyOptionalObject.gen.cpp’: No such file or directory`I’ve been told this is the Agent/Node we use

`


``RunUAT.bat BuildGraph -Script=Game/Build/BuildGame.xml -Target="Publish Targets" -SingleNode="Compile Targets Win64" -Set:GamePlatforms=Win64;Linux;XSX -Set:GameConfigs=Development;Test;Shipping -Set:ServerPlatforms=Win64;Linux;LinuxArm64 -Set:ServerConfigs=Development;Test;Shipping -Set:UseIncrementalCompileAgents=true`Let me know if that's not all the info you need. While scouring through the log, I notice it frequently switches back and forth between the different configurations.

** For MyGameServer-Win64-Shipping **

// do some work

** For MyGameServer-Win64-Test **

// do other work

etc..