Fix iOS GN build and cleanup system_wrappers

Compile fixes for GN on iOS that finally gets our bots green.

Changes to system_wrappers:
* Updated to only use inclusive sources for maintainability
* Add a few missing GN headers.
* Cleanup GYP hack for atomic32_mac.cc
* Renamed changes sources to avoid problems with GYP/GN file
   suffix rules:
  - atomic32_mac.cc -> atomic32_darwin.cc
  - atomic32_posix.cc -> atomic32_non_darwin_unix.cc
See https://code.google.com/p/chromium/codesearch#chromium/src/build/config/BUILDCONFIG.gn&l=325
for details on which extensions can/cannot be used.

BUG=webrtc:5586
NOTRY=True

Review-Url: https://codereview.webrtc.org/1999723002
Cr-Commit-Position: refs/heads/master@{#12897}
This commit is contained in:
kjellander
2016-05-25 11:37:11 -07:00
committed by Commit bot
parent a4463bcd07
commit 080a1e3fa6
10 changed files with 90 additions and 50 deletions

View File

@ -239,5 +239,11 @@ if (rtc_build_with_neon) {
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
if (is_clang) {
# 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" ]
}
}
}

View File

@ -92,7 +92,8 @@ class AudioDeviceIOS : public AudioDeviceGeneric,
// See audio_device_not_implemented.cc for trivial implementations.
int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
uint16_t& sizeMS) const override;
int32_t ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const;
int32_t ActiveAudioLayer(
AudioDeviceModule::AudioLayer& audioLayer) const override;
int32_t ResetAudioDevice() override;
int32_t PlayoutIsAvailable(bool& available) override;
int32_t RecordingIsAvailable(bool& available) override;

View File

@ -370,10 +370,12 @@ void VoiceProcessingAudioUnit::DisposeAudioUnit() {
case kStarted:
Stop();
// Fall through.
FALLTHROUGH();
case kInitialized:
Uninitialize();
break;
case kUninitialized:
FALLTHROUGH();
case kInitRequired:
break;
}

View File

