add_library(libvlc SHARED ${SOURCES_libvlc})
install_targets(/lib libvlc)
-set_target_properties(libvlc PROPERTIES LINK_FLAGS "${LIBICONV}")
+set_target_properties(libvlc PROPERTIES LINK_FLAGS
+ "-z defs --as-needed -lm ${LIBRT} ${LIBICONV} ${CMAKE_THREAD_LIBS_INIT}")
set_target_properties(libvlc PROPERTIES SOVERSION 1.0.0)
# libvlc-control
# SET_TARGET_PROPERTIES
set_target_properties(libvlc libvlc-control PROPERTIES PREFIX "")
+set_target_properties(libvlc-control PROPERTIES LINK_FLAGS "-z defs --as-needed")
set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes" )
vlc_check_functions_exist(iconv)
if(NOT HAVE_ICONV)
- set(LIBICONV "iconv")
+ set(LIBICONV "-liconv")
check_library_exists(iconv iconv "" HAVE_ICONV)
endif(NOT HAVE_ICONV)
# FIXME: this will break on *BSD:
set( ICONV_CONST "" )
check_library_exists(rt clock_nanosleep "" HAVE_CLOCK_NANOSLEEP)
+if (HAVE_CLOCK_NANOSLEEP)
+ set(LIBRT "-lrt")
+endif (HAVE_CLOCK_NANOSLEEP)
###########################################################
# Other check