blob: b288230820c73ed7449957c402379018e4bca044 [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",
30 "include/ref_count.h",
31 "include/rtp_to_ntp.h",
32 "include/rw_lock_wrapper.h",
33 "include/scoped_vector.h",
34 "include/sleep.h",
35 "include/sort.h",
36 "include/static_instance.h",
37 "include/stl_util.h",
38 "include/stringize_macros.h",
Henrik Kjellander98f53512015-10-28 18:17:40 +010039 "include/tick_util.h",
40 "include/timestamp_extrapolator.h",
41 "include/trace.h",
42 "include/utf_util_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000043 "source/aligned_malloc.cc",
44 "source/atomic32_mac.cc",
45 "source/atomic32_win.cc",
46 "source/clock.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000047 "source/condition_variable_event_win.cc",
48 "source/condition_variable_event_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000049 "source/cpu_features.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020050 "source/cpu_info.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000051 "source/data_log_c.cc",
52 "source/event.cc",
Peter Boström64c03662015-04-08 11:24:19 +020053 "source/event_timer_posix.cc",
54 "source/event_timer_posix.h",
55 "source/event_timer_win.cc",
56 "source/event_timer_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000057 "source/file_impl.cc",
58 "source/file_impl.h",
59 "source/logging.cc",
60 "source/rtp_to_ntp.cc",
61 "source/rw_lock.cc",
tommi@webrtc.orgfe196992015-02-07 22:35:54 +000062 "source/rw_lock_posix.cc",
63 "source/rw_lock_posix.h",
64 "source/rw_lock_win.cc",
65 "source/rw_lock_win.h",
tommi61046eb2016-01-19 02:59:56 -080066 "source/rw_lock_winxp_win.cc",
67 "source/rw_lock_winxp_win.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000068 "source/sleep.cc",
69 "source/sort.cc",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020070 "source/tick_util.cc",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000071 "source/timestamp_extrapolator.cc",
72 "source/trace_impl.cc",
73 "source/trace_impl.h",
74 "source/trace_posix.cc",
75 "source/trace_posix.h",
76 "source/trace_win.cc",
77 "source/trace_win.h",
78 ]
79
80 configs += [ "..:common_config" ]
81
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020082 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000083
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000084 if (rtc_enable_data_logging) {
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000085 sources += [ "source/data_log.cc" ]
86 } else {
87 sources += [ "source/data_log_no_op.cc" ]
88 }
89
90 defines = []
91 libs = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020092 deps = [
93 "..:webrtc_common",
94 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000095
96 if (is_android) {
97 sources += [
Henrik Kjellander98f53512015-10-28 18:17:40 +010098 "include/logcat_trace_context.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000099 "source/logcat_trace_context.cc",
100 ]
101
sprange791ffd2016-01-26 01:53:20 -0800102 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000103
kjellander@webrtc.org62711f82014-06-29 13:37:08 +0000104 deps += [ ":cpu_features_android" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000105
106 libs += [ "log" ]
107 }
108
109 if (is_linux) {
sprange791ffd2016-01-26 01:53:20 -0800110 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000111
112 libs += [ "rt" ]
113 }
114
115 if (!is_mac && !is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200116 sources += [ "source/atomic32_posix.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" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000121 }
122
123 if (is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200124 sources += [ "source/atomic32_mac.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000125 }
126
127 if (is_win) {
128 libs += [ "winmm.lib" ]
129
130 cflags = [
131 "/wd4267", # size_t to int truncation.
132 "/wd4334", # Ignore warning on shift operator promotion.
133 ]
134 }
135
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200136 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000137}
138
139source_set("field_trial_default") {
140 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100141 "include/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000142 "source/field_trial_default.cc",
143 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000144
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000145 configs += [ "..:common_config" ]
146 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000147}
148
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000149source_set("metrics_default") {
150 sources = [
151 "source/metrics_default.cc",
152 ]
153
154 configs += [ "..:common_config" ]
155 public_configs = [ "..:common_inherited_config" ]
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000156}
157
158source_set("system_wrappers_default") {
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000159 configs += [ "..:common_config" ]
160 public_configs = [ "..:common_inherited_config" ]
161
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000162 deps = [
163 ":field_trial_default",
164 ":metrics_default",
pbos12411ef2015-11-23 14:47:56 -0800165 ":system_wrappers",
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000166 ]
167}
168
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000169if (is_android) {
170 source_set("cpu_features_android") {
171 sources = [
172 "source/cpu_features_android.c",
173 ]
174
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000175 configs += [ "..:common_config" ]
176 public_configs = [ "..:common_inherited_config" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200177 deps = [
178 "//third_party/android_tools:cpu_features",
179 ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000180 }
181}