blob: 2f68eae634498705718c374c93666fa83b3717cf [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",
18 "include/condition_variable_wrapper.h",
19 "include/cpu_features_wrapper.h",
20 "include/cpu_info.h",
21 "include/critical_section_wrapper.h",
22 "include/data_log.h",
23 "include/data_log_c.h",
24 "include/data_log_impl.h",
25 "include/event_tracer.h",
26 "include/event_wrapper.h",
27 "include/field_trial.h",
28 "include/file_wrapper.h",
29 "include/fix_interlocked_exchange_pointer_win.h",
30 "include/logging.h",
31 "include/metrics.h",
32 "include/ref_count.h",
33 "include/rtp_to_ntp.h",
34 "include/rw_lock_wrapper.h",
35 "include/scoped_vector.h",
36 "include/sleep.h",
37 "include/sort.h",
38 "include/static_instance.h",
39 "include/stl_util.h",
40 "include/stringize_macros.h",
41 "include/thread_wrapper.h",
42 "include/tick_util.h",
43 "include/timestamp_extrapolator.h",
44 "include/trace.h",
45 "include/utf_util_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000046 "source/aligned_malloc.cc",
47 "source/atomic32_mac.cc",
48 "source/atomic32_win.cc",
49 "source/clock.cc",
50 "source/condition_variable.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000051 "source/condition_variable_event_win.cc",
52 "source/condition_variable_event_win.h",
53 "source/condition_variable_native_win.cc",
54 "source/condition_variable_native_win.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020055 "source/condition_variable_posix.cc",
56 "source/condition_variable_posix.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000057 "source/cpu_features.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020058 "source/cpu_info.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000059 "source/critical_section.cc",
60 "source/critical_section_posix.cc",
61 "source/critical_section_posix.h",
62 "source/critical_section_win.cc",
63 "source/critical_section_win.h",
64 "source/data_log_c.cc",
65 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020066 "source/event_timer_posix.cc",
67 "source/event_timer_posix.h",
68 "source/event_timer_win.cc",
69 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000070 "source/event_tracer.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000071 "source/file_impl.cc",
72 "source/file_impl.h",
73 "source/logging.cc",
74 "source/rtp_to_ntp.cc",
75 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000076 "source/rw_lock_generic.cc",
77 "source/rw_lock_generic.h",
78 "source/rw_lock_posix.cc",
79 "source/rw_lock_posix.h",
80 "source/rw_lock_win.cc",
81 "source/rw_lock_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000082 "source/sleep.cc",
83 "source/sort.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000084 "source/thread.cc",
85 "source/thread_posix.cc",
86 "source/thread_posix.h",
87 "source/thread_win.cc",
88 "source/thread_win.h",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020089 "source/tick_util.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000090 "source/timestamp_extrapolator.cc",
91 "source/trace_impl.cc",
92 "source/trace_impl.h",
93 "source/trace_posix.cc",
94 "source/trace_posix.h",
95 "source/trace_win.cc",
96 "source/trace_win.h",
97 ]
98
99 configs += [ "..:common_config" ]
100
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200101 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000102
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000103 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000104 sources += [ "source/data_log.cc" ]
105 } else {
106 sources += [ "source/data_log_no_op.cc" ]
107 }
108
109 defines = []
110 libs = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200111 deps = [
112 "..:webrtc_common",
113 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000114
115 if (is_android) {
116 sources += [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100117 "include/logcat_trace_context.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000118 "source/logcat_trace_context.cc",
119 ]
120
121 defines += [
122 "WEBRTC_THREAD_RR",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200123
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000124 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
125 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
126 # remove it after I verify that CLOCK_MONOTONIC is fully functional
127 # with condition and event functions in system_wrappers.
128 "WEBRTC_CLOCK_TYPE_REALTIME",
129 ]
130
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000131 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000132
133 libs += [ "log" ]
134 }
135
136 if (is_linux) {
137 defines += [
138 "WEBRTC_THREAD_RR",
139 # TODO(andrew): can we select this automatically?
140 # Define this if the Linux system does not support CLOCK_MONOTONIC.
141 #"WEBRTC_CLOCK_TYPE_REALTIME",
142 ]
143
144 libs += [ "rt" ]
145 }
146
147 if (!is_mac && !is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200148 sources += [ "source/atomic32_posix.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000149 }
150
151 if (is_ios || is_mac) {
152 defines += [
153 "WEBRTC_THREAD_RR",
154 "WEBRTC_CLOCK_TYPE_REALTIME",
155 ]
156 }
157
158 if (is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200159 sources += [ "source/atomic32_mac.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000160 }
161
162 if (is_win) {
163 libs += [ "winmm.lib" ]
164
165 cflags = [
166 "/wd4267", # size_t to int truncation.
167 "/wd4334", # Ignore warning on shift operator promotion.
168 ]
169 }
170
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200171 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000172}
173
174source_set("field_trial_default") {
175 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100176 "include/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000177 "source/field_trial_default.cc",
178 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000179
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000180 configs += [ "..:common_config" ]
181 public_configs = [ "..:common_inherited_config" ]
182
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000183 deps = [
184 ":system_wrappers",
185 ]
186}
187
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000188source_set("metrics_default") {
189 sources = [
190 "source/metrics_default.cc",
191 ]
192
193 configs += [ "..:common_config" ]
194 public_configs = [ "..:common_inherited_config" ]
195
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000196 deps = [
197 ":system_wrappers",
198 ]
199}
200
201source_set("system_wrappers_default") {
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000202 configs += [ "..:common_config" ]
203 public_configs = [ "..:common_inherited_config" ]
204
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000205 deps = [
206 ":field_trial_default",
207 ":metrics_default",
208 ]
209}
210
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000211if (is_android) {
212 source_set("cpu_features_android") {
213 sources = [
214 "source/cpu_features_android.c",
215 ]
216
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000217 configs += [ "..:common_config" ]
218 public_configs = [ "..:common_inherited_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200219 deps = [
220 "//third_party/android_tools:cpu_features",
221 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000222 }
223}