I was trying to add optimization flags to build my project. I came across this boolean
bOptimizeCode in https://github.com/EpicGames/UnrealEngine/blob/4.26/Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCToolChain.cs.
However, when I add
bOptimizeCode = true as part of my project’s .Build.cs or plugin’s .Build.cs files, I get the error - “error CS0103: The name ‘bOptimizeCode’ does not exist in the current context. UnrealBuildTool : error : Unable to compile source files.”
I don’t understand. The boolean is clearly being defined in the VCToolChain.cs source file, which means it must be valid. Any ideas/suggestions on what might be wrong here?
I tried on Windows and Mac, didn’t work on both.
Happy New year! and Cheers!