aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Levental <maksim.levental@gmail.com>2023-11-08 16:59:17 -0600
committerGitHub <noreply@github.com>2023-11-08 16:59:17 -0600
commit950f68991fbdf3921eeab732526984b01f8dd27e (patch)
tree2c6ed54a6228ec2fa22934db659649b8f15f4b53
parent8803211a32b078231d23c03040accb38bb388353 (diff)
downloadllvm-950f68991fbdf3921eeab732526984b01f8dd27e.zip
llvm-950f68991fbdf3921eeab732526984b01f8dd27e.tar.gz
llvm-950f68991fbdf3921eeab732526984b01f8dd27e.tar.bz2
[mlir][cmake] export list of CAPI libs (#71722)
-rw-r--r--mlir/cmake/modules/CMakeLists.txt1
-rw-r--r--mlir/cmake/modules/MLIRConfig.cmake.in1
-rw-r--r--mlir/lib/CAPI/CMakeLists.txt8
3 files changed, 6 insertions, 4 deletions
diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 017370b..8d2904e 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -26,6 +26,7 @@ get_property(MLIR_DIALECT_LIBS GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(MLIR_CONVERSION_LIBS GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
get_property(MLIR_EXTENSION_LIBS GLOBAL PROPERTY MLIR_EXTENSION_LIBS)
get_property(MLIR_TRANSLATION_LIBS GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
+get_property(MLIR_CAPI_LIBS GLOBAL PROPERTY MLIR_CAPI_LIBS)
# Generate MlirConfig.cmake for the build tree.
set(MLIR_CONFIG_CMAKE_DIR "${mlir_cmake_builddir}")
diff --git a/mlir/cmake/modules/MLIRConfig.cmake.in b/mlir/cmake/modules/MLIRConfig.cmake.in
index d3324d5..cd8cec5 100644
--- a/mlir/cmake/modules/MLIRConfig.cmake.in
+++ b/mlir/cmake/modules/MLIRConfig.cmake.in
@@ -23,6 +23,7 @@ set_property(GLOBAL PROPERTY MLIR_DIALECT_LIBS "@MLIR_DIALECT_LIBS@")
set_property(GLOBAL PROPERTY MLIR_CONVERSION_LIBS "@MLIR_CONVERSION_LIBS@")
set_property(GLOBAL PROPERTY MLIR_EXTENSION_LIBS "@MLIR_EXTENSION_LIBS@")
set_property(GLOBAL PROPERTY MLIR_TRANSLATION_LIBS "@MLIR_TRANSLATION_LIBS@")
+set_property(GLOBAL PROPERTY MLIR_UPSTREAM_CAPI_LIBS "@MLIR_CAPI_LIBS@")
# Provide all our library targets to users.
# More specifically, configure MLIR so that it can be directly included in a top
diff --git a/mlir/lib/CAPI/CMakeLists.txt b/mlir/lib/CAPI/CMakeLists.txt
index 052eff3..707e78a 100644
--- a/mlir/lib/CAPI/CMakeLists.txt
+++ b/mlir/lib/CAPI/CMakeLists.txt
@@ -1,10 +1,10 @@
-# For upstream, we accumulate all libraries into the MLIR_CAPI_LIBRARIES
+# For upstream, we accumulate all libraries into the MLIR_CAPI_LIBS
# property via a custom wrapper function. This is then used to create an
# aggregate below.
-set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBRARIES)
+set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS)
function(add_mlir_upstream_c_api_library name)
add_mlir_public_c_api_library(${name} ${ARGN})
- set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBRARIES ${name})
+ set_property(GLOBAL APPEND PROPERTY MLIR_CAPI_LIBS ${name})
endfunction()
add_subdirectory(Debug)
@@ -22,7 +22,7 @@ endif()
# Build the optional CAPI dylib.
if(MLIR_BUILD_MLIR_C_DYLIB)
message(STATUS "Building MLIR-C dylib")
- get_property(_capi_libraries GLOBAL PROPERTY MLIR_CAPI_LIBRARIES)
+ get_property(_capi_libraries GLOBAL PROPERTY MLIR_CAPI_LIBS)
add_mlir_aggregate(MLIR-C
SHARED
EMBED_LIBS