In Cxx, how to supply compiler flags like -O2 or --std==c++17

When using the Cxx package, how can I supply flags to Clang like -O2 or --std==c++17?

I don’t think Cxx is a compiler like gcc so this doesn’t make sense?

edit: maybe one can use the “Compiling into shared library” described on github README

It’s still compiling the code, so at some stage it must pick an optimisation level and C++ version. Issue came up because I tried to cxxinclude some C++17 code and it failed as if --std=c++17 wasn’t enabled.

I guess you could edit the following line and do a source build.

https://github.com/JuliaInterop/Cxx.jl/blob/14c403a58ba0bec12e9893a3acf0b28dfc8ffa3a/src/bootstrap.cpp#L1447

Thanks!