Skip to content

Commit 7f93def

Browse files
committed
inference api static lib symbol hidden
1 parent 1bd9fe8 commit 7f93def

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

paddle/contrib/inference/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ endfunction(inference_api_test)
4545
cc_library(paddle_inference_api
4646
SRCS paddle_inference_api.cc paddle_inference_api_impl.cc
4747
DEPS ${FLUID_CORE_MODULES} ${GLOB_OP_LIB})
48+
if(NOT APPLE)
49+
set(LINK_FLAGS "-Wl,--retain-symbols-file ${CMAKE_CURRENT_SOURCE_DIR}/paddle_inference_api.sym")
50+
set_target_properties(paddle_inference_api PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
51+
endif()
4852

4953
# Here the shared library doesn't depend on other fluid libraries, or double free will occur.
5054
cc_library(paddle_inference_api_shared SHARED
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*paddle*

0 commit comments

Comments
 (0)