Commit dbf9bb2d authored by Ghislain MARY's avatar Ghislain MARY

Some fixes for IOS build.

parent ba11d799
......@@ -23,7 +23,7 @@
set(EP_antlr3c_GIT_REPOSITORY "git://git.linphone.org/antlr3.git")
set(EP_antlr3c_GIT_TAG_LATEST "linphone")
set(EP_antlr3c_GIT_TAG "099946426e30916ff97e4e52c3bd7d920359a933")
set(EP_antlr3c_EXTERNAL_SOURCE_PATHS "antlr3c" "antlr3")
set(EP_antlr3c_EXTERNAL_SOURCE_PATHS "antlr3c" "antlr3" "externals/antlr3")
set(EP_antlr3c_CMAKE_OPTIONS "-DENABLE_DEBUGGER=NO")
set(EP_antlr3c_LINKING_TYPE "-DENABLE_STATIC=NO")
......
......@@ -23,6 +23,7 @@
set(EP_cunit_GIT_REPOSITORY "git://git.linphone.org/cunit.git")
set(EP_cunit_GIT_TAG_LATEST "linphone")
set(EP_cunit_GIT_TAG "f5ca2e89288638b9b86330c427b0b787a7e8ed7c")
set(EP_cunit_EXTERNAL_SOURCE_PATHS "cunit" "externals/cunit")
set(EP_cunit_CMAKE_OPTIONS "-DENABLE_AUTOMATED=1" "-DENABLE_CONSOLE=0")
set(EP_cunit_LINKING_TYPE "-DENABLE_STATIC=0")
......
......@@ -23,7 +23,7 @@
set(EP_gsm_GIT_REPOSITORY "git://git.linphone.org/gsm.git")
set(EP_gsm_GIT_TAG_LATEST "linphone")
set(EP_gsm_GIT_TAG "8722e2c643ab6cc727c62fc960cbefd43e024329")
set(EP_gsm_EXTERNAL_SOURCE_PATHS "gsm")
set(EP_gsm_EXTERNAL_SOURCE_PATHS "gsm" "externals/gsm")
set(EP_gsm_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/gsm/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_gsm_LINKING_TYPE "-DENABLE_STATIC=NO")
......
......@@ -23,6 +23,7 @@
set(EP_msamr_GIT_REPOSITORY "git://git.linphone.org/msamr.git")
set(EP_msamr_GIT_TAG_LATEST "master")
set(EP_msamr_GIT_TAG "43468db707a73e7404972eb496221a35db84415e")
set(EP_msamr_EXTERNAL_SOURCE_PATHS "msamr")
set(EP_msamr_CMAKE_OPTIONS )
set(EP_msamr_DEPENDENCIES EP_ms2 EP_opencoreamr)
......
......@@ -38,6 +38,7 @@ else()
set(EP_opencoreamr_CMAKE_OPTIONS )
set(EP_opencoreamr_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opencoreamr/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_opencoreamr_LINKING_TYPE "-DENABLE_STATIC=YES")
set(EP_opencoreamr_EXTERNAL_SOURCE_PATHS "externals/opencore-amr")
if(ENABLE_AMRNB)
list(APPEND EP_opencoreamr_CMAKE_OPTIONS "-DENABLE_AMRNB_DECODER=YES" "-DENABLE_AMRNB_ENCODER=YES")
......
......@@ -35,7 +35,7 @@ if(EP_opus_PREBUILT)
else()
set(EP_opus_URL "http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz")
set(EP_opus_URL_HASH "MD5=c5a8cf7c0b066759542bc4ca46817ac6")
set(EP_opus_EXTERNAL_SOURCE_PATHS "opus")
set(EP_opus_EXTERNAL_SOURCE_PATHS "opus" "externals/opus")
set(EP_opus_CMAKE_OPTIONS )
set(EP_opus_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/CMakeLists.txt" "<SOURCE_DIR>")
list(APPEND EP_opus_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/config.h.cmake" "<SOURCE_DIR>")
......
......@@ -23,7 +23,7 @@
set(EP_polarssl_GIT_REPOSITORY "git://git.linphone.org/polarssl.git")
set(EP_polarssl_GIT_TAG_LATEST "linphone-1.4")
set(EP_polarssl_GIT_TAG "68ed1474bf3919248f0b9f52fc582d60d4c2991d")
set(EP_polarssl_EXTERNAL_SOURCE_PATHS "polarssl")
set(EP_polarssl_EXTERNAL_SOURCE_PATHS "polarssl" "externals/polarssl")
set(EP_polarssl_CMAKE_OPTIONS "-DENABLE_PROGRAMS=0" "-DENABLE_TESTING=0")
set(EP_polarssl_LINKING_TYPE "-DUSE_SHARED_POLARSSL_LIBRARY=1")
......
......@@ -23,7 +23,7 @@
set(EP_speex_GIT_REPOSITORY "git://git.linphone.org/speex.git")
set(EP_speex_GIT_TAG_LATEST "linphone")
set(EP_speex_GIT_TAG "f3df5a5451088921fe539bbb21dc4cf20704e08f")
set(EP_speex_EXTERNAL_SOURCE_PATHS "speex")
set(EP_speex_EXTERNAL_SOURCE_PATHS "speex" "externals/speex")
set(EP_speex_LINKING_TYPE "-DENABLE_STATIC=NO")
if(MSVC)
......
......@@ -23,7 +23,7 @@
set(EP_srtp_GIT_REPOSITORY "git://git.linphone.org/srtp.git")
set(EP_srtp_GIT_TAG_LATEST "master")
set(EP_srtp_GIT_TAG "6271df37613cce36dfa61c97fcf751228755727c")
set(EP_srtp_EXTERNAL_SOURCE_PATHS "srtp")
set(EP_srtp_EXTERNAL_SOURCE_PATHS "srtp" "externals/srtp")
set(EP_srtp_LINKING_TYPE "-DENABLE_STATIC=NO")
if(MSVC)
......
......@@ -35,7 +35,7 @@ if(EP_xml2_PREBUILT)
else()
set(EP_xml2_GIT_REPOSITORY "git://git.linphone.org/libxml2")
set(EP_xml2_GIT_TAG "v2.8.0")
set(EP_xml2_EXTERNAL_SOURCE_PATHS "libxml2" "xml2")
set(EP_xml2_EXTERNAL_SOURCE_PATHS "libxml2" "xml2" "externals/libxml2")
set(EP_xml2_LINKING_TYPE "-DENABLE_STATIC=NO")
set(EP_xml2_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/CMakeLists.txt" "<SOURCE_DIR>")
......
......@@ -444,6 +444,7 @@ macro(linphone_builder_set_ep_directories PROJNAME)
string(REGEX REPLACE "config-" "" CONFIG_NAME ${CONFIG_NAME})
set(ep_source "${ep_base}/Source/EP_${PROJNAME}")
set(ep_tmp "${ep_base}/tmp-${CONFIG_NAME}/${PROJNAME}")
set(ep_stamp "${ep_base}/Stamp-${CONFIG_NAME}/${PROJNAME}")
if("${EP_${PROJNAME}_BUILD_IN_SOURCE}" STREQUAL "yes")
set(ep_build "${ep_source}")
else()
......@@ -671,6 +672,7 @@ function(linphone_builder_add_project PROJNAME)
ExternalProject_Add(EP_${PROJNAME}
DEPENDS ${EP_${PROJNAME}_DEPENDENCIES}
TMP_DIR ${ep_tmp}
STAMP_DIR ${ep_stamp}
BINARY_DIR ${ep_build}
${DOWNLOAD_SOURCE}
PATCH_COMMAND ${EP_${PROJNAME}_PATCH_COMMAND}
......
......@@ -27,7 +27,7 @@ set(DEFAULT_VALUE_ENABLE_FFMPEG OFF)
set(DEFAULT_VALUE_ENABLE_ZRTP OFF)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_AMRNB ON)
set(DEFAULT_VALUE_ENABLE_AMRWB ON)
set(DEFAULT_VALUE_ENABLE_AMRWB OFF)
set(DEFAULT_VALUE_ENABLE_G729 OFF)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC OFF)
......@@ -48,7 +48,7 @@ set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
# Global configuration
set(SDK_VERSION 4.0)
set(SDK_VERSION 6.0)
get_filename_component(COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
string(REGEX REPLACE "-clang$" "" LINPHONE_BUILDER_HOST ${COMPILER_NAME})
unset(COMPILER_NAME)
......@@ -61,7 +61,6 @@ list(GET CMAKE_FIND_ROOT_PATH 0 SYSROOT_PATH)
set(COMMON_FLAGS "-arch ${CMAKE_SYSTEM_PROCESSOR} -isysroot ${SYSROOT_PATH} -m${CLANG_TARGET_SPECIFIER}=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS -fms-extensions")
set(LINPHONE_BUILDER_CPPFLAGS "${COMMON_FLAGS} -Dasm=__asm")
set(LINPHONE_BUILDER_CFLAGS "-std=c99")
#set(LINPHONE_BUILDER_OBJCFLAGS "-std=c99 ${COMMON_FLAGS} -x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch")
set(LINPHONE_BUILDER_LDFLAGS "${COMMON_FLAGS}")
set(LINPHONE_BUILDER_PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) # Restrict pkg-config to search in the install directory
unset(COMMON_FLAGS)
......@@ -79,6 +78,7 @@ set(EP_antlr3c_LINKING_TYPE "-DENABLE_STATIC=YES")
# belle-sip
set(EP_bellesip_LINKING_TYPE "-DENABLE_STATIC=YES")
list(APPEND EP_bellesip_CMAKE_OPTIONS "-DENABLE_TESTS=NO")
# cunit
set(EP_cunit_LINKING_TYPE "-DENABLE_STATIC=YES")
......@@ -90,39 +90,20 @@ set(EP_ffmpeg_LINKING_TYPE "--enable-static" "--disable-shared")
set(EP_gsm_LINKING_TYPE "-DENABLE_STATIC=YES")
# linphone
list(APPEND EP_linphone_CONFIGURE_OPTIONS
"--disable-nls"
"--with-readline=none"
"--enable-gtk_ui=no"
"--enable-console_ui=no"
"--disable-x11"
"--disable-tutorials"
"--disable-tools"
"--disable-msg-storage"
"--disable-video"
"--disable-alsa"
"--enable-relativeprefix=yes"
"--disable-tests"
)
set(EP_linphone_LINKING_TYPE "--enable-static" "--disable-shared")
set(EP_linphone_LINKING_TYPE "-DENABLE_STATIC=YES")
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_RELATIVE_PREFIX=YES" "-DENABLE_CONSOLE_UI=NO" "-DENABLE_GTK_UI=NO" "-DENABLE_NOTIFY=NO" "-DENABLE_TOOLS=NO" "-DENABLE_TUTORIALS=NO" "-DENABLE_UPNP=NO" "-DENABLE_MSG_STORAGE=YES" "-DENABLE_DOC=NO" "-DENABLE_UNIT_TESTS=NO")
# mediastreamer2
list(APPEND EP_ms2_CONFIGURE_OPTIONS
"--disable-nls"
"--disable-theora"
"--disable-sdl"
"--disable-x11"
"--disable-video"
"--disable-alsa"
"--enable-relativeprefix=yes"
)
set(EP_ms2_LINKING_TYPE "--enable-static" "--disable-shared")
set(EP_ms2_LINKING_TYPE "-DENABLE_STATIC=YES")
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_RELATIVE_PREFIX=YES")
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_ALSA=NO" "-DENABLE_PULSEAUDIO=NO" "-DENABLE_OSS=NO" "-DENABLE_GLX=NO" "-DENABLE_X11=NO" "-DENABLE_XV=NO" "-DENABLE_TOOLS=NO" "-DENABLE_DOC=NO" "-DENABLE_UNIT_TESTS=NO")
# opus
set(EP_opus_LINKING_TYPE "--enable-static" "--disable-shared")
set(EP_opus_LINKING_TYPE "-DENABLE_STATIC=YES")
# ortp
set(EP_ortp_LINKING_TYPE "--enable-static" "--disable-shared")
set(EP_ortp_LINKING_TYPE "-DENABLE_STATIC=YES")
list(APPEND EP_ortp_CMAKE_OPTIONS "-DENABLE_DOC=NO")
# polarssl
set(EP_polarssl_LINKING_TYPE "-DUSE_SHARED_POLARSSL_LIBRARY=0")
......@@ -138,3 +119,4 @@ set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared")
# xml2
set(EP_xml2_LINKING_TYPE "-DENABLE_STATIC=YES")
......@@ -39,6 +39,8 @@ class Target:
self.config_file = None
self.toolchain_file = None
self.additional_args = []
self.work_dir = os.getcwd() + '/WORK'
self.cmake_dir = self.work_dir + '/cmake-' + self.name
def output_dir(self):
output_dir = self.output
......@@ -50,13 +52,15 @@ class Target:
return output_dir
def cmake_command(self, build_type, latest, list_cmake_variables, additional_args):
cmd = ['cmake', '../..']
current_path = os.path.dirname(os.path.realpath(__file__))
cmd = ['cmake', current_path]
if self.generator is not None:
cmd += ['-G', self.generator]
if self.platform_name is not None:
cmd += ['-A', self.platform_name]
cmd += ['-DCMAKE_BUILD_TYPE=' + build_type]
cmd += ['-DCMAKE_PREFIX_PATH=' + self.output_dir(), '-DCMAKE_INSTALL_PREFIX=' + self.output_dir()]
cmd += ['-DLINPHONE_BUILDER_WORK_DIR=' + self.work_dir + '/..']
if self.toolchain_file is not None:
cmd += ['-DCMAKE_TOOLCHAIN_FILE=' + self.toolchain_file]
if self.config_file is not None:
......@@ -134,9 +138,13 @@ class DesktopTarget(Target):
class IOSTarget(Target):
def __init__(self, arch):
Target.__init__(self, 'ios-' + arch)
current_path = os.path.dirname(os.path.realpath(__file__))
self.config_file = 'configs/config-ios-' + arch + '.cmake'
self.toolchain_file = 'toolchains/toolchain-ios-' + arch + '.cmake'
self.output = 'OUTPUT/liblinphone-ios-sdk/' + arch
self.additional_args = [
'-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + current_path + '/..'
]
class IOSi386Target(IOSTarget):
def __init__(self):
......@@ -181,16 +189,15 @@ def run(target, debug, latest, list_cmake_variables, force_build, additional_arg
if debug:
build_type = 'Debug'
work_dir = 'WORK/cmake-' + target.name
if os.path.isdir(work_dir):
if os.path.isdir(target.cmake_dir):
if force_build is False:
print("Working directory {} already exists. Please remove it (option -C or -c) before re-executing CMake "
"to avoid conflicts between executions.".format(work_dir))
"to avoid conflicts between executions.".format(target.cmake_dir))
return 1
else:
os.makedirs(work_dir)
os.makedirs(target.cmake_dir)
proc = subprocess.Popen(target.cmake_command(build_type, latest, list_cmake_variables, additional_args), cwd=work_dir, shell=False)
proc = subprocess.Popen(target.cmake_command(build_type, latest, list_cmake_variables, additional_args), cwd=target.cmake_dir, shell=False)
proc.communicate()
return proc.returncode
......@@ -215,16 +222,15 @@ def main(argv = None):
if args.output:
target.output = args.output
retcode = 0
if args.veryclean:
target.veryclean()
return 0
if args.clean:
elif args.clean:
target.clean()
return 0
retcode = run(target, args.debug, args.latest, args.list_cmake_variables, args.force, additional_args)
if retcode == 0:
print("\n" + target.build_instructions(args.debug))
else:
retcode = run(target, args.debug, args.latest, args.list_cmake_variables, args.force, additional_args)
if retcode == 0:
print("\n" + target.build_instructions(args.debug))
return retcode
if __name__ == "__main__":
......
......@@ -66,6 +66,7 @@ set(CMAKE_CROSSCOMPILING TRUE)
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Darwin")
set(CMAKE_SYSTEM_PROCESSOR ${SYSTEM_PROCESSOR})
set(IOS True)
# Define the compiler
CMAKE_FORCE_C_COMPILER(${IOS_TOOLCHAIN_CC} Clang)
......
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