From ddcbb83acdf202bb3200a0bac5f85a7c2aef12b7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 16 Oct 2015 16:38:43 +0200 Subject: [PATCH] Add option to prepare.py that enables building the Python module. --- prepare.py | 23 ++++++++++++++++++++++- submodules/cmake-builder | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/prepare.py b/prepare.py index 17d8e1579..7f3a61391 100755 --- a/prepare.py +++ b/prepare.py @@ -51,6 +51,21 @@ class DesktopTarget(prepare.Target): current_path + '/submodules' ] +class PythonTarget(prepare.Target): + + def __init__(self): + prepare.Target.__init__(self, '') + current_path = os.path.dirname(os.path.realpath(__file__)) + if platform.system() == 'Windows': + current_path = current_path.replace('\\', '/') + self.config_file = 'configs/config-python.cmake' + if platform.system() == 'Windows': + self.generator = 'Visual Studio 9 2008' + self.additional_args = [ + '-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + + current_path + '/submodules' + ] + def check_is_installed(binary, prog=None, warn=True): if not find_executable(binary): @@ -133,6 +148,8 @@ def main(argv=None): '-m', '--minimal', help="Build a minimal version of Linphone.", action='store_true') argparser.add_argument( '-os', '--only-submodules', help="Build only submodules (finding all dependencies on the system.", action='store_true') + argparser.add_argument( + '--python', help="Build Python module instead of desktop application.", action='store_true') argparser.add_argument( '-t', '--tunnel', help="Enable Tunnel.", action='store_true') @@ -190,7 +207,11 @@ def main(argv=None): # install_git_hook() - target = DesktopTarget() + target = None + if args.python: + target = PythonTarget() + else: + target = DesktopTarget() if args.clean: target.clean() if os.path.isfile('Makefile'): diff --git a/submodules/cmake-builder b/submodules/cmake-builder index d296e7f48..a885fa9ba 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit d296e7f4856e64292b455ced96a175f2e99f7b24 +Subproject commit a885fa9bac938794dff4102d9ba913d1aa69c994