[Mlir-commits] [mlir] [mlir][cmake] export list of CAPI libs (PR #71722)

Maksim Levental llvmlistbot at llvm.org
Wed Nov 8 10:52:54 PST 2023


https://github.com/makslevental updated https://github.com/llvm/llvm-project/pull/71722

>From 26acc4aed550a9b205828bc12cf5ad001d4a1660 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Wed, 8 Nov 2023 12:40:06 -0600
Subject: [PATCH] [mlir][cmake] export list of CAPI libs

---
 mlir/cmake/modules/CMakeLists.txt      | 1 +
 mlir/cmake/modules/MLIRConfig.cmake.in | 1 +
 mlir/lib/CAPI/CMakeLists.txt           | 8 ++++----
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 017370bf01f9dda..8d2904ef46dfe81 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 d3324d55c848e05..cd8cec5dedf3c17 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 052eff327c73264..707e78ac3d1ea3c 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



More information about the Mlir-commits mailing list