Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/cmake/modules/AddMLIR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function(add_mlir_aggregate name)
# TODO: Should be transitive.
set_target_properties(${name} PROPERTIES
MLIR_AGGREGATE_EXCLUDE_LIBS "${_embed_libs}")
if(MSVC)
if(WIN32)
Copy link
Contributor Author

@makslevental makslevental Dec 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change and the other MSVC -> WIN32 one below aren't strictly related to the build failure but it's also wrong - this is a windows platform requirement, not an MSVC requirement.

set_property(TARGET ${name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

Expand Down
20 changes: 11 additions & 9 deletions mlir/cmake/modules/AddMLIRPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ function(add_mlir_python_common_capi_library name)
)
add_dependencies(${name} ${_header_sources_target})

if(MSVC)
if(WIN32)
set_property(TARGET ${name} PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
set_target_properties(${name} PROPERTIES
Expand Down Expand Up @@ -649,6 +649,15 @@ function(add_mlir_python_extension libname extname)
message(FATAL_ERROR "Unhandled arguments to add_mlir_python_extension(${libname}, ... : ${ARG_UNPARSED_ARGUMENTS}")
endif()

# The extension itself must be compiled with RTTI and exceptions enabled.
# Also, some warning classes triggered by pybind11 are disabled.
set(eh_rtti_enable)
if (MSVC)
set(eh_rtti_enable /EHsc /GR)
elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)
set(eh_rtti_enable -frtti -fexceptions)
endif ()

# The actual extension library produces a shared-object or DLL and has
# sources that must be compiled in accordance with pybind11 needs (RTTI and
# exceptions).
Expand All @@ -671,18 +680,11 @@ function(add_mlir_python_extension libname extname)
-Wno-nested-anon-types
-Wno-c++98-compat-extra-semi
-Wno-covered-switch-default
${eh_rtti_enable}
)
endif()
endif()

# The extension itself must be compiled with RTTI and exceptions enabled.
# Also, some warning classes triggered by pybind11 are disabled.
set(eh_rtti_enable)
if (MSVC)
set(eh_rtti_enable /EHsc /GR)
elseif(LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(eh_rtti_enable -frtti -fexceptions)
endif ()
target_compile_options(${libname} PRIVATE ${eh_rtti_enable})

# Configure the output to match python expectations.
Expand Down
Loading