[Mlir-commits] [mlir] e6f3ec6 - Don't link any LLVM/MLIR library to the C API unit-test

Mehdi Amini llvmlistbot at llvm.org
Fri Nov 6 17:55:00 PST 2020


Author: Mehdi Amini
Date: 2020-11-07T01:54:31Z
New Revision: e6f3ec6ebb2ec4d7499b374514f4ecad9adb903f

URL: https://github.com/llvm/llvm-project/commit/e6f3ec6ebb2ec4d7499b374514f4ecad9adb903f
DIFF: https://github.com/llvm/llvm-project/commit/e6f3ec6ebb2ec4d7499b374514f4ecad9adb903f.diff

LOG: Don't link any LLVM/MLIR library to the C API unit-test

The tests are intended to exercise the public C API and will link to a
specific shared library exposing only the C API, this library itself may
link to libMLIR.so.
If we link some LLVM library statically in the test themselves, we end
up with duplicated cl::opt registrations in LLVM. A possible setup if
these libraries were needed could be to link libMLIR.so directly when
available and link statically when it isn't available (in which case the
libary exposing the C API would be statically link and isolated from the
cl::opt registry, hopefully).

Differential Revision: https://reviews.llvm.org/D90993

Added: 
    

Modified: 
    mlir/test/CAPI/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/test/CAPI/CMakeLists.txt b/mlir/test/CAPI/CMakeLists.txt
index cf7731405817..7d13bb13083f 100644
--- a/mlir/test/CAPI/CMakeLists.txt
+++ b/mlir/test/CAPI/CMakeLists.txt
@@ -4,8 +4,6 @@ set(LLVM_OPTIONAL_SOURCES
 )
 
 set(LLVM_LINK_COMPONENTS
-  Core
-  Support
   )
 
 add_llvm_executable(mlir-capi-ir-test


        


More information about the Mlir-commits mailing list