Allar's Blog

Allar's Blog

UE4 4.15 to 4.16 ReadOnlyTargetRules Backwards Compatibility

If you're a marketplace plugin maintainer and would like to maintain backward compatibility between 4.16 and 4.15, you've most likely run into the issue of the change of module target files moving to a ReadOnlyTargetRules constructor.

Epic has provided an undocumented preprocessor to help govern this change.

#if WITH_FORWARDED_MODULE_RULES_CTOR
    public Linter(ReadOnlyTargetRules Target) : base(Target)
#else
    public Linter(TargetInfo Target)
#endif

WITH_FORWARDED_MODULE_RULES_CTOR will be defined if on 4.16 or later.