[mlir][py] Fix python modules build with clang-cl due to requiring exceptions
authorMarkus Böck <markus.boeck02@gmail.com>
Fri, 6 Jan 2023 21:48:02 +0000 (22:48 +0100)
committerMarkus Böck <markus.boeck02@gmail.com>
Fri, 6 Jan 2023 21:48:14 +0000 (22:48 +0100)
commit3adb0ac183242cd18931dc0dc011385403727f92
treec07819dd8d58b660c81a8f887792be44a8fa9edb
parente22ff52c10d1fdaedc3e24a7884ec215e78eeec4
[mlir][py] Fix python modules build with clang-cl due to requiring exceptions

The generator expression previously used to enable exceptions would not work since the compiler id of clang-cl is Clang, even if used via clang-cl.

The patch fixes that by replacing the generator expression with simple logic, setting the right compiler flags for all MSVC like compilers (including clang-cl) and all GCC like compilers.

Differential Revision: https://reviews.llvm.org/D141155
mlir/cmake/modules/AddMLIRPython.cmake