From 28ac39679a7305c70d4d1353f041199a5a5c6c2f Mon Sep 17 00:00:00 2001 From: miosakuma Date: Thu, 7 Mar 2024 15:11:16 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 238aa9d9..a81459a2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,8 @@ - [ADD] Android 向けに音声出力先変更機能として `SoraAudioManager` を追加する - Android では C++ を経由した OS の API 利用が煩雑となるため、Java で実装し、Sora.aar をビルドして提供を行う - Sora.aar ファイルは Android のパッケージに含める + - iOS 向けとは異なりインスタンス生成が必要 + - API レベル 31 でオーディオデバイスの切り替えや Bluetooth ヘッドセットのスイッチングの API が変更となり、API レベルに応じて処理を切り替える必要があったため - @tnoho ## 2024.2.0 (2024-03-04) From e56c8ee37e46b9b144c9961f4e726ec3f57d987e Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 7 Mar 2024 17:26:03 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=5FLIBCPP=5FHARDENING=5FMODE=20=E3=82=92?= =?UTF-8?q?=E4=BC=9D=E6=90=AC=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 5 +++++ CMakeLists.txt | 2 ++ run.py | 32 ++++++++++++++++---------------- test/android/app/build.gradle | 3 +-- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a81459a2..e4399c74 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,11 @@ ## develop +## 2024.3.1 (2024-03-07) + +- [FIX] Sora C++ SDK を利用してビルドする時に自動的に _LIBCPP_HARDENING_MODE が定義されるように修正 + - @melpon + ## 2024.3.0 (2024-03-07) - [CHANGE] Lyra を Sora C++ SDK から外し、Lyra に関連するファイルや関数、オプションを除ける diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a69c174..27c48691 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -397,6 +397,7 @@ elseif (SORA_TARGET_OS STREQUAL "android") _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS _LIBCPP_ENABLE_NODISCARD + _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE # https://github.com/boostorg/container_hash/issues/22 と同じ問題が clang-15 でも起きるので、これを手動で定義して回避する BOOST_NO_CXX98_FUNCTION_BASE ) @@ -411,6 +412,7 @@ elseif (SORA_TARGET_OS STREQUAL "ubuntu") _LIBCPP_ABI_NAMESPACE=Cr _LIBCPP_ABI_VERSION=2 _LIBCPP_DISABLE_AVAILABILITY + _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE # https://github.com/boostorg/container_hash/issues/22 と同じ問題が clang-15 でも起きるので、これを手動で定義して回避する BOOST_NO_CXX98_FUNCTION_BASE ) diff --git a/run.py b/run.py index 91f94d39..b820b225 100644 --- a/run.py +++ b/run.py @@ -1659,8 +1659,6 @@ def main(): cmake_args.append( f"-DLIBCXX_INCLUDE_DIR={cmake_path(os.path.join(webrtc_info.libcxx_dir, 'include'))}" ) - cxxflags = ["-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE"] - cmake_args.append(f"-DCMAKE_CXX_FLAGS={' '.join(cxxflags)}") if platform.target.os == "macos": sysroot = cmdcap(["xcrun", "--sdk", "macosx", "--show-sdk-path"]) target = ( @@ -1706,8 +1704,6 @@ def main(): cmake_args.append( f"-DSORA_WEBRTC_LDFLAGS={os.path.join(install_dir, 'webrtc.ldflags')}" ) - cxxflags = ["-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE"] - cmake_args.append(f"-DCMAKE_CXX_FLAGS={' '.join(cxxflags)}") if platform.target.os == "jetson": sysroot = os.path.join(install_dir, "rootfs") cmake_args.append("-DCMAKE_SYSTEM_NAME=Linux") @@ -1727,8 +1723,6 @@ def main(): f"-DCMAKE_CXX_COMPILER={cmake_path(os.path.join(webrtc_info.clang_dir, 'bin', 'clang++'))}" ) cmake_args.append("-DUSE_JETSON_ENCODER=ON") - cxxflags = ["-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE"] - cmake_args.append(f"-DCMAKE_CXX_FLAGS={' '.join(cxxflags)}") # NvCodec if platform.target.os in ("windows", "ubuntu") and platform.target.arch == "x86_64": @@ -1792,13 +1786,23 @@ def main(): os.path.join(install_dir, "sora", "lib", "libsora.a"), ) - if platform.target.os == 'android': + if platform.target.os == "android": # Android の場合のみライブラリをビルドする - with cd(os.path.join(BASE_DIR, 'android', 'Sora')): - cmd(['./gradlew', '--no-daemon', 'assembleRelease']) - shutil.copyfile(os.path.join(BASE_DIR, 'android', 'Sora', 'Sora', - 'build', 'outputs', 'aar', 'Sora-release.aar'), - os.path.join(install_dir, 'sora', 'lib', 'Sora.aar')) + with cd(os.path.join(BASE_DIR, "android", "Sora")): + cmd(["./gradlew", "--no-daemon", "assembleRelease"]) + shutil.copyfile( + os.path.join( + BASE_DIR, + "android", + "Sora", + "Sora", + "build", + "outputs", + "aar", + "Sora-release.aar", + ), + os.path.join(install_dir, "sora", "lib", "Sora.aar"), + ) if args.test: if platform.target.os == "ios": @@ -1874,8 +1878,6 @@ def main(): cmake_args.append( f"-DLIBCXX_INCLUDE_DIR={cmake_path(os.path.join(webrtc_info.libcxx_dir, 'include'))}" ) - cxxflags = ["-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE"] - cmake_args.append(f"-DCMAKE_CXX_FLAGS={' '.join(cxxflags)}") if platform.target.os == "jetson": sysroot = os.path.join(install_dir, "rootfs") cmake_args.append("-DJETSON=ON") @@ -1899,8 +1901,6 @@ def main(): cmake_args.append( f"-DCMAKE_CXX_COMPILER={cmake_path(os.path.join(webrtc_info.clang_dir, 'bin', 'clang++'))}" ) - cxxflags = ["-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE"] - cmake_args.append(f"-DCMAKE_CXX_FLAGS={' '.join(cxxflags)}") if platform.target.os in ("windows", "macos", "ubuntu"): cmake_args.append("-DTEST_CONNECT_DISCONNECT=ON") diff --git a/test/android/app/build.gradle b/test/android/app/build.gradle index e1779e4e..55913fcf 100644 --- a/test/android/app/build.gradle +++ b/test/android/app/build.gradle @@ -42,8 +42,7 @@ android { "-DANDROID_ABI=arm64-v8a", "-DANDROID_CPP_FEATURES=exceptions rtti", "-DANDROID_NDK=$projectDir/../../../_install/android/release/android-ndk", - "-DCMAKE_ANDROID_EXCEPTIONS=ON", - "-DCMAKE_CXX_FLAGS='-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE'" + "-DCMAKE_ANDROID_EXCEPTIONS=ON" } ndk { abiFilters 'arm64-v8a' From d3b5f4b743bb85f686261131a1e8cc3fe238dd77 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 7 Mar 2024 17:33:23 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Jetson=20=E3=81=AE=E3=81=A8=E3=81=93?= =?UTF-8?q?=E3=82=8D=E3=81=AB=E3=82=82=E5=BF=85=E8=A6=81=E3=81=A0=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27c48691..881853fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -500,6 +500,7 @@ elseif (SORA_TARGET_OS STREQUAL "jetson") _LIBCPP_ABI_NAMESPACE=Cr _LIBCPP_ABI_VERSION=2 _LIBCPP_DISABLE_AVAILABILITY + _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE # https://github.com/boostorg/container_hash/issues/22 と同じ問題が clang-15 でも起きるので、これを手動で定義して回避する BOOST_NO_CXX98_FUNCTION_BASE ) From 9dbfdd819196b7887ce765bbb9c03bd6a8ea0181 Mon Sep 17 00:00:00 2001 From: melpon Date: Thu, 7 Mar 2024 17:41:50 +0900 Subject: [PATCH 4/4] =?UTF-8?q?2024.3.1=20=E3=83=AA=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 07242faf..25516da3 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -SORA_CPP_SDK_VERSION=2024.3.0 +SORA_CPP_SDK_VERSION=2024.3.1 WEBRTC_BUILD_VERSION=m121.6167.3.0 BOOST_VERSION=1.84.0 CMAKE_VERSION=3.28.1