-
Notifications
You must be signed in to change notification settings - Fork 144
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
[std=c++17] Builder flag_if_supported/flag ignored #1304
Comments
If I use
it appends |
works fine. |
Actually it doesn't work. Setting c++ version using extra_clang_args ends up as the last command line option. Which won't affect any of the include files. It looks like autocxx itself is dependent on 14, as changing This is the error I get when I update both autocxx and autocxx-build to
This is just a simple scenario of trying to use |
You're right to be using extra_clang_args. Applying this diff to the code in
|
(At the very least the documentation needs to be improved here, so I'll keep this issue open. But I want to make sure you can resolve your problem first - can you try the above diff against the demo, and report back on whether it works for you?) |
@adetaylor Using your suggest pattern works! The only combo I didn't try :) This gets me past the issue:
Yes I agree the docs need to improve around this |
OK great, thank you. |
There was already a test for C++17 compatibility, so I just improved the documentation here. Thanks again for the report. |
Describe the bug
Using
b.flag_if_supported("-std=c++17")
has no impact, and the log output will still use-std=c++14
. Same forb.flag("-std=c++17")
Snippet from
RUST_LOG=autocxx_engine=info cargo build
when using withb.flag_if_supported("-std=c++17")
. Notice-std=c++14
in log:To Reproduce
Add
.flag_if_supported("-std=c++17")
to build.rs. Alternatively use.flag("-std=c++17")
Expected behavior
"-std=c++17" is applied to compiler invocation instead of "-std=c++14"
The text was updated successfully, but these errors were encountered: