Native Extensions conditional compilation based on engine version

Hello,

I would like, in a native extension, to have conditional compilation based on the engine version. As far as I can tell, there’s no engine version define available in the build process.

What’s the intended way to achieve this? Is there anything else I can use to infer the engine version?

The first question is, what would you use it forspecifically?

Instead of having multiple versions of the extension, targeting different versions of the engine, I would have a single version of the extension. This unique version of the extension would use the correct engine api based on the engine version.

But what parts of the engine would you “target”?
We rarely break api’s in our sdk, so I’m still not sure what you would actually use it for?

We encourage you use versioning in your extension releases (e.g. on GitHub), to keep the versions apart. And the latest version would support the latest Defold version.
That’s how we setup all our extensions.

3 Likes