tools: disable them on iOS

parent d939b466
......@@ -55,6 +55,15 @@ if(UNIX AND NOT APPLE)
set(LINUX_OR_BSD 1)
endif()
if(ENABLE_STATIC)
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip-static mediastreamer_base-static)
if(XV_FOUND)
list(APPEND MS2_LIBS_FOR_TOOLS Xext)
endif()
else()
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip mediastreamer_base)
endif()
include(CMakeDependentOption)
option(ENABLE_SHARED "Build shared library." YES)
......@@ -578,3 +587,5 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Mediastreamer2ConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
......@@ -829,7 +829,7 @@ MSFilterDesc ms_vt_h264_dec = {
void _register_videotoolbox_if_supported(MSFactory *factory) {
#if TARGET_OS_SIMULATOR
ms_warning("VideoToolbox H264 codec is not supported on simulators");
ms_message("VideoToolbox H264 codec is not supported on simulators");
#else
#ifdef __ios
......@@ -841,7 +841,7 @@ void _register_videotoolbox_if_supported(MSFactory *factory) {
ms_factory_register_filter(factory, &ms_vt_h264_enc);
ms_factory_register_filter(factory, &ms_vt_h264_dec);
} else {
ms_warning("Cannot register VideoToolbox H264 codec. That "
ms_message("Cannot register VideoToolbox H264 codec. That "
"requires iOS 8 or MacOSX 10.8");
}
......
......@@ -20,15 +20,6 @@
#
############################################################################
if(ENABLE_STATIC)
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip-static mediastreamer_base-static)
if(XV_FOUND)
list(APPEND MS2_LIBS_FOR_TOOLS Xext)
endif()
else()
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip mediastreamer_base)
endif()
set(RESOURCES_FILES
sounds
scenarios
......
......@@ -22,13 +22,9 @@
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(ENABLE_STATIC)
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip-static mediastreamer_base-static)
if(XV_FOUND)
list(APPEND MS2_LIBS_FOR_TOOLS Xext)
endif()
else()
set(MS2_LIBS_FOR_TOOLS mediastreamer_voip mediastreamer_base)
set(USE_BUNDLE )
if (IOS)
set(USE_BUNDLE MACOSX_BUNDLE)
endif()
set(simple_executables bench ring mtudiscover tones)
......@@ -38,7 +34,7 @@ endif()
foreach(simple_executable ${simple_executables})
set(${simple_executable}_SOURCE_FILES ${simple_executable}.c)
apply_compile_flags(${simple_executable}_SOURCE_FILES "CPP" "C")
add_executable(${simple_executable} ${simple_executable}.c)
add_executable(${simple_executable} ${USE_BUNDLE} ${simple_executable}.c)
target_link_libraries(${simple_executable} ${MS2_LIBS_FOR_TOOLS})
if(LINK_FLAGS_STR)
set_target_properties(${simple_executable} PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......@@ -47,7 +43,7 @@ endforeach()
set(ECHO_SOURCE_FILES echo.c)
apply_compile_flags(ECHO_SOURCE_FILES "CPP" "C")
add_executable(ms-echo ${ECHO_SOURCE_FILES}) # Do not name the target "echo" to avoid conflict with the shell echo command
add_executable(ms-echo ${USE_BUNDLE} ${ECHO_SOURCE_FILES}) # Do not name the target "echo" to avoid conflict with the shell echo command
target_link_libraries(ms-echo ${MS2_LIBS_FOR_TOOLS})
if(LINK_FLAGS_STR)
set_target_properties(ms-echo PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......@@ -56,7 +52,7 @@ endif()
if(PCAP_FOUND)
set(PCAP_PLAYBACK_SOURCE_FILES pcap_playback.c common.c)
apply_compile_flags(PCAP_PLAYBACK_SOURCE_FILES "CPP" "C")
add_executable(pcap_playback ${PCAP_PLAYBACK_SOURCE_FILES})
add_executable(pcap_playback ${USE_BUNDLE} ${PCAP_PLAYBACK_SOURCE_FILES})
target_link_libraries(pcap_playback ${MS2_LIBS_FOR_TOOLS} ${PCAP_LIBRARIES})
target_include_directories(pcap_playback PUBLIC ${PCAP_INCLUDE_DIRS})
if(LINK_FLAGS_STR)
......@@ -64,29 +60,33 @@ if(PCAP_FOUND)
endif()
endif()
set(MEDIASTREAM_SOURCE_FILES_C mediastream.c common.c)
set(MEDIASTREAM_SOURCE_FILES_OBJC )
if(APPLE)
list(APPEND MEDIASTREAM_SOURCE_FILES_OBJC mediastream_cocoa.m)
endif()
apply_compile_flags(MEDIASTREAM_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(MEDIASTREAM_SOURCE_FILES_OBJC "CPP" "OBJC")
add_executable(mediastream ${MEDIASTREAM_SOURCE_FILES_C} ${MEDIASTREAM_SOURCE_FILES_OBJC})
target_link_libraries(mediastream ${MS2_LIBS_FOR_TOOLS})
if(LINK_FLAGS_STR)
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
if (NOT IOS)
set(MEDIASTREAM_SOURCE_FILES_C mediastream.c common.c)
set(MEDIASTREAM_SOURCE_FILES_OBJC )
if(APPLE)
list(APPEND MEDIASTREAM_SOURCE_FILES_OBJC mediastream_cocoa.m)
endif()
apply_compile_flags(MEDIASTREAM_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(MEDIASTREAM_SOURCE_FILES_OBJC "CPP" "OBJC")
add_executable(mediastream ${USE_BUNDLE} ${MEDIASTREAM_SOURCE_FILES_C} ${MEDIASTREAM_SOURCE_FILES_OBJC})
target_link_libraries(mediastream ${MS2_LIBS_FOR_TOOLS})
if(LINK_FLAGS_STR)
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
endif()
if(ENABLE_VIDEO)
set(MKVSTREAM_SOURCE_FILES mkvstream.c)
apply_compile_flags(MKVSTREAM_SOURCE_FILES "CPP" "C")
add_executable(mkvstream ${MKVSTREAM_SOURCE_FILES})
add_executable(mkvstream ${USE_BUNDLE} ${MKVSTREAM_SOURCE_FILES})
target_link_libraries(mkvstream ${MS2_LIBS_FOR_TOOLS})
if(LINK_FLAGS_STR)
set_target_properties(mkvstream PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
install(TARGETS mediastream mkvstream
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
if (NOT IOS)
install(TARGETS mediastream mkvstream
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
endif()
......@@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdlib.h>
#include <string.h>
#ifdef __APPLE__
#ifdef TARGET_OS_MAC
#include <CoreFoundation/CFRunLoop.h>
#endif
......@@ -255,7 +255,7 @@ int main(int argc, char * argv[]) {
static int _main(int argc, char * argv[])
#endif
#if !__APPLE__ && !ANDROID
#if !TARGET_OS_MAC && !ANDROID
int main(int argc, char * argv[])
#endif
......
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