Skip to content

Commit 65b776f

Browse files
Tatiana Likhomanenkofacebook-github-bot
authored andcommitted
export the weakly-linked symbols (#981)
Summary: Pull Request resolved: #981 title Reviewed By: jacobkahn Differential Revision: D30003295 fbshipit-source-id: 129e41ab3785431bd0676400212c8027612074a5
1 parent 04b0305 commit 65b776f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,18 @@ if (NOT TARGET flashlight::flashlight-app-asr)
1515
message(FATAL_ERROR "flashlight must be build with app/asr for wav2letter++")
1616
endif ()
1717

18+
include(CheckCXXCompilerFlag)
19+
# All libraries should have their symbols exported so plugins can lazily
20+
# symbols from any of them
21+
check_cxx_compiler_flag("-rdynamic" COMPILER_SUPPORTS_RDYNAMIC)
22+
if(${COMPILER_SUPPORTS_RDYNAMIC})
23+
message(STATUS "-rdynamic supported.")
24+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
25+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
26+
else()
27+
message(WARNING
28+
"This compiler doesn't support dynamic symbol exports. "
29+
"Plugin functionality likely won't work.")
30+
endif()
31+
1832
add_subdirectory(${PROJECT_SOURCE_DIR}/recipes)

0 commit comments

Comments
 (0)