xref: /llvm-project/mlir/lib/ExecutionEngine/SparseTensor/CMakeLists.txt (revision 047e8e47c1f9d872aec835b915935802e195c555)
1# Unlike mlir_float16_utils, mlir_c_runner_utils, etc, we do *not* make
2# this a shared library: because doing so causes issues when building
3# on Windows.  In particular, various functions take/return `std::vector`
4# but that class is not designed with dllimport/dllexport pragma,
5# therefore it cannot be safely/correctly used across DLL boundaries.
6# Consequently, we avoid using the "mlir_xxx_utils" naming scheme, since
7# that is reserved/intended for shared libraries only.
8add_mlir_library(MLIRSparseTensorRuntime
9  File.cpp
10  MapRef.cpp
11  Storage.cpp
12
13  EXCLUDE_FROM_LIBMLIR
14  )
15mlir_target_link_libraries(MLIRSparseTensorRuntime PUBLIC
16  MLIRSparseTensorEnums
17  mlir_float16_utils
18  )
19set_property(TARGET MLIRSparseTensorRuntime PROPERTY CXX_STANDARD 17)
20
21check_cxx_compiler_flag(-Wweak-vtables
22  COMPILER_SUPPORTS_WARNING_WEAK_VTABLES)
23if(COMPILER_SUPPORTS_WARNING_WEAK_VTABLES)
24  target_compile_options(MLIRSparseTensorRuntime PUBLIC
25    "-Wweak-vtables")
26endif()
27