New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile flag order mixup #74
Comments
I think one solution is to not actually remove duplicates. Clang can handle duplicates, as long as the order is correct, this should be fine. |
However, duplicate flags can make the commands quite unreadable. |
I think the issue is that https://stackoverflow.com/questions/26420945/python-order-of-elements-in-set |
This might also be an issue for veeeery ugly projects where the order of the include folders matter, because that order is also mangled (see line 85): clang-build/clang_build/target.py Line 85 in c5d5c1b
|
I believe I had errors when the -std= flag appeared more than once, even if it was the same standard both times. In the case of link flags especially, it is of course important to keep the order. Maybe a self-written function for eliminating duplicates would do best? |
I think we can just switch to dict as discussed here: https://stackoverflow.com/a/7961390/2305545 |
I think IF we keep this, we should actually keep the last occurence of a keyword and not the first, otherwise we have the issue again, that if we have the dependency
And lib2 defines the same flag as my_proj, but lib defines overriding flags, lib would "win". |
I agree, the toplevel target flags should override those of its dependencies. |
If we preserve a specific order of flags etc. in inheritance, this order should be documented. |
I am not sure if this has been an issue so far, but I just noticed that in target.py the compile flags order is scrambled. I think the intent was to get rid of duplicates, but the current implementation could change the order:
clang-build/clang_build/target.py
Line 148 in c5d5c1b
The text was updated successfully, but these errors were encountered: