Skip to content

Commit

Permalink
[IR]test ir dynamic library. (#55113)
Browse files Browse the repository at this point in the history
  • Loading branch information
winter-wang authored Jul 5, 2023
1 parent bf92ccc commit 3138e7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -705,9 +705,7 @@ else()
endif()

if(NOT WITH_SHARED_IR)
if(WIN32)
add_definitions(-DIR_API=)
endif()
add_definitions(-DSTATIC_IR)
endif()

if(WITH_STRIP)
Expand Down
5 changes: 1 addition & 4 deletions paddle/ir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_definitions(-DIR_LIBRARY)
set_property(GLOBAL PROPERTY IR_TARGETS "")
set_property(GLOBAL PROPERTY IR_MODULES "")
function(ir_library TARGET_NAME)
Expand Down Expand Up @@ -33,10 +34,6 @@ function(ir_library TARGET_NAME)
endif()
endfunction()

if(WITH_SHARED_IR)
add_definitions(-DIR_DLL_EXPORT)
endif()

add_subdirectory(core)
add_subdirectory(pass)
add_subdirectory(pattern_rewrite)
Expand Down
12 changes: 5 additions & 7 deletions paddle/ir/core/dll_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
// limitations under the License.

#pragma once

#define IR_API
#if defined(_WIN32)
#ifndef IR_API
#ifdef IR_DLL_EXPORT
#ifndef STATIC_IR
#ifdef IR_LIBRARY
#define IR_API __declspec(dllexport)
#else
#define IR_API __declspec(dllimport)
#endif // IR_DLL_EXPORT
#endif // IR_API
#else
#define IR_API
#endif // IR_LIBRARY
#endif // STATIC_IR
#endif // _WIN32

0 comments on commit 3138e7a

Please sign in to comment.