Skip to content

Commit

Permalink
sora にも _LIBCPP_HARDENING_MODE を指定する
Browse files Browse the repository at this point in the history
  • Loading branch information
enm10k committed Jan 16, 2024
1 parent 56f8485 commit 03a23f5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,8 @@ def main():
cmake_args.append("-DUSE_LIBCXX=ON")
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 = 'x86_64-apple-darwin' if platform.target.arch == 'x86_64' else 'aarch64-apple-darwin'
Expand Down Expand Up @@ -1685,6 +1687,8 @@ def main():
cmake_args.append('-DCMAKE_ANDROID_EXCEPTIONS=ON')
cmake_args.append('-DANDROID_NDK=OFF')
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')
Expand All @@ -1701,6 +1705,8 @@ def main():
cmake_args.append(
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':
Expand Down Expand Up @@ -1762,6 +1768,7 @@ def main():
elif platform.target.os == 'android':
# Android の場合は事前に用意したプロジェクトをビルドする
with cd(os.path.join(BASE_DIR, 'test', 'android')):
# TODO(enm10k): ここも _LIBCPP_HARDENING_MODE の指定が必要かもしれない
cmd(['./gradlew', '--no-daemon', 'assemble'])

if not args.no_lyra:
Expand Down Expand Up @@ -1809,6 +1816,8 @@ def main():
cmake_args.append("-DUSE_LIBCXX=ON")
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')
Expand All @@ -1829,6 +1838,8 @@ def main():
f"-DCMAKE_C_COMPILER={cmake_path(os.path.join(webrtc_info.clang_dir, 'bin', 'clang'))}")
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")
Expand Down

0 comments on commit 03a23f5

Please sign in to comment.