diff --git a/mlir/cmake/modules/MLIRConfig.cmake.in b/mlir/cmake/modules/MLIRConfig.cmake.in --- a/mlir/cmake/modules/MLIRConfig.cmake.in +++ b/mlir/cmake/modules/MLIRConfig.cmake.in @@ -22,7 +22,9 @@ set_property(GLOBAL PROPERTY MLIR_TRANSLATION_LIBS "@MLIR_TRANSLATION_LIBS@") # Provide all our library targets to users. -@MLIR_CONFIG_INCLUDE_EXPORTS@ +if(NOT TARGET MLIRSupport) + @MLIR_CONFIG_INCLUDE_EXPORTS@ +endif() # By creating these targets here, subprojects that depend on MLIR's # tablegen-generated headers can always depend on these targets whether building