Meson: Replace compiler mode with ordered enum

Created on 13 Jun 2019  路  4Comments  路  Source: mesonbuild/meson

Strings are bad in general. The ordering would be useful to prevent bugs like this one that #5483 fixes.

-        if mode in {'compile', 'preprocess'}:
+        if mode in {'compile', 'preprocess', 'link'}:

We could instead write mode >= mode0 to mean "any the modes starting with mode0", which would make such code a lot clearer.

CC @dcbaker @ePirat

Most helpful comment

I did not have time yet, but indeed I think doing #5483 first without the enums will be easier and then clean it up after that.

All 4 comments

I agree, if wanted, I can update my patch with that approach.

@ePirat sure, though I'm fine with it being a separate PR too.

@ePirat you taken any more look at this with or without #5483? #5496 I think will be easier to fix after this is done.

I did not have time yet, but indeed I think doing #5483 first without the enums will be easier and then clean it up after that.

Was this page helpful?
0 / 5 - 0 ratings