@ -24,6 +24,7 @@ source_set("utility") {
"source/file_recorder_impl.cc",
"source/file_recorder_impl.h",
"source/helpers_android.cc",
"source/helpers_ios.mm",
"source/jvm_android.cc",
"source/process_thread_impl.cc",
"source/process_thread_impl.h",

View File

@ -151,6 +151,11 @@ source_set("webrtc_h264") {
"../../system_wrappers",
]
if (is_ios) {
sources += [ "codecs/h264/h264_objc.mm" ]
deps += [ ":webrtc_h264_video_toolbox" ]
}
if (rtc_use_h264) {
defines += [ "WEBRTC_USE_H264" ]
if (rtc_initialize_ffmpeg) {
@ -170,8 +175,52 @@ source_set("webrtc_h264") {
}
}
# TODO(tkchin): Source set for webrtc_h264_video_toolbox. Currently not
# possible to add, see https://crbug.com/297668.
if (is_ios) {
source_set("webrtc_h264_video_toolbox") {
sources = [
"codecs/h264/h264_video_toolbox_decoder.cc",
"codecs/h264/h264_video_toolbox_decoder.h",
"codecs/h264/h264_video_toolbox_encoder.cc",
"codecs/h264/h264_video_toolbox_encoder.h",
"codecs/h264/h264_video_toolbox_nalu.cc",
"codecs/h264/h264_video_toolbox_nalu.h",
]
configs += [ "//build/config/compiler:enable_arc" ]
cflags = [ "-Wobjc-missing-property-synthesis" ]
precompiled_header = "../../sdk/objc/WebRTC-Prefix.pch"
precompiled_source = "../../sdk/objc/WebRTC-Prefix.pch"
deps = [
"../../sdk:rtc_sdk_common_objc",
]
libs = [
"CoreFoundation.framework",
"CoreMedia.framework",
"CoreVideo.framework",
"VideoToolbox.framework",
]
if (is_clang) {
# 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_build_libyuv) {
deps += [ "$rtc_libyuv_dir" ]
public_deps = [
"$rtc_libyuv_dir",
]
} else {
# Need to add a directory normally exported by libyuv.
include_dirs += [ "$rtc_libyuv_dir/include" ]
}
}
}
source_set("webrtc_i420") {
sources = [

View File

@ -10,16 +10,22 @@ import("../build/webrtc.gni")
import("//build_overrides/webrtc.gni")
if (is_ios) {
config("rtc_sdk_common_objc_config") {
include_dirs = [
"objc/Framework/Classes",
"objc/Framework/Headers",
]
}
source_set("rtc_sdk_common_objc") {
deps = [
"../base:rtc_base",
]
cflags = [ "-fobjc-arc" ]
configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
include_dirs = [
"objc/Framework/Classes",
"objc/Framework/Headers",
public_configs = [
"..:common_inherited_config",
":rtc_sdk_common_objc_config",
]
sources = [
"objc/Framework/Classes/NSString+StdString.h",
@ -54,14 +60,8 @@ if (is_ios) {
":rtc_sdk_common_objc",
#"../../talk/libjingle:libjingle_peerconnection",
]
cflags = [
"-fobjc-arc",
"-Wobjc-missing-property-synthesis",
]
include_dirs = [
"objc/Framework/Classes",
"objc/Framework/Headers",
]
configs += [ "//build/config/compiler:enable_arc" ]
cflags = [ "-Wobjc-missing-property-synthesis" ]
sources = [
# Add these when there's a BUILD.gn for peer connection APIs
#"objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h",

View File

@ -27,6 +27,7 @@ static_library("system_wrappers") {
"include/fix_interlocked_exchange_pointer_win.h",
"include/logging.h",
"include/metrics.h",
"include/ntp_time.h",
"include/rtp_to_ntp.h",
"include/rw_lock_wrapper.h",
"include/sleep.h",
@ -38,7 +39,6 @@ static_library("system_wrappers") {
"include/trace.h",
"include/utf_util_win.h",
"source/aligned_malloc.cc",
"source/atomic32_mac.cc",
"source/atomic32_win.cc",
"source/clock.cc",
"source/condition_variable_event_win.cc",
@ -112,16 +112,13 @@ static_library("system_wrappers") {
libs += [ "rt" ]
}
if (!is_mac && !is_ios) {
sources += [ "source/atomic32_posix.cc" ]
if (is_linux || is_android) {
sources += [ "source/atomic32_non_darwin_unix.cc" ]
}
if (is_ios || is_mac) {
defines += [ "WEBRTC_THREAD_RR" ]
}
if (is_ios) {
sources += [ "source/atomic32_mac.cc" ]
sources += [ "source/atomic32_darwin.cc" ]
}
if (is_win) {

View File

@ -21,8 +21,8 @@
'include/aligned_malloc.h',
'include/atomic32.h',
'include/clock.h',
'include/cpu_info.h',
'include/cpu_features_wrapper.h',
'include/cpu_info.h',
'include/critical_section_wrapper.h',
'include/data_log.h',
'include/data_log_c.h',
@ -31,7 +31,6 @@
'include/field_trial.h',
'include/file_wrapper.h',
'include/fix_interlocked_exchange_pointer_win.h',
'include/logcat_trace_context.h',
'include/logging.h',
'include/metrics.h',
'include/ntp_time.h',
@ -46,17 +45,13 @@
'include/trace.h',
'include/utf_util_win.h',
'source/aligned_malloc.cc',
'source/atomic32_mac.cc',
'source/atomic32_posix.cc',
'source/atomic32_win.cc',
'source/clock.cc',
'source/condition_variable_event_win.cc',
'source/condition_variable_event_win.h',
'source/cpu_info.cc',
'source/cpu_features.cc',
'source/data_log.cc',
'source/cpu_info.cc',
'source/data_log_c.cc',
'source/data_log_no_op.cc',
'source/event.cc',
'source/event_timer_posix.cc',
'source/event_timer_posix.h',
@ -64,7 +59,6 @@
'source/event_timer_win.h',
'source/file_impl.cc',
'source/file_impl.h',
'source/logcat_trace_context.cc',
'source/logging.cc',
'source/rtp_to_ntp.cc',
'source/rw_lock.cc',
@ -86,9 +80,9 @@
],
'conditions': [
['enable_data_logging==1', {
'sources!': [ 'source/data_log_no_op.cc', ],
'sources': [ 'source/data_log.cc', ],
}, {
'sources!': [ 'source/data_log.cc', ],
'sources': [ 'source/data_log_no_op.cc', ],
},],
['OS=="android"', {
'defines': [
@ -110,8 +104,7 @@
'-llog',
],
},
}, { # OS!="android"
'sources!': [
'sources': [
'include/logcat_trace_context.h',
'source/logcat_trace_context.cc',
],
@ -135,14 +128,19 @@
'link_settings': {
'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
},
'sources!': [
'source/atomic32_posix.cc',
}],
['OS=="linux" or OS=="android"', {
'sources': [
'source/atomic32_non_darwin_unix.cc',
],
}],
['OS=="ios" or OS=="mac"', {
'defines': [
'WEBRTC_THREAD_RR',
],
'sources': [
'source/atomic32_darwin.cc',
],
}],
['OS=="win"', {
'link_settings': {
@ -150,20 +148,6 @@
},
}],
], # conditions
'target_conditions': [
# We need to do this in a target_conditions block to override the
# filename_rules filters.
['OS=="ios"', {
# Pull in specific Mac files for iOS (which have been filtered out
# by file name rules).
'sources/': [
['include', '^source/atomic32_mac\\.'],
],
'sources!': [
'source/atomic32_posix.cc',
],
}],
],
# Disable warnings to enable Win64 build, issue 1323.
'msvs_disabled_warnings': [
4267, # size_t to int truncation.