From d7e04ed6aab964f4337e22a37ce4aa8080255419 Mon Sep 17 00:00:00 2001 From: zhangbo9674 <82555433+zhangbo9674@users.noreply.github.com> Date: Tue, 4 Jul 2023 15:09:12 +0800 Subject: [PATCH] fix bug ir static lib (#55109) --- CMakeLists.txt | 6 ++++++ paddle/ir/CMakeLists.txt | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 326d4c684b5..150211e79e7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -704,6 +704,12 @@ else() ) endif() +if(NOT WITH_SHARED_IR) + if(WIN32) + add_definitions(-DIR_API=) + endif() +endif() + if(WITH_STRIP) find_program(STRIP_PATH strip) if(NOT STRIP_PATH OR NOT LINUX) diff --git a/paddle/ir/CMakeLists.txt b/paddle/ir/CMakeLists.txt index 35c2fb0ded0..6536a2fe018 100644 --- a/paddle/ir/CMakeLists.txt +++ b/paddle/ir/CMakeLists.txt @@ -35,10 +35,6 @@ endfunction() if(WITH_SHARED_IR) add_definitions(-DIR_DLL_EXPORT) -else() - if(WIN32) - add_definitions(-DIR_API) - endif() endif() add_subdirectory(core) -- GitLab