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:
parent
a4463bcd07
commit
080a1e3fa6
@ -239,5 +239,11 @@ if (rtc_build_with_neon) {
|
|||||||
|
|
||||||
configs += [ "..:common_config" ]
|
configs += [ "..:common_config" ]
|
||||||
public_configs = [ "..:common_inherited_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" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,8 @@ class AudioDeviceIOS : public AudioDeviceGeneric,
|
|||||||
// See audio_device_not_implemented.cc for trivial implementations.
|
// See audio_device_not_implemented.cc for trivial implementations.
|
||||||
int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
|
int32_t PlayoutBuffer(AudioDeviceModule::BufferType& type,
|
||||||
uint16_t& sizeMS) const override;
|
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 ResetAudioDevice() override;
|
||||||
int32_t PlayoutIsAvailable(bool& available) override;
|
int32_t PlayoutIsAvailable(bool& available) override;
|
||||||
int32_t RecordingIsAvailable(bool& available) override;
|
int32_t RecordingIsAvailable(bool& available) override;
|
||||||
|
|||||||
@ -370,10 +370,12 @@ void VoiceProcessingAudioUnit::DisposeAudioUnit() {
|
|||||||
case kStarted:
|
case kStarted:
|
||||||
Stop();
|
Stop();
|
||||||
// Fall through.
|
// Fall through.
|
||||||
|
FALLTHROUGH();
|
||||||
case kInitialized:
|
case kInitialized:
|
||||||
Uninitialize();
|
Uninitialize();
|
||||||
break;
|
break;
|
||||||
case kUninitialized:
|
case kUninitialized:
|
||||||
|
FALLTHROUGH();
|
||||||
case kInitRequired:
|
case kInitRequired:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ source_set("utility") {
|
|||||||
"source/file_recorder_impl.cc",
|
"source/file_recorder_impl.cc",
|
||||||
"source/file_recorder_impl.h",
|
"source/file_recorder_impl.h",
|
||||||
"source/helpers_android.cc",
|
"source/helpers_android.cc",
|
||||||
|
"source/helpers_ios.mm",
|
||||||
"source/jvm_android.cc",
|
"source/jvm_android.cc",
|
||||||
"source/process_thread_impl.cc",
|
"source/process_thread_impl.cc",
|
||||||
"source/process_thread_impl.h",
|
"source/process_thread_impl.h",
|
||||||
|
|||||||
@ -151,6 +151,11 @@ source_set("webrtc_h264") {
|
|||||||
"../../system_wrappers",
|
"../../system_wrappers",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (is_ios) {
|
||||||
|
sources += [ "codecs/h264/h264_objc.mm" ]
|
||||||
|
deps += [ ":webrtc_h264_video_toolbox" ]
|
||||||
|
}
|
||||||
|
|
||||||
if (rtc_use_h264) {
|
if (rtc_use_h264) {
|
||||||
defines += [ "WEBRTC_USE_H264" ]
|
defines += [ "WEBRTC_USE_H264" ]
|
||||||
if (rtc_initialize_ffmpeg) {
|
if (rtc_initialize_ffmpeg) {
|
||||||
@ -170,8 +175,52 @@ source_set("webrtc_h264") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO(tkchin): Source set for webrtc_h264_video_toolbox. Currently not
|
if (is_ios) {
|
||||||
# possible to add, see https://crbug.com/297668.
|
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") {
|
source_set("webrtc_i420") {
|
||||||
sources = [
|
sources = [
|
||||||
|
|||||||
@ -10,16 +10,22 @@ import("../build/webrtc.gni")
|
|||||||
import("//build_overrides/webrtc.gni")
|
import("//build_overrides/webrtc.gni")
|
||||||
|
|
||||||
if (is_ios) {
|
if (is_ios) {
|
||||||
|
config("rtc_sdk_common_objc_config") {
|
||||||
|
include_dirs = [
|
||||||
|
"objc/Framework/Classes",
|
||||||
|
"objc/Framework/Headers",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
source_set("rtc_sdk_common_objc") {
|
source_set("rtc_sdk_common_objc") {
|
||||||
deps = [
|
deps = [
|
||||||
"../base:rtc_base",
|
"../base:rtc_base",
|
||||||
]
|
]
|
||||||
cflags = [ "-fobjc-arc" ]
|
cflags = [ "-fobjc-arc" ]
|
||||||
configs += [ "..:common_config" ]
|
configs += [ "..:common_config" ]
|
||||||
public_configs = [ "..:common_inherited_config" ]
|
public_configs = [
|
||||||
include_dirs = [
|
"..:common_inherited_config",
|
||||||
"objc/Framework/Classes",
|
":rtc_sdk_common_objc_config",
|
||||||
"objc/Framework/Headers",
|
|
||||||
]
|
]
|
||||||
sources = [
|
sources = [
|
||||||
"objc/Framework/Classes/NSString+StdString.h",
|
"objc/Framework/Classes/NSString+StdString.h",
|
||||||
@ -54,14 +60,8 @@ if (is_ios) {
|
|||||||
":rtc_sdk_common_objc",
|
":rtc_sdk_common_objc",
|
||||||
#"../../talk/libjingle:libjingle_peerconnection",
|
#"../../talk/libjingle:libjingle_peerconnection",
|
||||||
]
|
]
|
||||||
cflags = [
|
configs += [ "//build/config/compiler:enable_arc" ]
|
||||||
"-fobjc-arc",
|
cflags = [ "-Wobjc-missing-property-synthesis" ]
|
||||||
"-Wobjc-missing-property-synthesis",
|
|
||||||
]
|
|
||||||
include_dirs = [
|
|
||||||
"objc/Framework/Classes",
|
|
||||||
"objc/Framework/Headers",
|
|
||||||
]
|
|
||||||
sources = [
|
sources = [
|
||||||
# Add these when there's a BUILD.gn for peer connection APIs
|
# Add these when there's a BUILD.gn for peer connection APIs
|
||||||
#"objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h",
|
#"objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h",
|
||||||
|
|||||||
@ -27,6 +27,7 @@ static_library("system_wrappers") {
|
|||||||
"include/fix_interlocked_exchange_pointer_win.h",
|
"include/fix_interlocked_exchange_pointer_win.h",
|
||||||
"include/logging.h",
|
"include/logging.h",
|
||||||
"include/metrics.h",
|
"include/metrics.h",
|
||||||
|
"include/ntp_time.h",
|
||||||
"include/rtp_to_ntp.h",
|
"include/rtp_to_ntp.h",
|
||||||
"include/rw_lock_wrapper.h",
|
"include/rw_lock_wrapper.h",
|
||||||
"include/sleep.h",
|
"include/sleep.h",
|
||||||
@ -38,7 +39,6 @@ static_library("system_wrappers") {
|
|||||||
"include/trace.h",
|
"include/trace.h",
|
||||||
"include/utf_util_win.h",
|
"include/utf_util_win.h",
|
||||||
"source/aligned_malloc.cc",
|
"source/aligned_malloc.cc",
|
||||||
"source/atomic32_mac.cc",
|
|
||||||
"source/atomic32_win.cc",
|
"source/atomic32_win.cc",
|
||||||
"source/clock.cc",
|
"source/clock.cc",
|
||||||
"source/condition_variable_event_win.cc",
|
"source/condition_variable_event_win.cc",
|
||||||
@ -112,16 +112,13 @@ static_library("system_wrappers") {
|
|||||||
libs += [ "rt" ]
|
libs += [ "rt" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_mac && !is_ios) {
|
if (is_linux || is_android) {
|
||||||
sources += [ "source/atomic32_posix.cc" ]
|
sources += [ "source/atomic32_non_darwin_unix.cc" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_ios || is_mac) {
|
if (is_ios || is_mac) {
|
||||||
defines += [ "WEBRTC_THREAD_RR" ]
|
defines += [ "WEBRTC_THREAD_RR" ]
|
||||||
}
|
sources += [ "source/atomic32_darwin.cc" ]
|
||||||
|
|
||||||
if (is_ios) {
|
|
||||||
sources += [ "source/atomic32_mac.cc" ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_win) {
|
if (is_win) {
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
'include/aligned_malloc.h',
|
'include/aligned_malloc.h',
|
||||||
'include/atomic32.h',
|
'include/atomic32.h',
|
||||||
'include/clock.h',
|
'include/clock.h',
|
||||||
'include/cpu_info.h',
|
|
||||||
'include/cpu_features_wrapper.h',
|
'include/cpu_features_wrapper.h',
|
||||||
|
'include/cpu_info.h',
|
||||||
'include/critical_section_wrapper.h',
|
'include/critical_section_wrapper.h',
|
||||||
'include/data_log.h',
|
'include/data_log.h',
|
||||||
'include/data_log_c.h',
|
'include/data_log_c.h',
|
||||||
@ -31,7 +31,6 @@
|
|||||||
'include/field_trial.h',
|
'include/field_trial.h',
|
||||||
'include/file_wrapper.h',
|
'include/file_wrapper.h',
|
||||||
'include/fix_interlocked_exchange_pointer_win.h',
|
'include/fix_interlocked_exchange_pointer_win.h',
|
||||||
'include/logcat_trace_context.h',
|
|
||||||
'include/logging.h',
|
'include/logging.h',
|
||||||
'include/metrics.h',
|
'include/metrics.h',
|
||||||
'include/ntp_time.h',
|
'include/ntp_time.h',
|
||||||
@ -46,17 +45,13 @@
|
|||||||
'include/trace.h',
|
'include/trace.h',
|
||||||
'include/utf_util_win.h',
|
'include/utf_util_win.h',
|
||||||
'source/aligned_malloc.cc',
|
'source/aligned_malloc.cc',
|
||||||
'source/atomic32_mac.cc',
|
|
||||||
'source/atomic32_posix.cc',
|
|
||||||
'source/atomic32_win.cc',
|
'source/atomic32_win.cc',
|
||||||
'source/clock.cc',
|
'source/clock.cc',
|
||||||
'source/condition_variable_event_win.cc',
|
'source/condition_variable_event_win.cc',
|
||||||
'source/condition_variable_event_win.h',
|
'source/condition_variable_event_win.h',
|
||||||
'source/cpu_info.cc',
|
|
||||||
'source/cpu_features.cc',
|
'source/cpu_features.cc',
|
||||||
'source/data_log.cc',
|
'source/cpu_info.cc',
|
||||||
'source/data_log_c.cc',
|
'source/data_log_c.cc',
|
||||||
'source/data_log_no_op.cc',
|
|
||||||
'source/event.cc',
|
'source/event.cc',
|
||||||
'source/event_timer_posix.cc',
|
'source/event_timer_posix.cc',
|
||||||
'source/event_timer_posix.h',
|
'source/event_timer_posix.h',
|
||||||
@ -64,7 +59,6 @@
|
|||||||
'source/event_timer_win.h',
|
'source/event_timer_win.h',
|
||||||
'source/file_impl.cc',
|
'source/file_impl.cc',
|
||||||
'source/file_impl.h',
|
'source/file_impl.h',
|
||||||
'source/logcat_trace_context.cc',
|
|
||||||
'source/logging.cc',
|
'source/logging.cc',
|
||||||
'source/rtp_to_ntp.cc',
|
'source/rtp_to_ntp.cc',
|
||||||
'source/rw_lock.cc',
|
'source/rw_lock.cc',
|
||||||
@ -86,9 +80,9 @@
|
|||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['enable_data_logging==1', {
|
['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"', {
|
['OS=="android"', {
|
||||||
'defines': [
|
'defines': [
|
||||||
@ -110,8 +104,7 @@
|
|||||||
'-llog',
|
'-llog',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}, { # OS!="android"
|
'sources': [
|
||||||
'sources!': [
|
|
||||||
'include/logcat_trace_context.h',
|
'include/logcat_trace_context.h',
|
||||||
'source/logcat_trace_context.cc',
|
'source/logcat_trace_context.cc',
|
||||||
],
|
],
|
||||||
@ -135,14 +128,19 @@
|
|||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
|
'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"', {
|
['OS=="ios" or OS=="mac"', {
|
||||||
'defines': [
|
'defines': [
|
||||||
'WEBRTC_THREAD_RR',
|
'WEBRTC_THREAD_RR',
|
||||||
],
|
],
|
||||||
|
'sources': [
|
||||||
|
'source/atomic32_darwin.cc',
|
||||||
|
],
|
||||||
}],
|
}],
|
||||||
['OS=="win"', {
|
['OS=="win"', {
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
@ -150,20 +148,6 @@
|
|||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
], # conditions
|
], # 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.
|
# Disable warnings to enable Win64 build, issue 1323.
|
||||||
'msvs_disabled_warnings': [
|
'msvs_disabled_warnings': [
|
||||||
4267, # size_t to int truncation.
|
4267, # size_t to int truncation.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user