blob: 6d16ac278d3c4a77ee0bc1fa1278ecf76114cd25 [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 = [
andrew@webrtc.org325cff02014-10-01 17:42:18 +000014 "interface/aligned_array.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000015 "interface/aligned_malloc.h",
16 "interface/atomic32.h",
17 "interface/clock.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000018 "interface/condition_variable_wrapper.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000019 "interface/cpu_features_wrapper.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020020 "interface/cpu_info.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000021 "interface/critical_section_wrapper.h",
22 "interface/data_log.h",
23 "interface/data_log_c.h",
24 "interface/data_log_impl.h",
25 "interface/event_tracer.h",
26 "interface/event_wrapper.h",
27 "interface/field_trial.h",
28 "interface/file_wrapper.h",
29 "interface/fix_interlocked_exchange_pointer_win.h",
30 "interface/logging.h",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +000031 "interface/metrics.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000032 "interface/ref_count.h",
33 "interface/rtp_to_ntp.h",
34 "interface/rw_lock_wrapper.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000035 "interface/scoped_refptr.h",
36 "interface/scoped_vector.h",
37 "interface/sleep.h",
38 "interface/sort.h",
39 "interface/static_instance.h",
40 "interface/stl_util.h",
41 "interface/stringize_macros.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000042 "interface/thread_wrapper.h",
43 "interface/tick_util.h",
44 "interface/timestamp_extrapolator.h",
45 "interface/trace.h",
46 "interface/trace_event.h",
47 "interface/utf_util_win.h",
48 "source/aligned_malloc.cc",
49 "source/atomic32_mac.cc",
50 "source/atomic32_win.cc",
51 "source/clock.cc",
52 "source/condition_variable.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000053 "source/condition_variable_event_win.cc",
54 "source/condition_variable_event_win.h",
55 "source/condition_variable_native_win.cc",
56 "source/condition_variable_native_win.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020057 "source/condition_variable_posix.cc",
58 "source/condition_variable_posix.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000059 "source/cpu_features.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020060 "source/cpu_info.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000061 "source/critical_section.cc",
62 "source/critical_section_posix.cc",
63 "source/critical_section_posix.h",
64 "source/critical_section_win.cc",
65 "source/critical_section_win.h",
66 "source/data_log_c.cc",
67 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020068 "source/event_timer_posix.cc",
69 "source/event_timer_posix.h",
70 "source/event_timer_win.cc",
71 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000072 "source/event_tracer.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000073 "source/file_impl.cc",
74 "source/file_impl.h",
75 "source/logging.cc",
76 "source/rtp_to_ntp.cc",
77 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000078 "source/rw_lock_generic.cc",
79 "source/rw_lock_generic.h",
80 "source/rw_lock_posix.cc",
81 "source/rw_lock_posix.h",
82 "source/rw_lock_win.cc",
83 "source/rw_lock_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000084 "source/sleep.cc",
85 "source/sort.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000086 "source/thread.cc",
87 "source/thread_posix.cc",
88 "source/thread_posix.h",
89 "source/thread_win.cc",
90 "source/thread_win.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020091 "source/tick_util.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000092 "source/timestamp_extrapolator.cc",
93 "source/trace_impl.cc",
94 "source/trace_impl.h",
95 "source/trace_posix.cc",
96 "source/trace_posix.h",
97 "source/trace_win.cc",
98 "source/trace_win.h",
99 ]
100
101 configs += [ "..:common_config" ]
102
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200103 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000104
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000105 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000106 sources += [ "source/data_log.cc" ]
107 } else {
108 sources += [ "source/data_log_no_op.cc" ]
109 }
110
111 defines = []
112 libs = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200113 deps = [
114 "..:webrtc_common",
115 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000116
117 if (is_android) {
118 sources += [
119 "interface/logcat_trace_context.h",
120 "source/logcat_trace_context.cc",
121 ]
122
123 defines += [
124 "WEBRTC_THREAD_RR",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200125
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000126 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
127 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
128 # remove it after I verify that CLOCK_MONOTONIC is fully functional
129 # with condition and event functions in system_wrappers.
130 "WEBRTC_CLOCK_TYPE_REALTIME",
131 ]
132
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000133 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000134
135 libs += [ "log" ]
136 }
137
138 if (is_linux) {
139 defines += [
140 "WEBRTC_THREAD_RR",
141 # TODO(andrew): can we select this automatically?
142 # Define this if the Linux system does not support CLOCK_MONOTONIC.
143 #"WEBRTC_CLOCK_TYPE_REALTIME",
144 ]
145
146 libs += [ "rt" ]
147 }
148
149 if (!is_mac && !is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200150 sources += [ "source/atomic32_posix.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000151 }
152
153 if (is_ios || is_mac) {
154 defines += [
155 "WEBRTC_THREAD_RR",
156 "WEBRTC_CLOCK_TYPE_REALTIME",
157 ]
158 }
159
160 if (is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200161 sources += [ "source/atomic32_mac.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000162 }
163
164 if (is_win) {
165 libs += [ "winmm.lib" ]
166
167 cflags = [
168 "/wd4267", # size_t to int truncation.
169 "/wd4334", # Ignore warning on shift operator promotion.
170 ]
171 }
172
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200173 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000174}
175
176source_set("field_trial_default") {
177 sources = [
glaznev@webrtc.org669bc7e2015-02-09 18:17:46 +0000178 "interface/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000179 "source/field_trial_default.cc",
180 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000181
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000182 configs += [ "..:common_config" ]
183 public_configs = [ "..:common_inherited_config" ]
184
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000185 deps = [
186 ":system_wrappers",
187 ]
188}
189
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000190source_set("metrics_default") {
191 sources = [
192 "source/metrics_default.cc",
193 ]
194
195 configs += [ "..:common_config" ]
196 public_configs = [ "..:common_inherited_config" ]
197
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000198 deps = [
199 ":system_wrappers",
200 ]
201}
202
203source_set("system_wrappers_default") {
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000204 configs += [ "..:common_config" ]
205 public_configs = [ "..:common_inherited_config" ]
206
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000207 deps = [
208 ":field_trial_default",
209 ":metrics_default",
210 ]
211}
212
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000213if (is_android) {
214 source_set("cpu_features_android") {
215 sources = [
216 "source/cpu_features_android.c",
217 ]
218
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000219 configs += [ "..:common_config" ]
220 public_configs = [ "..:common_inherited_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200221 deps = [
222 "//third_party/android_tools:cpu_features",
223 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000224 }
225}