Skip to content

Commit

Permalink
Revert "Refs 11751. Pass the linker flags using a well-known cmake va…
Browse files Browse the repository at this point in the history
…riable"

This reverts commit 8ec1fec.

Signed-off-by: Barro <miguelbarro@eprosima.com>
  • Loading branch information
Barro committed Dec 17, 2021
1 parent 8ec1fec commit bbe4de0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ if(MSVC OR MSVC_IDE)
endif()
elseif(BUILD_SHARED_LIBS)
set(VERSION_SCRIPT_SUPPORT_FLAGS -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libfastrtps.version)
set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${VERSION_SCRIPT_SUPPORT_FLAGS})
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} ${VERSION_SCRIPT_SUPPORT_FLAGS})
CHECK_CXX_SOURCE_COMPILES("int main(int, char**){return 0;}" HAS_VERSION_SCRIPT_SUPPORT)
set(CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
unset(OLD_CMAKE_CXX_FLAGS)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
unset(OLD_CMAKE_REQUIRED_FLAGS)
if(HAS_VERSION_SCRIPT_SUPPORT)
message(STATUS "Using linker version script to select exported symbols")
target_link_options(${PROJECT_NAME} ${PRIVACY} ${VERSION_SCRIPT_SUPPORT_FLAGS})
Expand Down

0 comments on commit bbe4de0

Please sign in to comment.