David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Unreal Build Configurations

13 Feb 2024, 16:59

We want to build our project such that the Shipping and Test version links to Release version of Noesis and other versions link to the Profile version.

We've tried trivially changing the existing Noesis build script (Noesis.build.cs) such that it chooses a different folder for each config
e.g. change this:
if (Target.Platform == UnrealTargetPlatform.Win64)
{
	PublicAdditionalLibraries.Add(Path.Combine(NoesisBasePath, "Lib", "windows_x86_64", "Noesis.lib"));

	string NoesisDllPath = Path.Combine(NoesisBasePath, "Bin", "windows_x86_64", "Noesis.dll");
	string NoesisDllTargetPath = Path.Combine("$(BinaryOutputDir)", "Noesis.dll");

	RuntimeDependencies.Add(NoesisDllTargetPath, NoesisDllPath, StagedFileType.NonUFS);
}
to this:
    
 string ConfigurationFolder = "profile"; 
 if (Target.Configuration == UnrealTargetConfiguration.Shipping || Target.Configuration == UnrealTargetConfiguration.Test)
 {
     ConfigurationFolder = "release";
 }


if (Target.Platform == UnrealTargetPlatform.Win64)
{
        PublicAdditionalLibraries.Add(Path.Combine(NoesisBasePath, "Lib", "windows_x86_64", ConfigurationFolder, "Noesis.lib"));
        
        string NoesisDllPath = Path.Combine(NoesisBasePath, "Bin", "windows_x86_64", ConfigurationFolder, "Noesis.dll");
        string NoesisDllTargetPath = Path.Combine("$(BinaryOutputDir)", "Noesis.dll");
        
        RuntimeDependencies.Add(NoesisDllTargetPath, NoesisDllPath, StagedFileType.NonUFS);
}
we get the build error
"Unable to merge actions 'Noesis.dll' and 'Noesis.dll': PrerequisiteItems, CommandArguments are different"

I think this is because the Editor is always built as Development and so when building a Shipping version of the game, it builds a Development version of the tools and both versions map Noesis.dll to the same path.

Any ideas on how to do this properly?
 
User avatar
hcpizzi
Site Admin
Posts: 321
Joined: 09 Feb 2012, 12:40

Re: Unreal Build Configurations

15 Feb 2024, 16:39

Hi David,

I haven't been able to reproduce you exact problem, but I've found a similar one. I think you're right in your assesment: multiple configurations of our dll have to coexist in the same directory. That means that having them called the same in different directories won't work.

What we've done is to give the dlls/libs suffixes based on the configuration, and use the following code:
		string ConfigurationSuffix = ""; 
		if (Target.Configuration == UnrealTargetConfiguration.Shipping || Target.Configuration == UnrealTargetConfiguration.Test)
		{
			ConfigurationSuffix = "_release";
		}

		if (Target.Platform == UnrealTargetPlatform.Win64)
		{
			PublicAdditionalLibraries.Add(Path.Combine(NoesisBasePath, "Lib", "windows_x86_64", "Noesis" + ConfigurationSuffix + ".lib"));

			string NoesisDllPath = Path.Combine(NoesisBasePath, "Bin", "windows_x86_64", "Noesis" + ConfigurationSuffix + ".dll");
			string NoesisDllTargetPath = Path.Combine("$(BinaryOutputDir)", "Noesis" + ConfigurationSuffix + ".dll");

			RuntimeDependencies.Add(NoesisDllTargetPath, NoesisDllPath, StagedFileType.NonUFS);
		}
We will probably name them Noesis_debug.dll, Noesis_profile.dll and leave plain Noesis.dll for the release configuration but, for now, name them as you wish.

Just to test your same scenario: how were you building the game to get that error?
 
David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Re: Unreal Build Configurations

20 Feb 2024, 12:58

I was using a custom bat file that calls RunUAT.bat - once for building the editor for cooking, and once to build the game
rem build Editor (always development config) - this gets used for cooking 
CALL ..\..\..\RunUAT BuildEditor -project=!PRJ!

rem build game
CALL ..\..\..\RunUAT BuildGame -project=!PRJ! -platform=!PLAT! -configuration=!CFG!
 
David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Re: Unreal Build Configurations

21 Feb 2024, 13:22

I've tried the script changes and it builds and Noesis_release.dll gets copied to Binaries/Win64 correctly

However when I try to run the game I get the system error box with:
"The code execution cannot proceed because Noesis.dll was not found"

So it looks like the game is still trying to load Noesis.dll instead of Noesis_release.dll - but I can't see how the name of the dll is determined
 
User avatar
hcpizzi
Site Admin
Posts: 321
Joined: 09 Feb 2012, 12:40

Re: Unreal Build Configurations

21 Feb 2024, 18:42

Did you just rename the DLL and LIB files? They need to be rebuilt with the changed name. The DLL name is in the associated LIB file, so just renaming them won't work.
 
David Jefferies
Topic Author
Posts: 27
Joined: 14 Jan 2021, 17:09

Re: Unreal Build Configurations

27 Feb 2024, 16:57

ah thanks - I'd been renaming them so will rebuild them instead

Who is online

Users browsing this forum: No registered users and 4 guests