blob: a1e97d9d475c32ef27bd36f8347ca84e962289e5 [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",
kjellander080a1e32016-05-25 11:37:11 -070030 "include/ntp_time.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010031 "include/rtp_to_ntp.h",
32 "include/rw_lock_wrapper.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010033 "include/sleep.h",
34 "include/sort.h",
35 "include/static_instance.h",
36 "include/stl_util.h",
37 "include/stringize_macros.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010038 "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",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000042 "source/atomic32_win.cc",
43 "source/clock.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000044 "source/condition_variable_event_win.cc",
45 "source/condition_variable_event_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000046 "source/cpu_features.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020047 "source/cpu_info.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000048 "source/data_log_c.cc",
49 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020050 "source/event_timer_posix.cc",
51 "source/event_timer_posix.h",
52 "source/event_timer_win.cc",
53 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000054 "source/file_impl.cc",
55 "source/file_impl.h",
56 "source/logging.cc",
57 "source/rtp_to_ntp.cc",
58 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000059 "source/rw_lock_posix.cc",
60 "source/rw_lock_posix.h",
61 "source/rw_lock_win.cc",
62 "source/rw_lock_win.h",
tommi61046eb2016-01-19 02:59:56 -080063 "source/rw_lock_winxp_win.cc",
64 "source/rw_lock_winxp_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000065 "source/sleep.cc",
66 "source/sort.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000067 "source/timestamp_extrapolator.cc",
68 "source/trace_impl.cc",
69 "source/trace_impl.h",
70 "source/trace_posix.cc",
71 "source/trace_posix.h",
72 "source/trace_win.cc",
73 "source/trace_win.h",
74 ]
75
76 configs += [ "..:common_config" ]
77
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020078 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000079
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000080 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000081 sources += [ "source/data_log.cc" ]
82 } else {
83 sources += [ "source/data_log_no_op.cc" ]
84 }
85
86 defines = []
87 libs = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020088 deps = [
89 "..:webrtc_common",
90 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000091
92 if (is_android) {
93 sources += [
Henrik Kjellander98f53512015-10-28 18:17:40 +010094 "include/logcat_trace_context.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000095 "source/logcat_trace_context.cc",
96 ]
97
sprange791ffd2016-01-26 01:53:20 -080098 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000099
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000100 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000101
102 libs += [ "log" ]
103 }
104
105 if (is_linux) {
sprange791ffd2016-01-26 01:53:20 -0800106 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000107
simon.hosie953b1c12016-04-06 14:02:26 -0700108 if (!build_with_chromium) {
109 deps += [ ":cpu_features_linux" ]
110 }
111
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000112 libs += [ "rt" ]
113 }
114
kjellander080a1e32016-05-25 11:37:11 -0700115 if (is_linux || is_android) {
116 sources += [ "source/atomic32_non_darwin_unix.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000117 }
118
119 if (is_ios || is_mac) {
sprange791ffd2016-01-26 01:53:20 -0800120 defines += [ "WEBRTC_THREAD_RR" ]
kjellander080a1e32016-05-25 11:37:11 -0700121 sources += [ "source/atomic32_darwin.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000122 }
123
kjellander8f4419b2016-06-02 02:09:52 -0700124 # TODO(jschuh): Bug 1348: fix this warning.
125 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
126
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000127 if (is_win) {
128 libs += [ "winmm.lib" ]
129
kjellander8f4419b2016-06-02 02:09:52 -0700130 cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion.
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000131 }
132
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200133 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000134}
135
136source_set("field_trial_default") {
137 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100138 "include/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000139 "source/field_trial_default.cc",
140 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000141
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000142 configs += [ "..:common_config" ]
143 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000144}
145
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000146source_set("metrics_default") {
147 sources = [
asapersson01d70a32016-05-20 06:29:46 -0700148 "include/metrics_default.h",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000149 "source/metrics_default.cc",
150 ]
151
152 configs += [ "..:common_config" ]
153 public_configs = [ "..:common_inherited_config" ]
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000154}
155
156source_set("system_wrappers_default") {
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000157 configs += [ "..:common_config" ]
158 public_configs = [ "..:common_inherited_config" ]
159
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000160 deps = [
161 ":field_trial_default",
162 ":metrics_default",
pbos12411ef2015-11-23 14:47:56 -0800163 ":system_wrappers",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000164 ]
165}
166
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000167if (is_android) {
168 source_set("cpu_features_android") {
169 sources = [
170 "source/cpu_features_android.c",
171 ]
172
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000173 configs += [ "..:common_config" ]
174 public_configs = [ "..:common_inherited_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200175 deps = [
176 "//third_party/android_tools:cpu_features",
177 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000178 }
179}
simon.hosie953b1c12016-04-06 14:02:26 -0700180
181if (is_linux) {
182 source_set("cpu_features_linux") {
183 sources = [
184 "source/cpu_features_linux.c",
185 ]
186
187 configs += [ "..:common_config" ]
188 public_configs = [ "..:common_inherited_config" ]
189 }
190}