Skip to content

Commit 950f689

Browse files
authored
[mlir][cmake] export list of CAPI libs (#71722)
1 parent 8803211 commit 950f689

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

mlir/cmake/modules/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ get_property(MLIR_DIALECT_LIBS GLOBAL PROPERTY MLIR_DIALECT_LIBS)
2626
get_property(MLIR_CONVERSION_LIBS GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
2727
get_property(MLIR_EXTENSION_LIBS GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
2828
get_property(MLIR_TRANSLATION_LIBS GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
29+
get_property(MLIR_CAPI_LIBS GLOBAL PROPERTY MLIR_CAPI_LIBS)
2930

3031
# Generate MlirConfig.cmake for the build tree.
3132
set(MLIR_CONFIG_CMAKE_DIR "${mlir_cmake_builddir}")

mlir/cmake/modules/MLIRConfig.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ set_property(GLOBAL PROPERTY MLIR_DIALECT_LIBS "@MLIR_DIALECT_LIBS@")
2323
set_property(GLOBAL PROPERTY MLIR_CONVERSION_LIBS "@MLIR_CONVERSION_LIBS@")
2424
set_property(GLOBAL PROPERTY MLIR_EXTENSION_LIBS "@MLIR_EXTENSION_LIBS@")
2525
set_property(GLOBAL PROPERTY MLIR_TRANSLATION_LIBS "@MLIR_TRANSLATION_LIBS@")
26+
set_property(GLOBAL PROPERTY MLIR_UPSTREAM_CAPI_LIBS "@MLIR_CAPI_LIBS@")
2627

2728
# Provide all our library targets to users.
2829
# More specifically, configure MLIR so that it can be directly included in a top

mlir/lib/CAPI/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# For upstream, we accumulate all libraries into the MLIR_CAPI_LIBRARIES
1+
# For upstream, we accumulate all libraries into the MLIR_CAPI_LIBS
22
# property via a custom wrapper function. This is then used to create an
33
# aggregate below.
4-
set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBRARIES)
4+
set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS)
55
function(add_mlir_upstream_c_api_library name)
66
add_mlir_public_c_api_library(${name} ${ARGN})
7-
set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBRARIES ${name})
7+
set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS ${name})
88
endfunction()
99

1010
add_subdirectory(Debug)
@@ -22,7 +22,7 @@ endif()
2222
# Build the optional CAPI dylib.
2323
if(MLIR_BUILD_MLIR_C_DYLIB)
2424
message(STATUS "Building MLIR-C dylib")
25-
get_property(_capi_libraries GLOBAL PROPERTY MLIR_CAPI_LIBRARIES)
25+
get_property(_capi_libraries GLOBAL PROPERTY MLIR_CAPI_LIBS)
2626
add_mlir_aggregate(MLIR-C
2727
SHARED
2828
EMBED_LIBS

0 commit comments

Comments
 (0)