This is a reland of https://codereview.webrtc.org/1847013002/ with the following changes: * _USE_32BIT_TIME_T is no longer set: it was removed from Chromium in https://codereview.chromium.org/1862443003/. Setting it in target_defaults was likely the reason to remoting_unittests failing in the previous attempt to land this. * Added define for FreeBSD platform. * Added corresponding GN changes. Copy the defines from the target_defaults section of Chromium's src/third_party/libjingle.gyp into our webrtc/build/common.gypi in order to ensure the same defines are used for the Chromium build when removing the source listings in src/third_party/libjingle.gyp. With this CL landed, it should be possible to replace them with dependencies on: * webrtc/api/api.gyp:libjingle_peerconnections * webrtc/media/media.gyp:rtc_media * webrtc/pc/pc.gyp:rtc_pc * webrtc/pp2/p2p.gyp:rtc_p2p * webrtc/libjingle/xmpp/xmpp.gyp:rtc_xmpp Not ported (Windows specific): * Precompiled headers (build/win_precompile.gypi): since it only seems to offer a compile speedup. Will be landed for all of WebRTC in separate CL. BUG=webrtc:4256 NOTRY=True Review-Url: https://codereview.webrtc.org/1924663003 Cr-Commit-Position: refs/heads/master@{#12959}
369 lines
9.0 KiB
Plaintext
369 lines
9.0 KiB
Plaintext
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file in the root of the source
|
|
# tree. An additional intellectual property rights grant can be found
|
|
# in the file PATENTS. All contributing project authors may
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
# TODO(kjellander): Rebase this to webrtc/build/common.gypi changes after r6330.
|
|
|
|
import("//build/config/linux/pkg_config.gni")
|
|
import("//build/config/sanitizers/sanitizers.gni")
|
|
import("build/webrtc.gni")
|
|
import("//third_party/protobuf/proto_library.gni")
|
|
|
|
# Contains the defines and includes in common.gypi that are duplicated both as
|
|
# target_defaults and direct_dependent_settings.
|
|
config("common_inherited_config") {
|
|
defines = []
|
|
if (build_with_mozilla) {
|
|
defines += [ "WEBRTC_MOZILLA_BUILD" ]
|
|
}
|
|
if (build_with_chromium) {
|
|
defines = [
|
|
# TODO(kjellander): Cleanup unused ones and move defines closer to
|
|
# the source when webrtc:4256 is completed.
|
|
"FEATURE_ENABLE_SSL",
|
|
"FEATURE_ENABLE_VOICEMAIL",
|
|
"EXPAT_RELATIVE_PATH",
|
|
"GTEST_RELATIVE_PATH",
|
|
"NO_MAIN_THREAD_WRAPPING",
|
|
"NO_SOUND_SYSTEM",
|
|
"WEBRTC_CHROMIUM_BUILD",
|
|
]
|
|
include_dirs = [
|
|
# The overrides must be included first as that is the mechanism for
|
|
# selecting the override headers in Chromium.
|
|
"../webrtc_overrides",
|
|
|
|
# Allow includes to be prefixed with webrtc/ in case it is not an
|
|
# immediate subdirectory of the top-level.
|
|
"..",
|
|
]
|
|
}
|
|
if (is_posix) {
|
|
defines += [ "WEBRTC_POSIX" ]
|
|
}
|
|
if (is_ios) {
|
|
defines += [
|
|
"WEBRTC_MAC",
|
|
"WEBRTC_IOS",
|
|
]
|
|
}
|
|
if (is_ios && rtc_use_objc_h264) {
|
|
defines += [ "WEBRTC_OBJC_H264" ]
|
|
}
|
|
if (is_linux) {
|
|
defines += [ "WEBRTC_LINUX" ]
|
|
}
|
|
if (is_mac) {
|
|
defines += [ "WEBRTC_MAC" ]
|
|
}
|
|
if (is_win) {
|
|
defines += [
|
|
"WEBRTC_WIN",
|
|
"_CRT_SECURE_NO_WARNINGS", # Suppress warnings about _vsnprinf
|
|
]
|
|
}
|
|
if (is_android) {
|
|
defines += [
|
|
"WEBRTC_LINUX",
|
|
"WEBRTC_ANDROID",
|
|
]
|
|
}
|
|
if (is_chromeos) {
|
|
defines += [ "CHROMEOS" ]
|
|
}
|
|
|
|
# TODO(GYP): Support these in GN.
|
|
# if (is_bsd) {
|
|
# defines += [ "BSD" ]
|
|
# }
|
|
# if (is_openbsd) {
|
|
# defines += [ "OPENBSD" ]
|
|
# }
|
|
# if (is_freebsd) {
|
|
# defines += [ "FREEBSD" ]
|
|
# }
|
|
}
|
|
|
|
if (rtc_have_dbus_glib) {
|
|
pkg_config("dbus-glib") {
|
|
packages = [ "dbus-glib-1" ]
|
|
}
|
|
}
|
|
|
|
config("common_config") {
|
|
cflags = []
|
|
cflags_cc = []
|
|
defines = []
|
|
|
|
if (rtc_restrict_logging) {
|
|
defines += [ "WEBRTC_RESTRICT_LOGGING" ]
|
|
}
|
|
|
|
if (rtc_have_dbus_glib) {
|
|
defines += [ "HAVE_DBUS_GLIB" ]
|
|
|
|
# TODO(kjellander): Investigate this, it seems like include <dbus/dbus.h>
|
|
# is still not found even if the execution of
|
|
# build/config/linux/pkg-config.py dbus-glib-1 returns correct include
|
|
# dirs on Linux.
|
|
all_dependent_configs = [ "dbus-glib" ]
|
|
}
|
|
|
|
if (build_with_chromium) {
|
|
defines += [
|
|
# NOTICE: Since common_inherited_config is used in public_configs for our
|
|
# targets, there's no point including the defines in that config here.
|
|
# TODO(kjellander): Cleanup unused ones and move defines closer to the
|
|
# source when webrtc:4256 is completed.
|
|
"ENABLE_EXTERNAL_AUTH",
|
|
"HAVE_OPENSSL_SSL_H",
|
|
"HAVE_SCTP",
|
|
"HAVE_SRTP",
|
|
"HAVE_WEBRTC_VIDEO",
|
|
"HAVE_WEBRTC_VOICE",
|
|
"LOGGING_INSIDE_WEBRTC",
|
|
"SRTP_RELATIVE_PATH",
|
|
"SSL_USE_OPENSSL",
|
|
"USE_WEBRTC_DEV_BRANCH",
|
|
]
|
|
} else {
|
|
if (is_posix) {
|
|
# -Wextra is currently disabled in Chromium"s common.gypi. Enable
|
|
# for targets that can handle it. For Android/arm64 right now
|
|
# there will be an "enumeral and non-enumeral type in conditional
|
|
# expression" warning in android_tools/ndk_experimental"s version
|
|
# of stlport.
|
|
# See: https://code.google.com/p/chromium/issues/detail?id=379699
|
|
if (current_cpu != "arm64" || !is_android) {
|
|
cflags = [
|
|
"-Wextra",
|
|
|
|
# We need to repeat some flags from Chromium"s common.gypi
|
|
# here that get overridden by -Wextra.
|
|
"-Wno-unused-parameter",
|
|
"-Wno-missing-field-initializers",
|
|
"-Wno-strict-overflow",
|
|
]
|
|
cflags_cc = [
|
|
"-Wnon-virtual-dtor",
|
|
|
|
# This is enabled for clang; enable for gcc as well.
|
|
"-Woverloaded-virtual",
|
|
]
|
|
}
|
|
}
|
|
|
|
if (is_clang) {
|
|
cflags += [
|
|
"-Wimplicit-fallthrough",
|
|
"-Wthread-safety",
|
|
"-Winconsistent-missing-override",
|
|
]
|
|
}
|
|
}
|
|
|
|
if (rtc_enable_libevent) {
|
|
defines += [ "WEBRTC_BUILD_LIBEVENT" ]
|
|
}
|
|
|
|
if (current_cpu == "arm64") {
|
|
defines += [ "WEBRTC_ARCH_ARM64" ]
|
|
defines += [ "WEBRTC_HAS_NEON" ]
|
|
}
|
|
|
|
if (current_cpu == "arm") {
|
|
defines += [ "WEBRTC_ARCH_ARM" ]
|
|
if (arm_version >= 7) {
|
|
defines += [ "WEBRTC_ARCH_ARM_V7" ]
|
|
if (arm_use_neon) {
|
|
defines += [ "WEBRTC_HAS_NEON" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
if (current_cpu == "mipsel") {
|
|
defines += [ "MIPS32_LE" ]
|
|
if (mips_float_abi == "hard") {
|
|
defines += [ "MIPS_FPU_LE" ]
|
|
}
|
|
if (mips_arch_variant == "r2") {
|
|
defines += [ "MIPS32_R2_LE" ]
|
|
}
|
|
if (mips_dsp_rev == 1) {
|
|
defines += [ "MIPS_DSP_R1_LE" ]
|
|
} else if (mips_dsp_rev == 2) {
|
|
defines += [
|
|
"MIPS_DSP_R1_LE",
|
|
"MIPS_DSP_R2_LE",
|
|
]
|
|
}
|
|
}
|
|
|
|
if (is_android && !is_clang) {
|
|
# The Android NDK doesn"t provide optimized versions of these
|
|
# functions. Ensure they are disabled for all compilers.
|
|
cflags += [
|
|
"-fno-builtin-cos",
|
|
"-fno-builtin-sin",
|
|
"-fno-builtin-cosf",
|
|
"-fno-builtin-sinf",
|
|
]
|
|
}
|
|
|
|
if (use_libfuzzer || use_drfuzz) {
|
|
# Used in Chromium's overrides to disable logging
|
|
defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
|
|
}
|
|
}
|
|
|
|
source_set("webrtc") {
|
|
sources = [
|
|
"call.h",
|
|
"config.h",
|
|
"transport.h",
|
|
]
|
|
|
|
defines = []
|
|
configs += [ ":common_config" ]
|
|
public_configs = [ ":common_inherited_config" ]
|
|
|
|
deps = [
|
|
":webrtc_common",
|
|
"audio",
|
|
"base:rtc_base",
|
|
"call",
|
|
"common_audio",
|
|
"common_video",
|
|
"modules/audio_coding",
|
|
"modules/audio_conference_mixer",
|
|
"modules/audio_device",
|
|
"modules/audio_processing",
|
|
"modules/bitrate_controller",
|
|
"modules/desktop_capture",
|
|
"modules/media_file",
|
|
"modules/rtp_rtcp",
|
|
"modules/utility",
|
|
"modules/video_coding",
|
|
"modules/video_processing",
|
|
"system_wrappers",
|
|
"tools",
|
|
"video",
|
|
"voice_engine",
|
|
]
|
|
|
|
if (build_with_chromium) {
|
|
deps += [ "modules/video_capture" ]
|
|
}
|
|
|
|
if (rtc_enable_protobuf) {
|
|
defines += [ "ENABLE_RTC_EVENT_LOG" ]
|
|
deps += [ ":rtc_event_log_proto" ]
|
|
}
|
|
}
|
|
|
|
if (!build_with_chromium) {
|
|
executable("webrtc_tests") {
|
|
testonly = true
|
|
deps = [
|
|
":webrtc",
|
|
"modules/video_capture:video_capture_internal_impl",
|
|
"test",
|
|
]
|
|
}
|
|
}
|
|
|
|
source_set("webrtc_common") {
|
|
sources = [
|
|
"audio_sink.h",
|
|
"common_types.cc",
|
|
"common_types.h",
|
|
"config.cc",
|
|
"config.h",
|
|
"engine_configurations.h",
|
|
"typedefs.h",
|
|
]
|
|
|
|
configs += [ ":common_config" ]
|
|
public_configs = [ ":common_inherited_config" ]
|
|
|
|
if (is_clang && !is_nacl) {
|
|
# Suppress warnings from Chrome's Clang plugins.
|
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
|
}
|
|
}
|
|
|
|
if (rtc_enable_protobuf) {
|
|
proto_library("rtc_event_log_proto") {
|
|
sources = [
|
|
"call/rtc_event_log.proto",
|
|
]
|
|
proto_out_dir = "webrtc/call"
|
|
}
|
|
}
|
|
|
|
source_set("rtc_event_log") {
|
|
sources = [
|
|
"call/rtc_event_log.cc",
|
|
"call/rtc_event_log.h",
|
|
"call/rtc_event_log_helper_thread.cc",
|
|
"call/rtc_event_log_helper_thread.h",
|
|
]
|
|
|
|
defines = []
|
|
configs += [ ":common_config" ]
|
|
public_configs = [ ":common_inherited_config" ]
|
|
|
|
deps = [
|
|
":webrtc_common",
|
|
]
|
|
|
|
if (rtc_enable_protobuf) {
|
|
defines += [ "ENABLE_RTC_EVENT_LOG" ]
|
|
deps += [ ":rtc_event_log_proto" ]
|
|
}
|
|
if (is_clang && !is_nacl) {
|
|
# Suppress warnings from Chrome's Clang plugins.
|
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
|
}
|
|
}
|
|
|
|
if (rtc_enable_protobuf) {
|
|
source_set("rtc_event_log_parser") {
|
|
sources = [
|
|
"call/rtc_event_log_parser.cc",
|
|
"call/rtc_event_log_parser.h",
|
|
]
|
|
|
|
configs += [ ":common_config" ]
|
|
public_configs = [ ":common_inherited_config" ]
|
|
|
|
deps = [
|
|
":rtc_event_log_proto",
|
|
":webrtc_common",
|
|
]
|
|
|
|
if (is_clang && !is_nacl) {
|
|
# Suppress warnings from Chrome's Clang plugins.
|
|
# See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
|
|
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
|
}
|
|
}
|
|
}
|
|
|
|
if (use_libfuzzer || use_drfuzz) {
|
|
# This target is only here for gn to discover fuzzer build targets under
|
|
# webrtc/test/fuzzers/.
|
|
group("webrtc_fuzzers_dummy") {
|
|
testonly = true
|
|
deps = [
|
|
"test/fuzzers:webrtc_fuzzer_main",
|
|
]
|
|
}
|
|
}
|