Commit 52440dc7 authored by Ghislain MARY's avatar Ghislain MARY

Use bc_apply_compile_flags from bctoolbox CMake utils.

parent d95f3f9f
......@@ -42,22 +42,6 @@ option(ENABLE_TUNNEL "Enable tunnel support" OFF)
option(ENABLE_TESTS "Enable compilation of tests" ON)
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(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
......
......@@ -165,11 +165,11 @@ if(APPLE)
)
endif()
apply_compile_flags(BELLE_SIP_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(BELLE_SIP_SOURCE_FILES_OBJC "CPP" "OBJC")
bc_apply_compile_flags(BELLE_SIP_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
bc_apply_compile_flags(BELLE_SIP_SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
if(BELLE_SIP_SOURCE_FILES_CXX)
set_source_files_properties(${BELLE_SIP_SOURCE_FILES_CXX} PROPERTIES LANGUAGE CXX)
apply_compile_flags(BELLE_SIP_SOURCE_FILES_CXX "CPP" "CXX")
bc_apply_compile_flags(BELLE_SIP_SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
endif()
if(MSVC)
get_source_file_property(DNS_C_COMPILE_FLAGS dns.c COMPILE_FLAGS)
......
......@@ -51,8 +51,8 @@ if (IOS)
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
apply_compile_flags(SOURCE_FILES_C "CPP" "C")
apply_compile_flags(SOURCE_FILES_OBJC "CPP" "OBJC")
bc_apply_compile_flags(SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
bc_apply_compile_flags(SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(belle_sip_tester_static STATIC ${SOURCE_FILES_C})
......@@ -110,7 +110,7 @@ else()
set(OBJECT_DESCRIBE_SOURCES describe.c)
apply_compile_flags(OBJECT_DESCRIBE_SOURCES "CPP" "C")
bc_apply_compile_flags(OBJECT_DESCRIBE_SOURCES STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
add_executable(belle_sip_object_describe ${USE_BUNDLE} ${OBJECT_DESCRIBE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_object_describe PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......@@ -120,7 +120,7 @@ else()
set(PARSE_SOURCES parse.c)
apply_compile_flags(PARSE_SOURCES "CPP" "C")
bc_apply_compile_flags(PARSE_SOURCES STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
add_executable(belle_sip_parse ${USE_BUNDLE} ${PARSE_SOURCES})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_parse PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......
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