未验证 提交 3138e7aa 编写于 作者: W winter-wang 提交者: GitHub

[IR]test ir dynamic library. (#55113)

上级 bf92ccc7
...@@ -705,9 +705,7 @@ else() ...@@ -705,9 +705,7 @@ else()
endif() endif()
if(NOT WITH_SHARED_IR) if(NOT WITH_SHARED_IR)
if(WIN32) add_definitions(-DSTATIC_IR)
add_definitions(-DIR_API=)
endif()
endif() endif()
if(WITH_STRIP) if(WITH_STRIP)
......
add_definitions(-DIR_LIBRARY)
set_property(GLOBAL PROPERTY IR_TARGETS "") set_property(GLOBAL PROPERTY IR_TARGETS "")
set_property(GLOBAL PROPERTY IR_MODULES "") set_property(GLOBAL PROPERTY IR_MODULES "")
function(ir_library TARGET_NAME) function(ir_library TARGET_NAME)
...@@ -33,10 +34,6 @@ function(ir_library TARGET_NAME) ...@@ -33,10 +34,6 @@ function(ir_library TARGET_NAME)
endif() endif()
endfunction() endfunction()
if(WITH_SHARED_IR)
add_definitions(-DIR_DLL_EXPORT)
endif()
add_subdirectory(core) add_subdirectory(core)
add_subdirectory(pass) add_subdirectory(pass)
add_subdirectory(pattern_rewrite) add_subdirectory(pattern_rewrite)
......
...@@ -13,15 +13,13 @@ ...@@ -13,15 +13,13 @@
// limitations under the License. // limitations under the License.
#pragma once #pragma once
#define IR_API
#if defined(_WIN32) #if defined(_WIN32)
#ifndef IR_API #ifndef STATIC_IR
#ifdef IR_DLL_EXPORT #ifdef IR_LIBRARY
#define IR_API __declspec(dllexport) #define IR_API __declspec(dllexport)
#else #else
#define IR_API __declspec(dllimport) #define IR_API __declspec(dllimport)
#endif // IR_DLL_EXPORT #endif // IR_LIBRARY
#endif // IR_API #endif // STATIC_IR
#else
#define IR_API
#endif // _WIN32 #endif // _WIN32
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册