Skip to content

Commit

Permalink
export the weakly-linked symbols (#981)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #981

title

Reviewed By: jacobkahn

Differential Revision: D30003295

fbshipit-source-id: 129e41ab3785431bd0676400212c8027612074a5
  • Loading branch information
Tatiana Likhomanenko authored and facebook-github-bot committed Aug 3, 2021
1 parent 04b0305 commit 65b776f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ if (NOT TARGET flashlight::flashlight-app-asr)
message(FATAL_ERROR "flashlight must be build with app/asr for wav2letter++")
endif ()

include(CheckCXXCompilerFlag)
# All libraries should have their symbols exported so plugins can lazily
# symbols from any of them
check_cxx_compiler_flag("-rdynamic" COMPILER_SUPPORTS_RDYNAMIC)
if(${COMPILER_SUPPORTS_RDYNAMIC})
message(STATUS "-rdynamic supported.")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
else()
message(WARNING
"This compiler doesn't support dynamic symbol exports. "
"Plugin functionality likely won't work.")
endif()

add_subdirectory(${PROJECT_SOURCE_DIR}/recipes)

0 comments on commit 65b776f

Please sign in to comment.