blob: aff29de502a3d1dd15f9ac9ee5cbade195fd5237 [file] [log] [blame]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
kjellander@webrtc.org62711f82014-06-29 13:37:08 +00009import("//build/config/android/config.gni")
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000010import("../build/webrtc.gni")
11
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000012static_library("system_wrappers") {
13 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +010014 "include/aligned_array.h",
15 "include/aligned_malloc.h",
16 "include/atomic32.h",
17 "include/clock.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010018 "include/cpu_features_wrapper.h",
19 "include/cpu_info.h",
20 "include/critical_section_wrapper.h",
21 "include/data_log.h",
22 "include/data_log_c.h",
23 "include/data_log_impl.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010024 "include/event_wrapper.h",
25 "include/field_trial.h",
26 "include/file_wrapper.h",
27 "include/fix_interlocked_exchange_pointer_win.h",
28 "include/logging.h",
29 "include/metrics.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010030 "include/rtp_to_ntp.h",
31 "include/rw_lock_wrapper.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010032 "include/sleep.h",
33 "include/sort.h",
34 "include/static_instance.h",
35 "include/stl_util.h",
36 "include/stringize_macros.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010037 "include/tick_util.h",
38 "include/timestamp_extrapolator.h",
39 "include/trace.h",
40 "include/utf_util_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000041 "source/aligned_malloc.cc",
42 "source/atomic32_mac.cc",
43 "source/atomic32_win.cc",
44 "source/clock.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000045 "source/condition_variable_event_win.cc",
46 "source/condition_variable_event_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000047 "source/cpu_features.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020048 "source/cpu_info.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000049 "source/data_log_c.cc",
50 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020051 "source/event_timer_posix.cc",
52 "source/event_timer_posix.h",
53 "source/event_timer_win.cc",
54 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000055 "source/file_impl.cc",
56 "source/file_impl.h",
57 "source/logging.cc",
58 "source/rtp_to_ntp.cc",
59 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000060 "source/rw_lock_posix.cc",
61 "source/rw_lock_posix.h",
62 "source/rw_lock_win.cc",
63 "source/rw_lock_win.h",
tommi61046eb2016-01-19 02:59:56 -080064 "source/rw_lock_winxp_win.cc",
65 "source/rw_lock_winxp_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000066 "source/sleep.cc",
67 "source/sort.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020068 "source/tick_util.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000069 "source/timestamp_extrapolator.cc",
70 "source/trace_impl.cc",
71 "source/trace_impl.h",
72 "source/trace_posix.cc",
73 "source/trace_posix.h",
74 "source/trace_win.cc",
75 "source/trace_win.h",
76 ]
77
78 configs += [ "..:common_config" ]
79
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020080 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000081
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000082 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000083 sources += [ "source/data_log.cc" ]
84 } else {
85 sources += [ "source/data_log_no_op.cc" ]
86 }
87
88 defines = []
89 libs = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020090 deps = [
91 "..:webrtc_common",
92 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000093
94 if (is_android) {
95 sources += [
Henrik Kjellander98f53512015-10-28 18:17:40 +010096 "include/logcat_trace_context.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000097 "source/logcat_trace_context.cc",
98 ]
99
sprange791ffd2016-01-26 01:53:20 -0800100 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000101
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000102 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000103
104 libs += [ "log" ]
105 }
106
107 if (is_linux) {
sprange791ffd2016-01-26 01:53:20 -0800108 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000109
simon.hosie953b1c12016-04-06 14:02:26 -0700110 if (!build_with_chromium) {
111 deps += [ ":cpu_features_linux" ]
112 }
113
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000114 libs += [ "rt" ]
115 }
116
117 if (!is_mac && !is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200118 sources += [ "source/atomic32_posix.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000119 }
120
121 if (is_ios || is_mac) {
sprange791ffd2016-01-26 01:53:20 -0800122 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000123 }
124
125 if (is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200126 sources += [ "source/atomic32_mac.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000127 }
128
129 if (is_win) {
130 libs += [ "winmm.lib" ]
131
132 cflags = [
133 "/wd4267", # size_t to int truncation.
134 "/wd4334", # Ignore warning on shift operator promotion.
135 ]
136 }
137
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200138 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000139}
140
141source_set("field_trial_default") {
142 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100143 "include/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000144 "source/field_trial_default.cc",
145 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000146
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000147 configs += [ "..:common_config" ]
148 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000149}
150
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000151source_set("metrics_default") {
152 sources = [
153 "source/metrics_default.cc",
154 ]
155
156 configs += [ "..:common_config" ]
157 public_configs = [ "..:common_inherited_config" ]
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000158}
159
160source_set("system_wrappers_default") {
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000161 configs += [ "..:common_config" ]
162 public_configs = [ "..:common_inherited_config" ]
163
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000164 deps = [
165 ":field_trial_default",
166 ":metrics_default",
pbos12411ef2015-11-23 14:47:56 -0800167 ":system_wrappers",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000168 ]
169}
170
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000171if (is_android) {
172 source_set("cpu_features_android") {
173 sources = [
174 "source/cpu_features_android.c",
175 ]
176
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000177 configs += [ "..:common_config" ]
178 public_configs = [ "..:common_inherited_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200179 deps = [
180 "//third_party/android_tools:cpu_features",
181 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000182 }
183}
simon.hosie953b1c12016-04-06 14:02:26 -0700184
185if (is_linux) {
186 source_set("cpu_features_linux") {
187 sources = [
188 "source/cpu_features_linux.c",
189 ]
190
191 configs += [ "..:common_config" ]
192 public_configs = [ "..:common_inherited_config" ]
193 }
194}