[Mlir-commits] [mlir] [mlir][python] Support CLANG_CL (PR #121075)

Maksim Levental llvmlistbot at llvm.org
Tue Dec 24 16:49:27 PST 2024


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/121075

None

>From 0d50c6e88c83397deebd5209dddad2b5c15b3297 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Tue, 24 Dec 2024 16:39:38 -0800
Subject: [PATCH] [mlir][python] Support CLANG_CL

---
 mlir/cmake/modules/AddMLIRPython.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
index 53a70139fd5a68..96b3c9d47de400 100644
--- a/mlir/cmake/modules/AddMLIRPython.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -512,7 +512,7 @@ function(add_mlir_python_common_capi_library name)
   )
   add_dependencies(${name} ${_header_sources_target})
 
-  if(MSVC)
+  if(MSVC OR CLANG_CL)
     set_property(TARGET ${name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
   endif()
   set_target_properties(${name} PROPERTIES
@@ -680,7 +680,7 @@ function(add_mlir_python_extension libname extname)
   set(eh_rtti_enable)
   if (MSVC)
     set(eh_rtti_enable /EHsc /GR)
-  elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE)
+  elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)
     set(eh_rtti_enable -frtti -fexceptions)
   endif ()
   target_compile_options(${libname} PRIVATE ${eh_rtti_enable})



More information about the Mlir-commits mailing list