My dynamic library uses a version script to control exported symbols.
I want to create linkage dependency upon the .version
file so the library relinks on a modification of the file.
I tried to do it using PROPERTIES
as follows.
target_properties(so_lib
PROPERTIES
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/so_lib.version
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/so_lib.version"
)
This does not work. When I touch
the file, library is not relinked, thus exported symbols are not updated to mirror the .version script definitions.
What is the best CMake practise for such a problem?
DEPENDS
. See also that question: stackoverflow.com/questions/32864689/…. – Tsyvarev Sep 25 at 7:58