Commit 0fd136f2 authored by Ghislain MARY's avatar Ghislain MARY

Improve compilation flags handling when building with CMake.

parent e1ef3c61
......@@ -98,6 +98,23 @@ cmake_dependent_option(ENABLE_VPX "Build mediastreamer2 with VPX codec." YES "EN
option(ENABLE_MKV "Enable support of MKV files reading and writing." YES)
cmake_dependent_option(ENABLE_QNX "Build medistreamer2 with BB10 filters." NO "ENABLE_VIDEO" NO)
macro(apply_compile_flags SOURCE_FILES)
if(${SOURCE_FILES})
set(options "")
foreach(a ${ARGV})
if(STRICT_OPTIONS_${a})
string(REPLACE ";" " " options_${a} "${STRICT_OPTIONS_${a}}")
set(options "${options} ${options_${a}}")
endif()
endforeach()
if(options)
set_source_files_properties(${${SOURCE_FILES}} PROPERTIES COMPILE_FLAGS "${options}")
endif()
endif()
endmacro()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckIncludeFile)
......@@ -453,6 +470,7 @@ add_definitions(${ORTP_CPPFLAGS})
set(STRICT_OPTIONS_CPP )
set(STRICT_OPTIONS_C )
set(STRICT_OPTIONS_OBJC "-Wno-error")
if(NOT MSVC)
list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized")
list(APPEND STRICT_OPTIONS_C "-Wdeclaration-after-statement")
......@@ -460,12 +478,21 @@ if(NOT MSVC)
list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(APPLE)
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Wno-tautological-compare")
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing")
endif()
endif()
if(STRICT_OPTIONS_CPP)
list(REMOVE_DUPLICATES STRICT_OPTIONS_CPP)
endif()
if(STRICT_OPTIONS_C)
list(REMOVE_DUPLICATES STRICT_OPTIONS_C)
endif()
if(STRICT_OPTIONS_OBJC)
list(REMOVE_DUPLICATES STRICT_OPTIONS_OBJC)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......
......@@ -30,7 +30,7 @@ if(NOT AWK_PROGRAM)
message(FATAL_ERROR "You need the awk program to build mediastreamer2.")
endif()
set(BASE_SOURCE_FILES
set(BASE_SOURCE_FILES_C
base/eventqueue.c
base/mscommon.c
base/msfactory.c
......@@ -47,18 +47,18 @@ set(BASE_SOURCE_FILES
otherfilters/void.c
)
set(BASE_GENERATED_SOURCE_FILES
set(BASE_GENERATED_SOURCE_FILES_C
${CMAKE_CURRENT_BINARY_DIR}/basedescs.h
${CMAKE_CURRENT_BINARY_DIR}/gitversion.h
)
set_source_files_properties(${BASE_GENERATED_SOURCE_FILES} PROPERTIES GENERATED TRUE)
set_source_files_properties(${BASE_GENERATED_SOURCE_FILES_C} PROPERTIES GENERATED TRUE)
find_package(Git)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gitversion.h
COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/gitversion.cmake)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/basedescs.h
COMMAND ${CMAKE_COMMAND} -DAWK_PROGRAM=${AWK_PROGRAM} -DAWK_SCRIPTS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DTYPE=base -DSOURCE_FILES="${BASE_SOURCE_FILES}"
-DTYPE=base -DSOURCE_FILES="${BASE_SOURCE_FILES_C}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_descs_header.cmake)
add_definitions(
......@@ -79,10 +79,13 @@ if(HAVE_DLOPEN)
list(APPEND BASE_LIBS dl)
endif()
apply_compile_flags(BASE_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(BASE_GENERATED_SOURCE_FILES_C "CPP" "C")
if(ENABLE_STATIC)
add_library(mediastreamer_base STATIC ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES} ${BASE_GENERATED_SOURCE_FILES})
add_library(mediastreamer_base STATIC ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES_C} ${BASE_GENERATED_SOURCE_FILES_C})
else()
add_library(mediastreamer_base SHARED ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES} ${BASE_GENERATED_SOURCE_FILES})
add_library(mediastreamer_base SHARED ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES_C} ${BASE_GENERATED_SOURCE_FILES_C})
set_target_properties(mediastreamer_base PROPERTIES VERSION ${MEDIASTREAMER_SO_VERSION} LINKER_LANGUAGE C)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
......@@ -94,7 +97,6 @@ else()
endif()
endif()
target_link_libraries(mediastreamer_base ${BASE_LIBS})
target_compile_options(mediastreamer_base PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
install(TARGETS mediastreamer_base EXPORT ${EXPORT_TARGETS_NAME}Targets
RUNTIME DESTINATION bin
......@@ -105,7 +107,7 @@ install(TARGETS mediastreamer_base EXPORT ${EXPORT_TARGETS_NAME}Targets
set(VOIP_SOURCE_FILES
set(VOIP_SOURCE_FILES_C
audiofilters/alaw.c
audiofilters/audiomixer.c
audiofilters/chanadapt.c
......@@ -158,56 +160,59 @@ set(VOIP_SOURCE_FILES
voip/stun.c
voip/stun_udp.c
)
set(VOIP_SOURCE_FILES_CXX )
set(VOIP_SOURCE_FILES_OBJC )
if(ENABLE_ALSA)
list(APPEND VOIP_SOURCE_FILES audiofilters/alsa.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/alsa.c)
endif()
if(ENABLE_ARTSC)
list(APPEND VOIP_SOURCE_FILES audiofilters/arts.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/arts.c)
endif()
if(ENABLE_MACSND)
list(APPEND VOIP_SOURCE_FILES audiofilters/macsnd.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/macsnd.c)
endif()
if(ENABLE_MACAQSND)
list(APPEND VOIP_SOURCE_FILES audiofilters/aqsnd.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/aqsnd.c)
endif()
if(ENABLE_OSS)
list(APPEND VOIP_SOURCE_FILES audiofilters/oss.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/oss.c)
endif()
if(ENABLE_PORTAUDIO)
list(APPEND VOIP_SOURCE_FILES audiofilters/pasnd.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/pasnd.c)
endif()
if(ENABLE_PULSEAUDIO)
list(APPEND VOIP_SOURCE_FILES audiofilters/pulseaudio.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/pulseaudio.c)
endif()
if(ENABLE_QSA)
list(APPEND VOIP_SOURCE_FILES audiofilters/qsa.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/qsa.c)
endif()
if(IOS)
list(APPEND VOIP_SOURCE_FILES audiofilters/msiounit.m audiofilters/aac-eld.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/aac-eld.c)
list(APPEND VOIP_SOURCE_FILES_OBJC audiofilters/msiounit.m)
endif()
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
list(APPEND VOIP_SOURCE_FILES audiofilters/winsnd3.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/winsnd3.c)
endif()
if(GSM_FOUND)
list(APPEND VOIP_SOURCE_FILES audiofilters/gsm.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/gsm.c)
endif()
if(OPUS_FOUND)
list(APPEND VOIP_SOURCE_FILES audiofilters/msopus.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/msopus.c)
endif()
if(ENABLE_RESAMPLE)
list(APPEND VOIP_SOURCE_FILES audiofilters/msresample.c)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/msresample.c)
endif()
if(SPEEX_FOUND)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
audiofilters/msspeex.c
audiofilters/speexec.c
)
endif()
if(ENABLE_VIDEO)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
utils/bits_rw.c
videofilters/extdisplay.c
videofilters/mire.c
......@@ -228,49 +233,48 @@ if(ENABLE_VIDEO)
)
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
add_definitions(-DHAVE_DIRECTSHOW)
list(APPEND VOIP_SOURCE_FILES
videofilters/msdscap-mingw.cc
list(APPEND VOIP_SOURCE_FILES_C
videofilters/drawdib-display.c
)
set_source_files_properties(videofilters/msdscap-mingw.cc PROPERTIES LANGUAGE CXX)
list(APPEND VOIP_SOURCE_FILES_CXX
videofilters/msdscap-mingw.cc
)
endif()
if(APPLE)
if(IOS)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
utils/opengles_display.c
utils/opengles_display.h
utils/shaders.c
utils/shaders.h
voip/scaler.c
)
list(APPEND VOIP_SOURCE_FILES_OBJC
videofilters/iosdisplay.m
videofilters/ioscapture.m
voip/scaler.c
voip/ioshardware.m
)
else()
set(OBJC_VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_OBJC
videofilters/msosxdisplay.m
videofilters/qtcapture.m
)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
utils/opengles_display.c
utils/opengles_display.h
utils/shaders.c
utils/shaders.h
${OBJC_VOIP_SOURCE_FILES}
)
set_source_files_properties(${OBJC_VOIP_SOURCE_FILES} PROPERTIES COMPILE_FLAGS "-Wno-error=deprecated-declarations")
endif()
endif()
if (ENABLE_QNX)
list (APPEND VOIP_SOURCE_FILES
videofilters/bb10_display.cpp
videofilters/bb10_capture.cpp
)
set_source_files_properties(videofilters/bb10_display.cpp PROPERTIES LANGUAGE CXX)
set_source_files_properties(videofilters/bb10_capture.cpp PROPERTIES LANGUAGE CXX)
endif()
list(APPEND VOIP_SOURCE_FILES_CXX
videofilters/bb10_display.cpp
videofilters/bb10_capture.cpp
)
endif()
if(FFMPEG_FOUND)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
utils/ffmpeg-priv.c
utils/ffmpeg-priv.h
utils/swscale.h
......@@ -281,54 +285,55 @@ if(ENABLE_VIDEO)
)
endif()
if(GLX_FOUND)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
utils/opengles_display.c
utils/shaders.c
videofilters/glxvideo.c
)
endif()
if(SDL_FOUND)
list(APPEND VOIP_SOURCE_FILES videofilters/videoout.c)
list(APPEND VOIP_SOURCE_FILES_C videofilters/videoout.c)
endif()
if(THEORA_FOUND)
list(APPEND VOIP_SOURCE_FILES videofilters/theora.c)
list(APPEND VOIP_SOURCE_FILES_C videofilters/theora.c)
endif()
if(V4L_FOUND)
if(HAVE_LINUX_VIDEODEV_H)
list(APPEND VOIP_SOURCE_FILES videofilters/msv4l.c)
list(APPEND VOIP_SOURCE_FILES_C videofilters/msv4l.c)
endif()
if(HAVE_LINUX_VIDEODEV2_H)
list(APPEND VOIP_SOURCE_FILES videofilters/msv4l2.c)
list(APPEND VOIP_SOURCE_FILES_C videofilters/msv4l2.c)
endif()
endif()
if(VPX_FOUND)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
videofilters/vp8.c
voip/vp8rtpfmt.c
voip/vp8rtpfmt.h
)
endif()
if(MATROSKA2_FOUND)
list(APPEND VOIP_SOURCE_FILES
list(APPEND VOIP_SOURCE_FILES_C
videofilters/mkv.c
utils/mkv_reader.c
)
endif()
if(X11_FOUND)
list(APPEND VOIP_SOURCE_FILES utils/x11_helper.c)
list(APPEND VOIP_SOURCE_FILES_C utils/x11_helper.c)
endif()
if(XV_FOUND)
list(APPEND VOIP_SOURCE_FILES videofilters/x11video.c)
list(APPEND VOIP_SOURCE_FILES_C videofilters/x11video.c)
endif()
endif()
set(VOIP_GENERATED_SOURCE_FILES
set(VOIP_GENERATED_SOURCE_FILES_C
${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
)
set(VOIP_SOURCE_FILES_ALL ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
COMMAND ${CMAKE_COMMAND} -DAWK_PROGRAM=${AWK_PROGRAM} -DAWK_SCRIPTS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DTYPE=voip -DSOURCE_FILES="${VOIP_SOURCE_FILES}"
-DTYPE=voip -DSOURCE_FILES="${VOIP_SOURCE_FILES_ALL}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_descs_header.cmake)
if(APPLE OR GLX_FOUND)
find_program(XXD_PROGRAM xxd)
......@@ -339,7 +344,7 @@ find_program(SED_PROGRAM sed)
if(NOT SED_PROGRAM)
message(FATAL_ERROR "You need the sed program to build mediastreamer2.")
endif()
list(APPEND VOIP_GENERATED_SOURCE_FILES
list(APPEND VOIP_GENERATED_SOURCE_FILES_C
${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.fs.h
${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
)
......@@ -354,7 +359,15 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
-DSOURCE_FILE="yuv2rgb.vs"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_yuv2rgb_header.cmake)
endif()
set_source_files_properties(${VOIP_GENERATED_SOURCE_FILES} PROPERTIES GENERATED TRUE)
set_source_files_properties(${VOIP_GENERATED_SOURCE_FILES_C} PROPERTIES GENERATED TRUE)
apply_compile_flags(VOIP_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(VOIP_GENERATED_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(VOIP_SOURCE_FILES_OBJC "CPP" "OBJC")
if(VOIP_SOURCE_FILES_CXX)
set_source_files_properties(${VOIP_SOURCE_FILES_CXX} PROPERTIES LANGUAGE CXX)
apply_compile_flags(VOIP_SOURCE_FILES_CXX "CPP" "CXX")
endif()
set(VOIP_LIBS
......@@ -441,9 +454,9 @@ if (CAMAPI_FOUND)
endif()
if(ENABLE_STATIC)
add_library(mediastreamer_voip STATIC ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES} ${VOIP_GENERATED_SOURCE_FILES})
add_library(mediastreamer_voip STATIC ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES_C} ${VOIP_GENERATED_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
else()
add_library(mediastreamer_voip SHARED ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES} ${VOIP_GENERATED_SOURCE_FILES})
add_library(mediastreamer_voip SHARED ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES_C} ${VOIP_GENERATED_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
set_target_properties(mediastreamer_voip PROPERTIES VERSION ${MEDIASTREAMER_SO_VERSION} LINKER_LANGUAGE CXX)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
......@@ -455,7 +468,6 @@ else()
endif()
endif()
target_link_libraries(mediastreamer_voip ${VOIP_LIBS})
target_compile_options(mediastreamer_voip PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......
......@@ -20,7 +20,7 @@
#
############################################################################
set(SOURCE_FILES
set(SOURCE_FILES_C
common/bc_tester_utils.c
mediastreamer2_adaptive_tester.c
mediastreamer2_audio_stream_tester.c
......@@ -33,22 +33,24 @@ set(SOURCE_FILES
mediastreamer2_tester_private.c
mediastreamer2_text_stream_tester.c
)
set(SOURCE_FILES_OBJC )
add_definitions(-DBC_CONFIG_FILE="mediastreamer-config.h")
if(ENABLE_VIDEO)
list(APPEND SOURCE_FILES mediastreamer2_video_stream_tester.c)
list(APPEND SOURCE_FILES_C mediastreamer2_video_stream_tester.c)
endif()
if(APPLE)
list(APPEND SOURCE_FILES mediastreamer2_tester_cocoa.m)
set_source_files_properties(mediastreamer2_tester_cocoa.m PROPERTIES COMPILE_FLAGS "-Wno-error")
list(APPEND SOURCE_FILES_OBJC mediastreamer2_tester_cocoa.m)
endif()
add_executable(mediastreamer2_tester ${SOURCE_FILES})
apply_compile_flags(SOURCE_FILES_C "CPP" "C")
apply_compile_flags(SOURCE_FILES_OBJC "CPP" "OBJC")
add_executable(mediastreamer2_tester ${SOURCE_FILES_C} ${SOURCE_FILES_OBJC})
target_include_directories(mediastreamer2_tester PUBLIC ${CUNIT_INCLUDE_DIRS} PRIVATE common)
target_link_libraries(mediastreamer2_tester mediastreamer_voip mediastreamer_base ${CUNIT_LIBRARIES})
target_compile_options(mediastreamer2_tester PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
......@@ -25,39 +25,44 @@ if(ENABLE_VIDEO)
list(APPEND simple_executables videodisplay test_x11window)
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)
target_link_libraries(${simple_executable} mediastreamer_voip mediastreamer_base)
target_compile_options(${simple_executable} PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
endforeach()
add_executable(ms-echo echo.c) #to avoid conflict with bash command
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
target_link_libraries(ms-echo mediastreamer_voip mediastreamer_base)
target_compile_options(ms-echo PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
if(PCAP_FOUND)
add_executable(pcap_playback pcap_playback.c common.c)
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})
target_link_libraries(pcap_playback mediastreamer_voip mediastreamer_base ${PCAP_LIBRARIES})
target_include_directories(pcap_playback PUBLIC ${PCAP_INCLUDE_DIRS})
target_compile_options(pcap_playback PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
endif()
set(MEDIASTREAM_SOURCE_FILES mediastream.c common.c)
set(MEDIASTREAM_SOURCE_FILES_C mediastream.c common.c)
set(MEDIASTREAM_SOURCE_FILES_OBJC )
if(APPLE)
list(APPEND MEDIASTREAM_SOURCE_FILES mediastream_cocoa.m)
set_source_files_properties(mediastream_cocoa.m PROPERTIES COMPILE_FLAGS "-Wno-error")
list(APPEND MEDIASTREAM_SOURCE_FILES_OBJC mediastream_cocoa.m)
endif()
add_executable(mediastream ${MEDIASTREAM_SOURCE_FILES})
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 mediastreamer_voip mediastreamer_base)
target_compile_options(mediastream PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
if(LINK_FLAGS_STR)
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
if(ENABLE_VIDEO)
add_executable(mkvstream mkvstream.c)
set(MKVSTREAM_SOURCE_FILES mkvstream.c)
apply_compile_flags(MKVSTREAM_SOURCE_FILES "CPP" "C")
add_executable(mkvstream ${MKVSTREAM_SOURCE_FILES})
target_link_libraries(mkvstream mediastreamer_voip mediastreamer_base)
target_compile_options(mkvstream PRIVATE ${STRICT_OPTIONS_CPP} ${STRICT_OPTIONS_C})
install(TARGETS mediastream mkvstream
RUNTIME DESTINATION bin
......
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