blob: bbad2d95340c76ac832689647fe375db40b96f4e [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
110 libs += [ "rt" ]
111 }
112
113 if (!is_mac && !is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200114 sources += [ "source/atomic32_posix.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000115 }
116
117 if (is_ios || is_mac) {
sprange791ffd2016-01-26 01:53:20 -0800118 defines += [ "WEBRTC_THREAD_RR" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000119 }
120
121 if (is_ios) {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200122 sources += [ "source/atomic32_mac.cc" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000123 }
124
125 if (is_win) {
126 libs += [ "winmm.lib" ]
127
128 cflags = [
129 "/wd4267", # size_t to int truncation.
130 "/wd4334", # Ignore warning on shift operator promotion.
131 ]
132 }
133
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200134 deps += [ "../base:rtc_base_approved" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000135}
136
137source_set("field_trial_default") {
138 sources = [
Henrik Kjellander98f53512015-10-28 18:17:40 +0100139 "include/field_trial_default.h",
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000140 "source/field_trial_default.cc",
141 ]
kjellander@webrtc.org42ee5b52014-08-25 14:15:35 +0000142
kjellander@webrtc.orgf21ea912014-09-28 17:37:22 +0000143 configs += [ "..:common_config" ]
144 public_configs = [ "..:common_inherited_config" ]
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +0000145}
146
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000147source_set("metrics_default") {
148 sources = [
149 "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}