x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

```

 #if UNITY_5
 // do this
 #else
 // print unsupported
 #endif

```

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.

 Intermediate/ProjectFiles/ExampleProject.vcxproj:
 
 <None Include="..\..\Plugins\MyPlugin\Source\MyPlugin\MyPlugin.Build.cs" />

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.

Thanks,

~Tim Graupmann

Product Version: UE 4.12
Tags:
more ▼

asked Aug 10 '16 at 02:33 AM in C++ Programming

avatar image

tgraupmann
110 14 20 79

avatar image thronerbe May 31 '17 at 04:22 PM

Hi Tim,

Did you find a solution to this problem? I'm having the same problem.

avatar image tgraupmann May 31 '17 at 05:56 PM

Not yet...

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question