HaxeFoundation / HaxeManual

The official Haxe manual
https://haxe.org/manual/
Creative Commons Attribution 4.0 International
218 stars 154 forks source link

Conditional compilation version() function #530

Open joshtynjala opened 1 year ago

joshtynjala commented 1 year ago

https://haxe.org/manual/lf-condition-compilation.html#haxelibs

By default, each used haxelib version is automatically added as flag, e.g. when you add -L actuate, the compiler adds -D actuate=1.8.7. To test if a library exists in current context, use #if actuate. To check a specific haxelib version, use the operators, for example #if (actuate <= "1.8.7").

I've heard that #if (actuate <= version("1.8.7")) is better, but I can't seem to find version() documented anywhere in the manual. This seems like the place where I should be able to find it, though.