Commit 260daa94 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

cmake: prefer the use of target_link_libraries() over...

cmake: prefer the use of target_link_libraries() over set_target_properties(LINKFLAGS), make sure we don't use "-z defs --as-needed" on Mac OS X.
parent d93f3dd1
...@@ -134,9 +134,6 @@ endif(SYS_DARWIN) ...@@ -134,9 +134,6 @@ endif(SYS_DARWIN)
add_library(libvlc SHARED ${SOURCES_libvlc}) add_library(libvlc SHARED ${SOURCES_libvlc})
install_targets(/lib libvlc) install_targets(/lib libvlc)
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 # libvlc-control
set( SOURCES_libvlc_control set( SOURCES_libvlc_control
...@@ -193,7 +190,7 @@ OUTPUT ${rev} ...@@ -193,7 +190,7 @@ OUTPUT ${rev}
COMMAND rm -f ${rev} ${rev}.tmp COMMAND rm -f ${rev} ${rev}.tmp
COMMAND echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp COMMAND echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > ${rev}.tmp
COMMAND printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp COMMAND printf "const char psz_vlc_changeset[] = \"" >> ${rev}.tmp
COMMAND sh -c "printf `LANG=C\ svnversion\ ${CMAKE_SOURCE_DIR}\ ||\ echo\ exported`" >> ${rev}.tmp COMMAND sh -c "printf `LANG=C svnversion ${CMAKE_SOURCE_DIR} || printf \"exported\"`" >> ${rev}.tmp
COMMAND echo "\";" >> ${rev}.tmp COMMAND echo "\";" >> ${rev}.tmp
COMMAND mv -f ${rev}.tmp ${rev} COMMAND mv -f ${rev}.tmp ${rev}
VERBATIM VERBATIM
...@@ -238,10 +235,19 @@ DEPENDS ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/THANKS ${CMAKE_SOURCE_DI ...@@ -238,10 +235,19 @@ DEPENDS ${CMAKE_SOURCE_DIR}/AUTHORS ${CMAKE_SOURCE_DIR}/THANKS ${CMAKE_SOURCE_DI
VERBATIM) VERBATIM)
set(about) set(about)
########################################################## ##########################################################
# SET_TARGET_PROPERTIES # SET_TARGET_PROPERTIES
# FIXME: Should probably be autodetected in configure?
if(NOT APPLE)
set(LINK_FLAGS "-z defs --as-needed")
endif(NOT APPLE)
target_link_libraries(libvlc ${LIBRT} ${LIBICONV})
set_target_properties(libvlc PROPERTIES SOVERSION 1.0.0)
set_target_properties(libvlc libvlc-control PROPERTIES PREFIX "") 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 PROPERTIES LINK_FLAGS "${LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
set_target_properties(libvlc libvlc-control vlc PROPERTIES COMPILE_FLAGS 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" ) "-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wmissing-prototypes" )
...@@ -80,7 +80,7 @@ set(LIBICONV "") ...@@ -80,7 +80,7 @@ set(LIBICONV "")
vlc_check_functions_exist(iconv) vlc_check_functions_exist(iconv)
if(NOT HAVE_ICONV) if(NOT HAVE_ICONV)
set(LIBICONV "-liconv") set(LIBICONV "iconv")
check_library_exists(iconv iconv "" HAVE_ICONV) check_library_exists(iconv iconv "" HAVE_ICONV)
endif(NOT HAVE_ICONV) endif(NOT HAVE_ICONV)
# FIXME: this will break on *BSD: # FIXME: this will break on *BSD:
...@@ -88,7 +88,7 @@ set( ICONV_CONST "" ) ...@@ -88,7 +88,7 @@ set( ICONV_CONST "" )
check_library_exists(rt clock_nanosleep "" HAVE_CLOCK_NANOSLEEP) check_library_exists(rt clock_nanosleep "" HAVE_CLOCK_NANOSLEEP)
if (HAVE_CLOCK_NANOSLEEP) if (HAVE_CLOCK_NANOSLEEP)
set(LIBRT "-lrt") set(LIBRT "rt")
endif (HAVE_CLOCK_NANOSLEEP) endif (HAVE_CLOCK_NANOSLEEP)
########################################################### ###########################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment