diff --git a/CMakeLists.txt b/CMakeLists.txt index 326d4c684b51ca82e310cd5acbd47ca147ed6cda..150211e79e7a9ede7bfaa6d7f5a129616617b810 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 35c2fb0ded068dd79b02ecb306202c5ef6896fb3..6536a2fe0183fd2a996861272116df520ed7fea6 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)