Commit cacc0196 authored by Ghislain MARY's avatar Ghislain MARY

Use bc_apply_compile_flags from bctoolbox CMake utils.

parent 9acd4307
......@@ -42,22 +42,6 @@ option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
set(WITH_THREAD_STACK_SIZE "0" CACHE STRING "Set thread stack size (0 is the OS default).")
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()
include(CheckIncludeFile)
include(CheckFunctionExists)
include(GNUInstallDirs)
......
......@@ -81,8 +81,8 @@ if(WIN32)
endif()
endif()
apply_compile_flags(ORTP_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(ORTP_SOURCE_FILES_CXX "CPP" "CXX")
bc_apply_compile_flags(ORTP_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
bc_apply_compile_flags(ORTP_SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
if(ENABLE_STATIC)
add_library(ortp-static STATIC ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
......
......@@ -23,7 +23,7 @@
if (NOT IOS)
set(EXECUTABLES rtpsend rtprecv mrtpsend mrtprecv test_timer tevrtpsend tevrtprecv rtpsend_stupid)
foreach(executable ${EXECUTABLES})
apply_compile_flags(${executable}.c "CPP" "C")
bc_apply_compile_flags(${executable}.c STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
add_executable(${executable} ${executable}.c)
target_link_libraries(${executable} ortp)
endforeach()
......
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