Conditional compilation Openfl


#1

Hi !

Is there a way to say to compile depending on the version of openfl

like
if (openfl>= 4.1.1)
?


#2

Try this:

#if (openfl >= "4.1.1")

#end

This should work for any haxelib, be careful, though, that this is String comparison, so 1.10.0 is “smaller” than 1.2.0 since “1” is less than “2”

We avoid double-digit versions in OpenFL and Lime, though, to help avoid this problem


#3

Thanks , it works ! :slight_smile: