Commit af842fa6 authored by jehan's avatar jehan

add bctoolbox target

parent 8a2ca99e
......@@ -65,10 +65,9 @@ else()
if(_target_found GREATER -1)
add_custom_target(TARGET_bellesip ALL)
add_dependencies(TARGET_linphone_builder TARGET_bellesip)
add_dependencies(TARGET_bellesip TARGET_bctoolbox)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
linphone_builder_add_builder_to_target(TARGET_bellesip antlr3c)
linphone_builder_add_builder_to_target(TARGET_bellesip polarssl)
linphone_builder_add_builder_to_target(TARGET_bellesip bctoolbox)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_bellesip cunit)
endif()
......@@ -94,7 +93,7 @@ else()
if(_target_found GREATER -1)
add_custom_target(TARGET_ms2 ALL)
add_dependencies(TARGET_linphone_builder TARGET_ms2)
add_dependencies(TARGET_ms2 TARGET_ortp)
add_dependencies(TARGET_ms2 TARGET_ortp TARGET_bctoolbox)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_ms2 cunit)
......@@ -124,7 +123,6 @@ else()
linphone_builder_add_builder_to_target(TARGET_ms2 srtp)
endif()
if(ENABLE_ZRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 polarssl)
if(NOT IOS)
# Do not build xml2 on IOS, it is provided by the system
linphone_builder_add_builder_to_target(TARGET_ms2 xml2)
......@@ -132,8 +130,6 @@ else()
endif()
endif()
linphone_builder_add_builder_to_target(TARGET_ms2 bctoolbox)
if(ENABLE_ZRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 bzrtp)
endif()
......@@ -190,7 +186,7 @@ else()
if(_target_found GREATER -1)
add_custom_target(TARGET_linphone ALL)
add_dependencies(TARGET_linphone_builder TARGET_linphone)
add_dependencies(TARGET_linphone TARGET_bellesip TARGET_ortp TARGET_ms2)
add_dependencies(TARGET_linphone TARGET_bellesip TARGET_ortp TARGET_ms2 TARGET_bctoolbox)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
if(NOT IOS)
# Do not build sqlite3, xml2 and zlib on IOS, they are provided by the system
......@@ -243,4 +239,17 @@ else()
linphone_builder_add_builder_to_target(TARGET_flexisip flexisip)
endif()
# Build bctoolbox and its dependencies if it is in the targets list
list(FIND LINPHONE_BUILDER_TARGETS "bctoolbox" _target_found)
if(_target_found GREATER -1)
add_custom_target(TARGET_bctoolbox ALL)
add_dependencies(TARGET_linphone_builder TARGET_bctoolbox)
if(ENABLE_MBEDTLS)
linphone_builder_add_builder_to_target(TARGET_linphone mbedtls)
endif()
if(ENABLE_POLARSSL)
linphone_builder_add_builder_to_target(TARGET_linphone polarssl)
endif()
linphone_builder_add_builder_to_target(TARGET_bctoolbox bctoolbox)
endif()
endif()
......@@ -27,7 +27,7 @@ set(EP_linphone_EXTERNAL_SOURCE_PATHS "linphone")
set(EP_linphone_GROUPABLE YES)
set(EP_linphone_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_linphone_DEPENDENCIES EP_bellesip EP_ortp EP_ms2)
set(EP_linphone_DEPENDENCIES EP_bctoolbox EP_bellesip EP_ortp EP_ms2)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT IOS)
# Do not build sqlite3, xml2 and zlib on IOS, they are provided by the system
list(APPEND EP_linphone_DEPENDENCIES EP_sqlite3 EP_xml2)
......@@ -64,3 +64,5 @@ list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS}"
if(ENABLE_UNIT_TESTS AND LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_linphone_DEPENDENCIES EP_cunit)
endif()
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_POLARSSL=${ENABLE_POLARSSL}")
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_MBEDTLS=${ENABLE_MBEDTLS}")
############################################################################
# mbedtls.cmake
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
set(EP_mbedtls_EXTERNAL_SOURCE_PATHS "mbedtls" "externals/mbedtls")
set(EP_mbedtls_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
if(MSVC)
set(EP_mbedtls_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -181,19 +181,42 @@ endfunction()
macro(linphone_builder_create_targets_list)
set(LINPHONE_BUILDER_TARGETS )
if(LINPHONE_BUILDER_TARGET STREQUAL "belle-sip")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "bctoolbox")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "ortp")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "ms2")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2" "bctoolbox")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "ms2-plugins")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "ms2" "ms2-plugins")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "linphone")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "ortp" "ms2" "ms2-plugins" "linphone")
list(APPEND LINPHONE_BUILDER_TARGETS "belle-sip" "ortp" "ms2" "ms2-plugins" "bctoolbox" "linphone")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "flexisip")
list(APPEND LINPHONE_BUILDER_TARGETS "ortp" "flexisip")
elseif(LINPHONE_BUILDER_TARGET STREQUAL "odb")
list(APPEND LINPHONE_BUILDER_TARGETS "odb" )
elseif(LINPHONE_BUILDER_TARGET STREQUAL "bctoolbox")
list(APPEND LINPHONE_BUILDER_TARGETS "bctoolbox" )
else()
message(FATAL_ERROR "Invalid LINPHONE_BUILDER_TARGET '${LINPHONE_BUILDER_TARGET}'")
endif()
endmacro()
macro(linphone_builder_include_builder BUILDER)
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER} _already_included)
if(_already_included EQUAL -1)
message(STATUS "Including builder ${BUILDER}")
include(${CMAKE_CURRENT_SOURCE_DIR}/builders/${BUILDER}.cmake)
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS ${BUILDER})
endif()
unset(_already_included)
endmacro()
macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
linphone_builder_include_builder(${BUILDER})
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH AND (LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS OR LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH))
foreach(SUBDIR ${EP_${BUILDER}_EXTERNAL_SOURCE_PATHS})
else()
message(FATAL_ERROR "Invalid LINPHONE_BUILDER_TARGET '${LINPHONE_BUILDER_TARGET}'")
endif()
......
############################################################################
# bctoolbox.cmake
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# belle-sip build options
option(ENABLE_POLARSSL "Enable polarssl support." ON)
add_feature_info("Polarssl" ENABLE_POLARSSL "Crypto stack implementation based on polarssl")
option(ENABLE_MBEDTLS "Enable mbedtls support." OFF)
add_feature_info("Mbedtls" ENABLE_MBEDTLS "Crypto stack implementation based on mbeddtls")
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