Does the UE4 C# tools compiler have predefined symbols?
Unity has a concept of Platform Dependent Compilation. https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
In your C# code you can check the particular version.
When generating project files, Unity will inject Define Constants into the C# project.
I'm asking if UE4 has something similar so that I can have custom version code in the Plugins\MyPlugin\Source\MyPlugin.Build.cs C# script.
There's a slightly different API for Unity 4.9, 4.11, and 4.12 with the build script and it would be great to support multiple versions so that users don't have to modify the plugin build script or see any compilation errors.
When generating the unreal project files the Build script is added to the C++ project as an include/no compile option.
Any symbols that are added are compiled into the UE4 Editor.
Ideally a tool would read the build version here: https://github.com/EpicGames/UnrealEngine/blob/4.12/Engine/Build/Build.version
And generate C# build symbols for UE4_12.
The build version could be checked at runtime. https://github.com/EpicGames/UnrealEngine/blob/master/Engine/Source/Programs/UnrealBuildTool/System/Utils.cs#L26
And through reflection, the build version could be used to invoke the intended API.
However, I intend to check the build version at compile time.
Your feedback is appreciated.
Follow this question
Once you sign in you will be able to subscribe for any updates here