[Mlir-commits] [mlir] [mlir python][cmake] Fixed nanobind target used in target_compile_options in AddMLIRPython.cmake (PR #121477)
Peter Hawkins
llvmlistbot at llvm.org
Mon Jan 6 07:09:15 PST 2025
hawkinsp wrote:
> I'm approving to unblock (because the impl is ~correct) but I think we should have a quick discussion about steps going forward because I think this is really brittle. I guess the correct thing to do here is either
>
> 1. remove those compile options
> 2. fix them upstream in nanobind itself
>
> * unfortunately some of them (at least `-Wcast-qual`) cannot be fixed just because of how nanobind works.
>
> cc @jpienaar @hawkinsp @stellaraccident
Note the upstream is fairly opinionated about the underlying source of the warnings: https://github.com/wjakob/nanobind/blob/b7c4f1abfcab9cc5a8f0ef758926d92ff5eac3a3/include/nanobind/nb_attr.h#L263-L288
(If it were me, I'd probably write, say, `const_cast` instead of using a C-style cast, but: their code base, their rules.)
I don't know cmake at all and find it incomprehensible, but could we upstream a change to their cmake macros to silence the warnings?
https://github.com/llvm/llvm-project/pull/121477
More information about the Mlir-commits
mailing list