From ba33a36607f8864d0ebc008f2d1c1fea3e22cabf Mon Sep 17 00:00:00 2001 From: melpon Date: Mon, 13 May 2024 16:52:29 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=81=AE=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E5=90=8D=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++ buildbase.py | 62 +++++++++++-------- .../macos_arm64/run.py | 38 +++++++----- .../ubuntu-20.04_armv8_jetson/run.py | 42 ++++++++----- .../ubuntu-20.04_x86_64/run.py | 42 ++++++++----- .../ubuntu-22.04_x86_64/run.py | 42 ++++++++----- .../windows_x86_64/run.py | 36 ++++++----- examples/sdl_sample/macos_arm64/run.py | 38 +++++++----- .../ubuntu-20.04_armv8_jetson/run.py | 42 ++++++++----- .../sdl_sample/ubuntu-20.04_x86_64/run.py | 42 ++++++++----- .../sdl_sample/ubuntu-22.04_x86_64/run.py | 42 ++++++++----- examples/sdl_sample/windows_x86_64/run.py | 36 ++++++----- examples/sumomo/macos_arm64/run.py | 38 +++++++----- .../sumomo/ubuntu-20.04_armv8_jetson/run.py | 42 ++++++++----- examples/sumomo/ubuntu-20.04_x86_64/run.py | 42 ++++++++----- examples/sumomo/ubuntu-22.04_x86_64/run.py | 42 ++++++++----- examples/sumomo/windows_x86_64/run.py | 36 ++++++----- run.py | 20 +++--- 18 files changed, 407 insertions(+), 279 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f694dd5b..13ee17db 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ ## develop +- [CHANGE] `--sora-dir`, `--sora-args` を `--local-sora-cpp-sdk-dir` と `--local-sora-cpp-sdk-args` に変更する + - @melpon +- [CHANGE] `--webrtc-build-dir`, `--webrtc-build-args` を `--local-webrtc-build-dir` と `--local-webrtc-build-args` に変更する + - @melpon - [CHANGE] SoraVideoDecoderFactory の初期化に利用する関数を CreateVideoDecoder から Create に変更する - libwebrtc に定義されている継承元クラスが変更されたことに対する追従 - @enm10k diff --git a/buildbase.py b/buildbase.py index 2bf0e9c5..35f1a542 100644 --- a/buildbase.py +++ b/buildbase.py @@ -433,19 +433,19 @@ def install_webrtc(version, source_dir, install_dir, platform: str): extract(archive, output_dir=install_dir, output_dirname="webrtc") -def build_webrtc(platform, webrtc_build_dir, webrtc_build_args, debug): - with cd(webrtc_build_dir): +def build_webrtc(platform, local_webrtc_build_dir, local_webrtc_build_args, debug): + with cd(local_webrtc_build_dir): args = ["--webrtc-nobuild-ios-framework", "--webrtc-nobuild-android-aar"] if debug: args += ["--debug"] - args += webrtc_build_args + args += local_webrtc_build_args cmd(["python3", "run.py", "build", platform, *args]) # インクルードディレクトリを増やしたくないので、 # __config_site を libc++ のディレクトリにコピーしておく - webrtc_source_dir = os.path.join(webrtc_build_dir, "_source", platform, "webrtc") + webrtc_source_dir = os.path.join(local_webrtc_build_dir, "_source", platform, "webrtc") src_config = os.path.join( webrtc_source_dir, "src", "buildtools", "third_party", "libc++", "__config_site" ) @@ -486,11 +486,11 @@ class WebrtcInfo(NamedTuple): def get_webrtc_info( - platform: str, webrtc_build_dir: Optional[str], install_dir: str, debug: bool + platform: str, local_webrtc_build_dir: Optional[str], install_dir: str, debug: bool ) -> WebrtcInfo: webrtc_install_dir = os.path.join(install_dir, "webrtc") - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: return WebrtcInfo( version_file=os.path.join(webrtc_install_dir, "VERSIONS"), deps_file=os.path.join(webrtc_install_dir, "DEPS"), @@ -501,15 +501,17 @@ def get_webrtc_info( libcxx_dir=os.path.join(install_dir, "llvm", "libcxx"), ) else: - webrtc_build_source_dir = os.path.join(webrtc_build_dir, "_source", platform, "webrtc") + webrtc_build_source_dir = os.path.join( + local_webrtc_build_dir, "_source", platform, "webrtc" + ) configuration = "debug" if debug else "release" webrtc_build_build_dir = os.path.join( - webrtc_build_dir, "_build", platform, configuration, "webrtc" + local_webrtc_build_dir, "_build", platform, configuration, "webrtc" ) return WebrtcInfo( - version_file=os.path.join(webrtc_build_dir, "VERSION"), - deps_file=os.path.join(webrtc_build_dir, "DEPS"), + version_file=os.path.join(local_webrtc_build_dir, "VERSION"), + deps_file=os.path.join(local_webrtc_build_dir, "DEPS"), webrtc_include_dir=os.path.join(webrtc_build_source_dir, "src"), webrtc_source_dir=os.path.join(webrtc_build_source_dir, "src"), webrtc_library_dir=webrtc_build_build_dir, @@ -749,15 +751,23 @@ def install_sora_and_deps(platform: str, source_dir: str, install_dir: str): def build_sora( - platform: str, sora_dir: str, sora_args: List[str], debug: bool, webrtc_build_dir: Optional[str] + platform: str, + local_sora_cpp_sdk_dir: str, + local_sora_cpp_sdk_args: List[str], + debug: bool, + local_webrtc_build_dir: Optional[str], ): - if debug and "--debug" not in sora_args: - sora_args = ["--debug", *sora_args] - if webrtc_build_dir is not None: - sora_args = ["--webrtc-build-dir", webrtc_build_dir, *sora_args] + if debug and "--debug" not in local_sora_cpp_sdk_args: + local_sora_cpp_sdk_args = ["--debug", *local_sora_cpp_sdk_args] + if local_webrtc_build_dir is not None: + local_sora_cpp_sdk_args = [ + "--local-webrtc-build-dir", + local_webrtc_build_dir, + *local_sora_cpp_sdk_args, + ] - with cd(sora_dir): - cmd(["python3", "run.py", platform, *sora_args]) + with cd(local_sora_cpp_sdk_dir): + cmd(["python3", "run.py", platform, *local_sora_cpp_sdk_args]) class SoraInfo(NamedTuple): @@ -766,11 +776,11 @@ class SoraInfo(NamedTuple): def get_sora_info( - platform: str, sora_dir: Optional[str], install_dir: str, debug: bool + platform: str, local_sora_cpp_sdk_dir: Optional[str], install_dir: str, debug: bool ) -> SoraInfo: - if sora_dir is not None: + if local_sora_cpp_sdk_dir is not None: configuration = "debug" if debug else "release" - install_dir = os.path.join(sora_dir, "_install", platform, configuration) + install_dir = os.path.join(local_sora_cpp_sdk_dir, "_install", platform, configuration) return SoraInfo( sora_install_dir=os.path.join(install_dir, "sora"), @@ -1497,32 +1507,32 @@ def get_webrtc_platform(platform: Platform) -> str: # `--sora-args '--test'` のようにスペースを使うと、ハイフンから始まるオプションが正しく解釈されない def add_sora_arguments(parser): parser.add_argument( - "--sora-dir", + "--local-sora-cpp-sdk-dir", type=os.path.abspath, default=None, help="Refer to local Sora C++ SDK. " "When this option is specified, Sora C++ SDK will also be built.", ) parser.add_argument( - "--sora-args", + "--local-sora-cpp-sdk-args", type=shlex.split, default=[], - help="Options for building local Sora C++ SDK when `--sora-dir` is specified.", + help="Options for building local Sora C++ SDK when `--local-sora-cpp-sdk-dir` is specified.", ) # add_sora_arguments と同様の注意点があるので注意すること def add_webrtc_build_arguments(parser): parser.add_argument( - "--webrtc-build-dir", + "--local-webrtc-build-dir", type=os.path.abspath, default=None, help="Refer to local webrtc-build. " "When this option is specified, webrtc-build will also be built.", ) parser.add_argument( - "--webrtc-build-args", + "--local-webrtc-build-args", type=shlex.split, default=[], - help="Options for building local webrtc-build when `--webrtc-build-dir` is specified.", + help="Options for building local webrtc-build when `--local-webrtc-build-dir` is specified.", ) diff --git a/examples/messaging_recvonly_sample/macos_arm64/run.py b/examples/messaging_recvonly_sample/macos_arm64/run.py index dd152c5d..334c086f 100644 --- a/examples/messaging_recvonly_sample/macos_arm64/run.py +++ b/examples/messaging_recvonly_sample/macos_arm64/run.py @@ -36,16 +36,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -57,17 +57,23 @@ def install_deps( else: build_webrtc_args = { "platform": "macos_arm64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("macos_arm64", source_dir, install_dir) else: - build_sora("macos_arm64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "macos_arm64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -112,10 +118,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -123,8 +129,10 @@ def main(): sample_build_dir = os.path.join(build_dir, "messaging_recvonly_sample") mkdir_p(sample_build_dir) with cd(sample_build_dir): - webrtc_info = get_webrtc_info("macos_arm64", args.webrtc_build_dir, install_dir, args.debug) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + webrtc_info = get_webrtc_info( + "macos_arm64", args.local_webrtc_build_dir, install_dir, args.debug + ) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/messaging_recvonly_sample/ubuntu-20.04_armv8_jetson/run.py b/examples/messaging_recvonly_sample/ubuntu-20.04_armv8_jetson/run.py index c24df6d5..6a2fdb2b 100644 --- a/examples/messaging_recvonly_sample/ubuntu-20.04_armv8_jetson/run.py +++ b/examples/messaging_recvonly_sample/ubuntu-20.04_armv8_jetson/run.py @@ -38,10 +38,10 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") @@ -59,7 +59,7 @@ def install_deps( install_rootfs(**install_rootfs_args) # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -71,15 +71,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_armv8", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_armv8", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_armv8", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -105,10 +107,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_armv8_jetson", source_dir, install_dir) else: - build_sora("ubuntu-20.04_armv8_jetson", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_armv8_jetson", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -153,10 +161,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -165,9 +173,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_armv8", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_armv8", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/messaging_recvonly_sample/ubuntu-20.04_x86_64/run.py b/examples/messaging_recvonly_sample/ubuntu-20.04_x86_64/run.py index bb880a03..7d8d248a 100644 --- a/examples/messaging_recvonly_sample/ubuntu-20.04_x86_64/run.py +++ b/examples/messaging_recvonly_sample/ubuntu-20.04_x86_64/run.py @@ -36,16 +36,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -57,15 +57,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -90,10 +92,16 @@ def install_deps( } install_llvm(**install_llvm_args) - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-20.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -138,10 +146,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -150,9 +158,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/messaging_recvonly_sample/ubuntu-22.04_x86_64/run.py b/examples/messaging_recvonly_sample/ubuntu-22.04_x86_64/run.py index 8b2b5776..48c7134d 100644 --- a/examples/messaging_recvonly_sample/ubuntu-22.04_x86_64/run.py +++ b/examples/messaging_recvonly_sample/ubuntu-22.04_x86_64/run.py @@ -36,16 +36,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -57,15 +57,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-22.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-22.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-22.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -91,10 +93,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-22.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-22.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-22.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -139,10 +147,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -151,9 +159,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-22.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-22.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/messaging_recvonly_sample/windows_x86_64/run.py b/examples/messaging_recvonly_sample/windows_x86_64/run.py index b44b3cc4..41608d36 100644 --- a/examples/messaging_recvonly_sample/windows_x86_64/run.py +++ b/examples/messaging_recvonly_sample/windows_x86_64/run.py @@ -35,16 +35,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -56,17 +56,23 @@ def install_deps( else: build_webrtc_args = { "platform": "windows_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("windows_x86_64", source_dir, install_dir) else: - build_sora("windows_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "windows_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -112,10 +118,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -124,9 +130,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "windows_x86_64", args.webrtc_build_dir, install_dir, args.debug + "windows_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sdl_sample/macos_arm64/run.py b/examples/sdl_sample/macos_arm64/run.py index 509db920..54ff806b 100644 --- a/examples/sdl_sample/macos_arm64/run.py +++ b/examples/sdl_sample/macos_arm64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,8 +58,8 @@ def install_deps( else: build_webrtc_args = { "platform": "macos_arm64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) @@ -67,10 +67,16 @@ def install_deps( sysroot = cmdcap(["xcrun", "--sdk", "macosx", "--show-sdk-path"]) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("macos_arm64", source_dir, install_dir) else: - build_sora("macos_arm64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "macos_arm64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -136,10 +142,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -147,8 +153,10 @@ def main(): sample_build_dir = os.path.join(build_dir, "sdl_sample") mkdir_p(sample_build_dir) with cd(sample_build_dir): - webrtc_info = get_webrtc_info("macos_arm64", args.webrtc_build_dir, install_dir, args.debug) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + webrtc_info = get_webrtc_info( + "macos_arm64", args.local_webrtc_build_dir, install_dir, args.debug + ) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sdl_sample/ubuntu-20.04_armv8_jetson/run.py b/examples/sdl_sample/ubuntu-20.04_armv8_jetson/run.py index f61e4c27..b4642b84 100644 --- a/examples/sdl_sample/ubuntu-20.04_armv8_jetson/run.py +++ b/examples/sdl_sample/ubuntu-20.04_armv8_jetson/run.py @@ -39,10 +39,10 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") @@ -61,7 +61,7 @@ def install_deps( sysroot = os.path.join(install_dir, "rootfs") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -73,15 +73,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_armv8", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_armv8", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_armv8", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -107,10 +109,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_armv8_jetson", source_dir, install_dir) else: - build_sora("ubuntu-20.04_armv8_jetson", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_armv8_jetson", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -181,10 +189,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -193,9 +201,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_armv8", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_armv8", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sdl_sample/ubuntu-20.04_x86_64/run.py b/examples/sdl_sample/ubuntu-20.04_x86_64/run.py index 38314283..cea8092f 100644 --- a/examples/sdl_sample/ubuntu-20.04_x86_64/run.py +++ b/examples/sdl_sample/ubuntu-20.04_x86_64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,15 +58,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -92,10 +94,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-20.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -156,10 +164,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -168,9 +176,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sdl_sample/ubuntu-22.04_x86_64/run.py b/examples/sdl_sample/ubuntu-22.04_x86_64/run.py index de00f06b..5217a82a 100644 --- a/examples/sdl_sample/ubuntu-22.04_x86_64/run.py +++ b/examples/sdl_sample/ubuntu-22.04_x86_64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,15 +58,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-22.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-22.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-22.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -92,10 +94,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-22.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-22.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-22.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -156,10 +164,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -168,9 +176,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-22.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-22.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sdl_sample/windows_x86_64/run.py b/examples/sdl_sample/windows_x86_64/run.py index 359940a7..4a7ea8b3 100644 --- a/examples/sdl_sample/windows_x86_64/run.py +++ b/examples/sdl_sample/windows_x86_64/run.py @@ -36,16 +36,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -57,17 +57,23 @@ def install_deps( else: build_webrtc_args = { "platform": "windows_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("windows_x86_64", source_dir, install_dir) else: - build_sora("windows_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "windows_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -126,10 +132,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -138,9 +144,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "windows_x86_64", args.webrtc_build_dir, install_dir, args.debug + "windows_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sumomo/macos_arm64/run.py b/examples/sumomo/macos_arm64/run.py index d6077daa..a21b161c 100644 --- a/examples/sumomo/macos_arm64/run.py +++ b/examples/sumomo/macos_arm64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,8 +58,8 @@ def install_deps( else: build_webrtc_args = { "platform": "macos_arm64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) @@ -67,10 +67,16 @@ def install_deps( sysroot = cmdcap(["xcrun", "--sdk", "macosx", "--show-sdk-path"]) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("macos_arm64", source_dir, install_dir) else: - build_sora("macos_arm64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "macos_arm64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -136,10 +142,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -147,8 +153,10 @@ def main(): sample_build_dir = os.path.join(build_dir, "sumomo") mkdir_p(sample_build_dir) with cd(sample_build_dir): - webrtc_info = get_webrtc_info("macos_arm64", args.webrtc_build_dir, install_dir, args.debug) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + webrtc_info = get_webrtc_info( + "macos_arm64", args.local_webrtc_build_dir, install_dir, args.debug + ) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sumomo/ubuntu-20.04_armv8_jetson/run.py b/examples/sumomo/ubuntu-20.04_armv8_jetson/run.py index b516b0c4..be3b5fdb 100644 --- a/examples/sumomo/ubuntu-20.04_armv8_jetson/run.py +++ b/examples/sumomo/ubuntu-20.04_armv8_jetson/run.py @@ -39,10 +39,10 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") @@ -61,7 +61,7 @@ def install_deps( sysroot = os.path.join(install_dir, "rootfs") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -73,15 +73,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_armv8", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_armv8", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_armv8", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -107,10 +109,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_armv8_jetson", source_dir, install_dir) else: - build_sora("ubuntu-20.04_armv8_jetson", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_armv8_jetson", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -181,10 +189,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -193,9 +201,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_armv8", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_armv8", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sumomo/ubuntu-20.04_x86_64/run.py b/examples/sumomo/ubuntu-20.04_x86_64/run.py index 100ddb5b..5584d416 100644 --- a/examples/sumomo/ubuntu-20.04_x86_64/run.py +++ b/examples/sumomo/ubuntu-20.04_x86_64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,15 +58,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-20.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-20.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-20.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -92,10 +94,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-20.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-20.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-20.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -156,10 +164,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -168,9 +176,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-20.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-20.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sumomo/ubuntu-22.04_x86_64/run.py b/examples/sumomo/ubuntu-22.04_x86_64/run.py index ad19c2da..814e313b 100644 --- a/examples/sumomo/ubuntu-22.04_x86_64/run.py +++ b/examples/sumomo/ubuntu-22.04_x86_64/run.py @@ -37,16 +37,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -58,15 +58,17 @@ def install_deps( else: build_webrtc_args = { "platform": "ubuntu-22.04_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info("ubuntu-22.04_x86_64", webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info( + "ubuntu-22.04_x86_64", local_webrtc_build_dir, install_dir, debug + ) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: webrtc_version = read_version_file(webrtc_info.version_file) # LLVM @@ -92,10 +94,16 @@ def install_deps( install_llvm(**install_llvm_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("ubuntu-22.04_x86_64", source_dir, install_dir) else: - build_sora("ubuntu-22.04_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "ubuntu-22.04_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -156,10 +164,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Debug" if args.debug else "Release" @@ -168,9 +176,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "ubuntu-22.04_x86_64", args.webrtc_build_dir, install_dir, args.debug + "ubuntu-22.04_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/examples/sumomo/windows_x86_64/run.py b/examples/sumomo/windows_x86_64/run.py index 8c351c2f..9ca037ea 100644 --- a/examples/sumomo/windows_x86_64/run.py +++ b/examples/sumomo/windows_x86_64/run.py @@ -36,16 +36,16 @@ def install_deps( build_dir, install_dir, debug, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], - sora_dir: Optional[str], - sora_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], + local_sora_cpp_sdk_dir: Optional[str], + local_sora_cpp_sdk_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") # WebRTC - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -57,17 +57,23 @@ def install_deps( else: build_webrtc_args = { "platform": "windows_x86_64", - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) # Sora C++ SDK, Boost - if sora_dir is None: + if local_sora_cpp_sdk_dir is None: install_sora_and_deps("windows_x86_64", source_dir, install_dir) else: - build_sora("windows_x86_64", sora_dir, sora_args, debug, webrtc_build_dir) + build_sora( + "windows_x86_64", + local_sora_cpp_sdk_dir, + local_sora_cpp_sdk_args, + debug, + local_webrtc_build_dir, + ) # CMake install_cmake_args = { @@ -126,10 +132,10 @@ def main(): build_dir, install_dir, args.debug, - args.webrtc_build_dir, - args.webrtc_build_args, - args.sora_dir, - args.sora_args, + args.local_webrtc_build_dir, + args.local_webrtc_build_args, + args.local_sora_cpp_sdk_dir, + args.local_sora_cpp_sdk_args, ) configuration = "Release" @@ -142,9 +148,9 @@ def main(): mkdir_p(sample_build_dir) with cd(sample_build_dir): webrtc_info = get_webrtc_info( - "windows_x86_64", args.webrtc_build_dir, install_dir, args.debug + "windows_x86_64", args.local_webrtc_build_dir, install_dir, args.debug ) - sora_info = get_sora_info(platform, args.sora_dir, install_dir, args.debug) + sora_info = get_sora_info(platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug) cmake_args = [] cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}") diff --git a/run.py b/run.py index 8f33147d..c5be4388 100644 --- a/run.py +++ b/run.py @@ -146,8 +146,8 @@ def install_deps( build_dir: str, install_dir: str, debug: bool, - webrtc_build_dir: Optional[str], - webrtc_build_args: List[str], + local_webrtc_build_dir: Optional[str], + local_webrtc_build_args: List[str], ): with cd(BASE_DIR): version = read_version_file("VERSION") @@ -198,7 +198,7 @@ def install_deps( # WebRTC webrtc_platform = get_webrtc_platform(platform) - if webrtc_build_dir is None: + if local_webrtc_build_dir is None: install_webrtc_args = { "version": version["WEBRTC_BUILD_VERSION"], "version_file": os.path.join(install_dir, "webrtc.version"), @@ -211,20 +211,20 @@ def install_deps( else: build_webrtc_args = { "platform": webrtc_platform, - "webrtc_build_dir": webrtc_build_dir, - "webrtc_build_args": webrtc_build_args, + "local_webrtc_build_dir": local_webrtc_build_dir, + "local_webrtc_build_args": local_webrtc_build_args, "debug": debug, } build_webrtc(**build_webrtc_args) - webrtc_info = get_webrtc_info(webrtc_platform, webrtc_build_dir, install_dir, debug) + webrtc_info = get_webrtc_info(webrtc_platform, local_webrtc_build_dir, install_dir, debug) webrtc_version = read_version_file(webrtc_info.version_file) webrtc_deps = read_version_file(webrtc_info.deps_file) # Windows は MSVC を使うので不要 # macOS と iOS は Apple Clang を使うので不要 - if platform.target.os not in ("windows", "macos", "ios") and webrtc_build_dir is None: + if platform.target.os not in ("windows", "macos", "ios") and local_webrtc_build_dir is None: # LLVM tools_url = webrtc_version["WEBRTC_SRC_TOOLS_URL"] tools_commit = webrtc_version["WEBRTC_SRC_TOOLS_COMMIT"] @@ -586,8 +586,8 @@ def main(): build_dir, install_dir, args.debug, - webrtc_build_dir=args.webrtc_build_dir, - webrtc_build_args=args.webrtc_build_args, + local_webrtc_build_dir=args.local_webrtc_build_dir, + local_webrtc_build_args=args.local_webrtc_build_args, ) configuration = "Release" @@ -605,7 +605,7 @@ def main(): cmake_args.append(f"-DBOOST_ROOT={cmake_path(os.path.join(install_dir, 'boost'))}") webrtc_platform = get_webrtc_platform(platform) webrtc_info = get_webrtc_info( - webrtc_platform, args.webrtc_build_dir, install_dir, args.debug + webrtc_platform, args.local_webrtc_build_dir, install_dir, args.debug ) webrtc_version = read_version_file(webrtc_info.version_file) webrtc_deps = read_version_file(webrtc_info.deps_file)