From e3526b9f7542604c6e28925a769c2993cfad2703 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Sat, 12 Oct 2024 18:10:43 -0700 Subject: [PATCH] Don't update compile definitions for imported targets for MSCV --- compiler/src/iree/compiler/API/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/iree/compiler/API/CMakeLists.txt b/compiler/src/iree/compiler/API/CMakeLists.txt index 6108e12654f4..beada0dc6385 100644 --- a/compiler/src/iree/compiler/API/CMakeLists.txt +++ b/compiler/src/iree/compiler/API/CMakeLists.txt @@ -110,7 +110,8 @@ foreach(_object_lib ${_EXPORT_OBJECT_LIBS}) # It isn't super polite to be poking at other people's library definitions # like this, but MSVC is weird and given the structure of the projects, this # isn't so bad. - if(MSVC) + get_target_property(_imported ${_object_lib} IMPORTED) + if(MSVC AND NOT ${_imported}) target_compile_definitions(${_object_lib} PRIVATE # See compiler/bindings/c/iree/compiler/api_support.h. # IREE embedded CAPI uses its own macros to enable