HaxeFoundation / hxcpp

Runtime files for c++ backend for haxe
Other
295 stars 184 forks source link

HXCPP_CXX_STANDARD Define #1124

Open Aidan63 opened 2 months ago

Aidan63 commented 2 months ago

This has been on my list for a while, but with the C++17 define merge which recently went through it seems like a good time to bring it up.

Instead of having an ever growing list of defines for all the C++ versions I think having a define allowing you to specify the version would be better. E.g. -D HXCPP_CXX_STANDARD=14 to use C++14. One downside to this is that hxcpp xml only allows || in its if and unless tags, might need to add general comparisons to make it really useful.

<section if="${HXCPP_CXX_STANDARD} >= 17">
</section>