Detect build type (Debug/Release) in Build.cs file

Hello World.

I need to distinguish between Debug and Release builds of my game.

Situation:
i tried to link third party library witch has two versions of prebuild .lib’s Debug/Release. So, in case of Debug build i need to link Debug version of library, and, in case of Release build i need to link release version of lib.

I need something line this in my module Build.cs file:
if(Debug) { PublicAdditionalLibraries.Add(“tpDebug.lib”); }else{ PublicAdditionalLibraries.Add(“tpRelease.lib”); }

How to achieve this?

2 Likes

Currently, i do it like this:
switch (Target.Configuration)
{
case UnrealTargetConfiguration.DebugGame:
case UnrealTargetConfiguration.Debug:
case UnrealTargetConfiguration.Development:
buildType = “Debug”;
break;

   default:
                        buildType = "Release";
                        break;

}

But i don’t know if this correct approach

1 Like

Can you give more info? Where is this code defined? How does the function signature look like?