gyp.mozbuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. gyp_vars = {
  6. 'lsan': 0,
  7. 'asan': 0,
  8. 'build_with_mozilla': 1,
  9. 'build_with_chromium': 0,
  10. 'use_official_google_api_keys': 0,
  11. 'have_clock_monotonic': 1 if CONFIG['HAVE_CLOCK_MONOTONIC'] else 0,
  12. 'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
  13. 'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0,
  14. 'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0,
  15. # basic stuff for everything
  16. 'include_internal_video_render': 0,
  17. 'clang_use_chrome_plugins': 0,
  18. 'enable_protobuf': 0,
  19. 'include_tests': 0,
  20. 'enable_android_opensl': 1,
  21. 'enable_android_opensl_output': 0,
  22. # use_system_lib* still seems to be in use in trunk/build
  23. 'use_system_libjpeg': 0,
  24. 'use_system_libvpx': 0,
  25. 'build_json': 0,
  26. 'build_libjpeg': 0,
  27. 'build_libyuv': 0,
  28. 'build_libvpx': 0,
  29. 'build_ssl': 0,
  30. 'build_json': 0,
  31. 'build_icu': 0,
  32. 'build_opus': 0,
  33. 'libyuv_dir': '/media/libyuv',
  34. 'yuv_disable_avx2': 0 if CONFIG['HAVE_X86_AVX2'] else 1,
  35. # don't use openssl
  36. 'use_openssl': 0,
  37. 'use_x11': 1 if CONFIG['MOZ_X11'] else 0,
  38. 'use_glib': 1 if CONFIG['GLIB_LIBS'] else 0,
  39. # turn off mandatory use of NEON and instead use NEON detection
  40. 'arm_neon': 0,
  41. 'arm_neon_optional': 1,
  42. 'moz_webrtc_omx': 0,
  43. 'moz_webrtc_mediacodec': 0,
  44. # Turn off multi monitor screen share
  45. 'multi_monitor_screenshare%' : 0,
  46. # (for vp8) chromium sets to 0 also
  47. 'use_temporal_layers': 0,
  48. # Creates AEC internal sample dump files in current directory
  49. 'aec_debug_dump': 1,
  50. # Enable and force use of hardware AEC
  51. 'hardware_aec_ns': 1 if CONFIG['MOZ_WEBRTC_HARDWARE_AEC_NS'] else 0,
  52. # codec enable/disables:
  53. 'include_g711': 1,
  54. 'include_opus': 1,
  55. 'include_g722': 1,
  56. 'include_ilbc': 0,
  57. # We turn on ISAC because the AGC uses parts of it, and depend on the
  58. # linker to throw away uneeded bits.
  59. 'include_isac': 1,
  60. 'include_pcm16b': 1,
  61. }
  62. os = CONFIG['OS_TARGET']
  63. if os == 'WINNT':
  64. gyp_vars.update(
  65. MSVS_VERSION=CONFIG['_MSVS_VERSION'],
  66. MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
  67. )
  68. elif os == 'Android':
  69. gyp_vars.update(
  70. gtest_target_type='executable',
  71. moz_webrtc_mediacodec=1,
  72. android_toolchain=CONFIG.get('ANDROID_TOOLCHAIN', ''),
  73. )
  74. flavors = {
  75. 'WINNT': 'win',
  76. 'Android': 'android',
  77. 'Linux': 'linux',
  78. 'SunOS': 'solaris',
  79. 'GNU/kFreeBSD': 'freebsd',
  80. 'DragonFly': 'dragonfly',
  81. 'FreeBSD': 'freebsd',
  82. 'NetBSD': 'netbsd',
  83. 'OpenBSD': 'openbsd',
  84. }
  85. gyp_vars['OS'] = flavors.get(os)
  86. arches = {
  87. 'x86_64': 'x64',
  88. 'x86': 'ia32',
  89. 'aarch64': 'arm64',
  90. }
  91. gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
  92. if CONFIG['ARM_ARCH']:
  93. if int(CONFIG['ARM_ARCH']) < 7:
  94. gyp_vars['armv7'] = 0
  95. gyp_vars['arm_neon_optional'] = 0
  96. elif os == 'Android':
  97. gyp_vars['armv7'] = 1
  98. else:
  99. # CPU detection for ARM works on Android only. armv7 always uses CPU
  100. # detection, so we have to set armv7=0 for non-Android target
  101. gyp_vars['armv7'] = 0
  102. # For libyuv
  103. gyp_vars['arm_version'] = int(CONFIG['ARM_ARCH'])
  104. # Don't try to compile ssse3/sse4.1 code if toolchain doesn't support
  105. if CONFIG['INTEL_ARCHITECTURE']:
  106. if not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] or not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']:
  107. gyp_vars['yuv_disable_asm'] = 1
  108. if CONFIG['MACOS_SDK_DIR']:
  109. gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR']