Commit 2d79d17f authored by DanmeiChen's avatar DanmeiChen

Merge branch 'feature/enable_wrapper_swift'

parents c3462af9 22b9964f
......@@ -43,6 +43,8 @@ option(ENABLE_STATIC "Build static library." YES)
option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." YES)
option(ENABLE_CSHARP_WRAPPER "Build the C# wrapper for Liblinphone." OFF)
option(ENABLE_CXX_WRAPPER "Build the C++ wrapper for Liblinphone." YES)
option(ENABLE_SWIFT_WRAPPER "Build the swift wrapper for Liblinphone." OFF)
option(ENABLE_JAZZY_DOC "Build the jazzy doc for swift module of Liblinphone." OFF)
option(ENABLE_DAEMON "Enable the linphone daemon interface." YES)
option(ENABLE_DATE "Use build date in internal version number." NO)
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
......@@ -186,7 +188,7 @@ if(ENABLE_LIME)
endif()
set(HAVE_LIME 1)
endif()
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_DOC)
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_SWIFT_WRAPPER OR ENABLE_DOC)
find_package(PythonInterp REQUIRED)
check_python_module(pystache)
check_python_module(six)
......@@ -194,6 +196,7 @@ if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_
check_python_module(sphinx)
check_python_module(javasphinx)
check_python_module(sphinx_csharp)
check_python_module(swift_domain)
endif()
endif()
......@@ -393,6 +396,9 @@ endif()
if(ENABLE_CSHARP_WRAPPER)
add_subdirectory(wrappers/csharp)
endif()
if(ENABLE_SWIFT_WRAPPER)
add_subdirectory(wrappers/swift)
endif()
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
......
......@@ -37,7 +37,13 @@ find_path(LIBXSD_INCLUDE_DIRS
if(LIBXSD_INCLUDE_DIRS)
list(APPEND LIBXSD_INCLUDE_DIRS ${XercesC_INCLUDE_DIRS})
endif()
set(LIBXSD_LIBRARIES ${XercesC_LIBRARIES})
if(APPLE)
set(LIBXSD_LIBRARIES ${XercesC_LIBRARIES} "-framework CoreServices")
else()
set(LIBXSD_LIBRARIES ${XercesC_LIBRARIES})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibXsd
......
......@@ -20,7 +20,7 @@
#
################################################################################
if(ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER)
if(ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_SWIFT_WRAPPER)
find_package(Doxygen REQUIRED)
if(DOXYGEN_FOUND)
set(top_srcdir "${PROJECT_SOURCE_DIR}")
......
......@@ -31,7 +31,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx_csharp.csharp', 'javasphinx']
extensions = ['sphinx_csharp.csharp', 'javasphinx', 'swift_domain']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......
......@@ -171,7 +171,8 @@ class LangInfo:
'C' : 'C',
'Cpp' : 'C++',
'Java' : 'Java',
'CSharp': 'C#'
'CSharp': 'C#',
'Swift' : 'Swift'
}
......@@ -237,7 +238,10 @@ class SphinxPart(object):
class EnumPart(SphinxPart):
def __init__(self, enum, lang, langs, namespace=None):
SphinxPart.__init__(self, lang, langs)
self.name = enum.name.translate(self.lang.nameTranslator)
if lang.langCode == 'Swift' and type(enum.parent) is abstractapi.Class :
self.name = enum.name.translate(self.lang.nameTranslator,recursive=True, topAncestor=namespace)
else:
self.name = enum.name.translate(self.lang.nameTranslator)
self.fullName = enum.name.translate(self.lang.nameTranslator, recursive=True)
self.briefDesc = enum.briefDescription.translate(self.docTranslator)
self.enumerators = [self._translate_enumerator(enumerator) for enumerator in enum.enumerators]
......@@ -315,7 +319,7 @@ class EnumPage(SphinxPage):
filename = SphinxPage._classname_to_filename(enum.name)
SphinxPage.__init__(self, lang, langs, filename)
namespace = enum.find_first_ancestor_by_type(abstractapi.Namespace)
self.namespace = namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None
self.namespace = namespace.name.translate(lang.nameTranslator) if lang.langCode not in ['C', 'Swift'] else None
self.enum = EnumPart(enum, lang, langs, namespace=namespace)
......@@ -368,15 +372,19 @@ class ClassPage(SphinxPage):
propertyAttr['ref_label'] += (property_.getter.name.to_snake_case(fullName=True) if property_.getter is not None else property_.setter.name.to_snake_case(fullName=True))
translatedProperties.append(propertyAttr)
return translatedProperties
def _translate_methods(self, methods):
translatedMethods = []
for method in methods:
translatedMethods.append(self._translate_method(method))
return translatedMethods
def _translate_method(self, method):
namespace = method.find_first_ancestor_by_type(abstractapi.Class,abstractapi.Interface)
if self.lang.langCode == 'Swift':
namespace = method.find_first_ancestor_by_type(abstractapi.Namespace)
else:
namespace = method.find_first_ancestor_by_type(abstractapi.Class,abstractapi.Interface)
methAttr = {
'prototype' : method.translate_as_prototype(self.lang.langTranslator, namespace=namespace),
'briefDoc' : method.briefDescription.translate(self.docTranslator),
......@@ -385,7 +393,7 @@ class ClassPage(SphinxPage):
}
reference = metadoc.FunctionReference(None)
reference.relatedObject = method
methAttr['link'] = reference.translate(self.lang.docTranslator, namespace=method.find_first_ancestor_by_type(abstractapi.Class, abstractapi.Interface))
methAttr['link'] = reference.translate(self.lang.docTranslator, namespace=namespace)
return methAttr
@property
......@@ -449,9 +457,10 @@ class DocGenerator:
LangInfo('C'),
LangInfo('Cpp'),
LangInfo('Java'),
LangInfo('CSharp')
LangInfo('CSharp'),
LangInfo('Swift')
]
def generate(self, outputdir):
for lang in self.languages:
directory = os.path.join(args.outputdir, lang.directory)
......
//
// include.h
// LinphoneSdk
//
// Created by Danmei Chen on 15/05/2019.
// Copyright © 2019 belledonne. All rights reserved.
//
#ifndef include_h
#define include_h
#import "linphone/factory.h"
#import "linphone/types.h"
#import "linphone/auth_info.h"
#import "linphone/core.h"
#import "linphone/tunnel.h"
#import "linphone/wrapper_utils.h"
#import "linphone/core_utils.h"
#import "belle-sip/object.h"
#import "bctoolbox/list.h"
#import "mediastreamer2/msfactory.h"
#endif /* include_h */
module linphone {
umbrella header "include.h"
export *
module * { export * }
}
//
// include.h
// LinphoneSdk
//
// Created by Danmei Chen on 15/05/2019.
// Copyright © 2019 belledonne. All rights reserved.
//
#ifndef include_h
#define include_h
#import "linphone/factory.h"
#import "linphone/types.h"
#import "linphone/auth_info.h"
#import "linphone/core.h"
#import "linphone/tunnel.h"
#import "linphone/wrapper_utils.h"
#import "linphone/core_utils.h"
#import "belle-sip/object.h"
#import "bctoolbox/list.h"
#import "mediastreamer2/msfactory.h"
#endif /* include_h */
module linphone {
umbrella header "Modules/include.h"
export *
module * { export * }
}
......@@ -29,6 +29,9 @@ set(LIBS
${BELR_LIBRARIES}
${LIBXSD_LIBRARIES}
)
if(APPLE)
list(APPEND LIBS "-framework CFNetwork")
endif()
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND LIBS "Ws2_32")
endif()
......@@ -433,6 +436,7 @@ if(ENABLE_SHARED)
"${CMAKE_CURRENT_SOURCE_DIR}/../share/cpim_grammar"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/rootca.pem"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/ringback.wav"
"${CMAKE_CURRENT_SOURCE_DIR}/../share/Modules"
) # Keep it relative to current dir to allow CMakeList inclusion
add_library(linphone SHARED ${LINPHONE_RESOURCES} ${LINPHONE_HEADER_FILES}
${LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES} ${LINPHONE_CXX_OBJECTS_SOURCE_FILES} ${LINPHONE_OBJC_SOURCE_FILES}
......
......@@ -298,28 +298,41 @@ class Enum(DocumentableObject):
def __init__(self, name):
DocumentableObject.__init__(self, name)
self.enumerators = []
def add_enumerator(self, enumerator):
self.enumerators.append(enumerator)
enumerator.parent = self
def set_from_c(self, cEnum, namespace=None):
Object.set_from_c(self, cEnum, namespace=namespace)
if 'associatedTypedef' in dir(cEnum):
name = cEnum.associatedTypedef.name
else:
name = cEnum.name
self.name = metaname.EnumName()
self.name.prev = None if namespace is None else namespace.name
self.name.set_from_c(name)
for cEnumValue in cEnum.values:
aEnumValue = Enumerator()
aEnumValue.set_from_c(cEnumValue, namespace=self)
self.add_enumerator(aEnumValue)
@property
def isUnsigned(self):
for enumerator in self.enumerators:
if isinstance(enumerator.value, int) and enumerator.value < 0:
return False
return True
@property
def isFlag(self):
for enumerator in self.enumerators:
if isinstance(enumerator.value, Flag):
return True
return False
class Argument(DocumentableObject):
def __init__(self, name, argType, optional=False, default=None):
......@@ -1029,8 +1042,8 @@ class CLangTranslator(CLikeLangTranslator):
return '1<<{0}'.format(value.position)
else:
raise TypeError('invalid enumerator value type: {0}'.format(value))
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None):
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideArgTypes=False, hideReturnType=False, stripDeclarators=False, namespace=None):
_class = method.find_first_ancestor_by_type(Class,Interface)
params = []
if not hideArguments:
......@@ -1139,13 +1152,13 @@ class CppLangTranslator(CLikeLangTranslator):
res = _type.containedTypeDesc.translate(self)
else:
res = _type.containedTypeDesc.translate(self, namespace=namespace)
if type(_type.parent) is Argument:
return 'const std::list<{0}> &'.format(res)
else:
return 'std::list<{0}>'.format(res)
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None):
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideArgTypes=False, hideReturnType=False, stripDeclarators=False, namespace=None):
argsAsString = ', '.join([arg.translate(self, hideArgName=hideArgNames, namespace=namespace) for arg in method.args]) if not hideArguments else ''
return '{return_}{name}({args}){const}'.format(
return_=(method.returnType.translate(self, namespace=namespace) + ' ') if not hideReturnType else '',
......@@ -1256,7 +1269,7 @@ class JavaLangTranslator(CLikeLangTranslator):
res += (' ' + arg.name.translate(self.nameTranslator))
return res
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None):
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideArgTypes=False, hideReturnType=False, stripDeclarators=False, namespace=None):
return '{public}{returnType}{methodName}({arguments})'.format(
public='public ' if not stripDeclarators else '',
returnType=(method.returnType.translate(self, isReturn=True, namespace=namespace) + ' ') if not hideReturnType else '',
......@@ -1264,6 +1277,102 @@ class JavaLangTranslator(CLikeLangTranslator):
arguments=', '.join([arg.translate(self, hideArgName=hideArgNames, namespace=namespace) for arg in method.args]) if not hideArguments else ''
)
class SwiftLangTranslator(CLikeLangTranslator):
def __init__(self):
self.nameTranslator = metaname.Translator.get('Swift')
self.nilToken = 'nil'
self.falseConstantToken = 'false'
self.trueConstantToken = 'true'
def translate_base_type(self, _type, namespace=None):
if _type.name == 'void':
if _type.isref:
return 'UnsafeMutableRawPointer'
return 'void'
elif _type.name == 'status':
return 'void'
elif _type.name == 'boolean':
return 'Bool'
elif _type.name == 'integer':
if _type.size is None:
res = 'Int'
else:
res = 'Int{0}'.format(_type.size)
if _type.isUnsigned:
res = 'U' + res
if _type.isref:
res = 'UnsafePointer<' + res + '>'
return res
elif _type.name == 'string':
return 'String'
elif _type.name == 'character':
if _type.isUnsigned:
return 'byte'
else:
return 'CChar'
elif _type.name == 'time':
return 'Int'
elif _type.name == 'size':
return 'Int'
elif _type.name == 'floatant':
if _type.size is not None and _type.isref:
return 'UnsafeMutablePointer<Float>'
else:
return 'Float'
elif _type.name == 'string_array':
return '[String]'
else:
raise TranslationError('\'{0}\' is not a base abstract type'.format(_type.name))
def translate_enum_type(self, _type, namespace=None):
return _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace))
def translate_class_type(self, _type, namespace=None):
return _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace))
def translate_list_type(self, _type, namespace=None):
if type(_type.containedTypeDesc) is BaseType:
if _type.containedTypeDesc.name == 'string':
return '[String]'
else:
raise TranslationError('translation of bctbx_list_t of basic C types is not supported')
elif type(_type.containedTypeDesc) is ClassType:
ptrType = _type.containedTypeDesc.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace))
return '[' + ptrType + ']'
else:
if _type.containedTypeDesc:
raise TranslationError('translation of bctbx_list_t of enums')
else:
raise TranslationError('translation of bctbx_list_t of unknow type !')
def translate_argument(self, arg, namespace=None):
argType = arg.type.translate(self, namespace=None)
if argType == 'UnsafePointer<Int>' and not arg.type.isconst:
argType = 'UnsafeMutablePointer<Int32>'
elif argType == 'UnsafeMutableRawPointer':
argType = 'UnsafeMutableRawPointer?'
return '{0}: {1}'.format(arg.name.translate(self.nameTranslator), argType)
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideArgTypes=False, hideReturnType=False, stripDeclarators=False, namespace=None):
params = []
if not hideArguments:
for arg in method.args:
argName = arg.name.translate(self.nameTranslator)
params.append(arg.translate(self, namespace=namespace) if not hideArgTypes else argName + ':')
returnType = method.returnType.translate(self)
returnValue = ''
if returnType != 'void':
returnValue = ' -> ' + returnType + ('?' if type(method.returnType) is ClassType and 'create' in method.name.to_word_list() else '')
return '{name}({params}){returnValue}'.format(
name = method.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)),
params = ', '.join(params) if not hideArgTypes else ''.join(params),
returnValue= returnValue if not hideArgTypes else ''
)
class CSharpLangTranslator(CLikeLangTranslator):
def __init__(self):
......@@ -1347,14 +1456,14 @@ class CSharpLangTranslator(CLikeLangTranslator):
raise TranslationError('translation of bctbx_list_t of enums')
else:
raise TranslationError('translation of bctbx_list_t of unknow type !')
def translate_argument(self, arg, dllImport=True, namespace=None):
return '{0} {1}'.format(
arg.type.translate(self, dllImport=dllImport, namespace=None),
arg.name.translate(self.nameTranslator)
)
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None):
def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideArgTypes=False, hideReturnType=False, stripDeclarators=False, namespace=None):
return '{static}{override}{returnType}{name}({args})'.format(
static = 'static ' if method.type == Method.Type.Class and not stripDeclarators else '',
override = 'override ' if method.name.translate(self.nameTranslator) == 'ToString' and not stripDeclarators else '',
......
......@@ -547,10 +547,45 @@ class DoxygenTranslator(Translator):
class JavaDocTranslator(DoxygenTranslator):
def __init__(self):
DoxygenTranslator.__init__(self, 'C')
def _tag_as_brief(self, lines):
pass
class SwiftDocTranslator(JavaDocTranslator):
def __init__(self):
DoxygenTranslator.__init__(self, 'Swift')
def translate_class_reference(self, ref, **kargs):
if isinstance(ref.relatedObject, (abstractapi.Class, abstractapi.Enum)):
return '`{0}`'.format(Translator.translate_reference(self, ref))
else:
raise ReferenceTranslationError(ref.cname)
def _translate_section(self, section):
if section.kind == 'return':
section.kind = 'Returns'
elif section.kind == 'warning':
section.kind = 'Warning'
elif section.kind == 'note':
section.kind = 'Note'
elif section.kind == 'see':
section.kind = 'See also'
else:
logging.warning('doc translate section pointing on an unknown object ({0})'.format(section.kind))
return '- {0}: {1}'.format(
section.kind,
self._translate_paragraph(section.paragraph)
)
def _translate_parameter_list(self, parameterList):
text = ''
for paramDesc in parameterList.parameters:
if self.displaySelfParam or not paramDesc.is_self_parameter():
desc = self._translate_description(paramDesc.desc)
desc = desc[0] if len(desc) > 0 else ''
text += ('- Parameter {0}: {1}\n'.format(paramDesc.name.translate(self.nameTranslator), desc))
return text
class SphinxTranslator(Translator):
def __init__(self, langCode):
......@@ -594,6 +629,13 @@ class SphinxTranslator(Translator):
self.enumeratorDeclarator = 'field'
self.namespaceDeclarator = 'package'
self.methodReferencer = 'meth'
elif langCode == 'Swift':
self.domain = 'swift'
self.classDeclarator = 'class'
self.interfaceDeclarator = self.classDeclarator
self.methodDeclarator = 'class_method'
self.enumDeclarator = 'enum'
self.enumeratorDeclarator = 'enum_case'
else:
raise ValueError('invalid language code: {0}'.format(langCode))
......@@ -617,10 +659,13 @@ class SphinxTranslator(Translator):
raise ValueError("'{0}' referencer type not supported".format(typeName))
def translate_class_reference(self, ref, label=None, namespace=None):
refStr = Translator.translate_reference(self, ref, absName=True)
tag = self._sphinx_ref_tag(ref)
return ':{tag}:`{label} <{ref}>`'.format(
tag=self._sphinx_ref_tag(ref),
tag=tag,
label=label if label is not None else Translator.translate_reference(self, ref, namespace=namespace),
ref=Translator.translate_reference(self, ref, absName=True)
ref=tag.split(':')[1] + " " + refStr if self.domain == 'swift' else refStr
)
def translate_function_reference(self, ref, label=None, useNamespace=True, namespace=None):
......@@ -628,16 +673,17 @@ class SphinxTranslator(Translator):
refStr = ref.relatedObject.name.translate(self.nameTranslator, **abstractapi.Translator._namespace_to_name_translator_params(namespace))
else:
refStr = ref.relatedObject.translate_as_prototype(self.langTranslator,
hideArguments=self.domain != 'java',
hideArguments=self.domain not in ['java', 'swift'],
hideArgNames=self.domain == 'java',
hideArgTypes=self.domain == 'swift',
hideReturnType=True,
stripDeclarators=True,
namespace=namespace
)
return ':{tag}:`{label} <{ref}>`'.format(
tag=self._sphinx_ref_tag(ref),
label=label if label is not None else '{0}()'.format(Translator.translate_reference(self, ref, namespace=namespace)),
ref=refStr
tag = self._sphinx_ref_tag(ref),
label = label if label is not None else '{0}()'.format(Translator.translate_reference(self, ref, namespace=namespace)),
ref = "static " + refStr if self.domain == 'swift' and ref.relatedObject.type == abstractapi.Method.Type.Class else refStr
)
def translate_keyword(self, keyword):
......
......@@ -314,20 +314,39 @@ class JavaTranslator(Translator):
else:
params = {'recursive': recursive, 'topAncestor': topAncestor}
return name.prev.translate(self, **params) + self.nsSep + translatedName
def translate_argument_name(self, name):
argname = name.to_camel_case(lower=True)
return self._escape_keyword(argname)
def translate_property_name(self, name):
return self.translate_argument_name(name)
def _escape_keyword(self, keyword):
try:
return self.keyWordEscapes[keyword]
except KeyError:
return keyword
class SwiftTranslator(JavaTranslator):
def __init__(self):
JavaTranslator.__init__(self)
self.nsSep = '.'
self.keyWordEscapes = {'protocol' : 'proto'}
def translate_enum_name(self, name, recursive=False, topAncestor=None):
if name.prev is None or not recursive or name.prev is topAncestor:
return name.to_camel_case()
else:
params = {'recursive': recursive, 'topAncestor': topAncestor}
return name.prev.translate(self, **params) + self.nsSep + name.to_camel_case()
def translate_interface_name(self, name, **params):
name = self.translate_class_name(name, **params)
return name[0:len(name)-8] + "Delegate"
def translate_class_name(self, name, recursive=False, topAncestor=None):
return name.to_camel_case()
class CppTranslator(JavaTranslator):
def __init__(self):
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2019 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 Liscense
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
cmake_minimum_required(VERSION 3.8)
set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
enable_language(Swift)
add_custom_command(OUTPUT LinphoneWrapper.swift
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/genwrapper.py" "${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml"
DEPENDS ${PROJECT_SOURCE_DIR}/tools/genapixml.py
${PROJECT_SOURCE_DIR}/tools/metadoc.py
${PROJECT_SOURCE_DIR}/tools/metaname.py
${PROJECT_SOURCE_DIR}/tools/abstractapi.py
${PROJECT_BINARY_DIR}/coreapi/help/doc/doxygen/xml/index.xml
genwrapper.py
wrapper_impl.mustache
linphone-doc
)
add_library(linphonesw SHARED
LinphoneWrapper.swift
)
target_link_libraries(linphonesw
PRIVATE ${BCTOOLBOX_CORE_LIBRARIES} ${BELLESIP_LIBRARIES} linphone
)
set_target_properties(linphonesw PROPERTIES
FRAMEWORK TRUE
LINKER_LANGUAGE SWIFT
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.linphonesw
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/build/osx/Info.plist.in"
)
install(TARGETS linphonesw EXPORT ${EXPORT_TARGETS_NAME}Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
FRAMEWORK DESTINATION Frameworks
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
This diff is collapsed.
This diff is collapsed.
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