[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / mlir / lib / CAPI / CMakeLists.txt
blob6c438508425b7c344b494b5a8ed06894c55806e9
1 # For upstream, we accumulate all libraries into the MLIR_CAPI_LIBS
2 # property via a custom wrapper function. This is then used to create an
3 # aggregate below.
4 set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS)
5 function(add_mlir_upstream_c_api_library name)
6   add_mlir_public_c_api_library(${name} ${ARGN})
7   set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS ${name})
8 endfunction()
10 add_subdirectory(Debug)
11 add_subdirectory(Dialect)
12 add_subdirectory(Conversion)
13 add_subdirectory(Interfaces)
14 add_subdirectory(IR)
15 add_subdirectory(RegisterEverything)
16 add_subdirectory(Transforms)
17 add_subdirectory(Target)
19 if(MLIR_ENABLE_EXECUTION_ENGINE)
20   add_subdirectory(ExecutionEngine)
21 endif()
23 # Build the optional CAPI dylib.
24 if(MLIR_BUILD_MLIR_C_DYLIB)
25   message(STATUS "Building MLIR-C dylib")
26   get_property(_capi_libraries GLOBAL PROPERTY MLIR_CAPI_LIBS)
27   add_mlir_aggregate(MLIR-C
28     SHARED
29     EMBED_LIBS
30       ${_capi_libraries}
31   )
32   if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
33     target_link_options(MLIR-C PRIVATE "-Wl,-exclude-libs,ALL")
34   else()
35     if(NOT CMAKE_C_VISIBILITY_PRESET STREQUAL "hidden" OR NOT CMAKE_CXX_VISIBILITY_PRESET STREQUAL "hidden")
36       message(STATUS "MLIR-C on this platform exports all symbols. Recommend building with CMAKE_(C|CXX)_VISIBILITY_PRESET=hidden or implement filtering support.")
37     endif()
38   endif()
39 endif()