kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 1 | # 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.org | 62711f8 | 2014-06-29 13:37:08 +0000 | [diff] [blame] | 9 | import("//build/config/android/config.gni") |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 10 | import("../build/webrtc.gni") |
| 11 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 12 | static_library("system_wrappers") { |
| 13 | sources = [ |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 14 | "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", |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 25 | "include/event_wrapper.h", |
| 26 | "include/field_trial.h", |
| 27 | "include/file_wrapper.h", |
| 28 | "include/fix_interlocked_exchange_pointer_win.h", |
| 29 | "include/logging.h", |
| 30 | "include/metrics.h", |
| 31 | "include/ref_count.h", |
| 32 | "include/rtp_to_ntp.h", |
| 33 | "include/rw_lock_wrapper.h", |
| 34 | "include/scoped_vector.h", |
| 35 | "include/sleep.h", |
| 36 | "include/sort.h", |
| 37 | "include/static_instance.h", |
| 38 | "include/stl_util.h", |
| 39 | "include/stringize_macros.h", |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 40 | "include/tick_util.h", |
| 41 | "include/timestamp_extrapolator.h", |
| 42 | "include/trace.h", |
| 43 | "include/utf_util_win.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 44 | "source/aligned_malloc.cc", |
| 45 | "source/atomic32_mac.cc", |
| 46 | "source/atomic32_win.cc", |
| 47 | "source/clock.cc", |
| 48 | "source/condition_variable.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 49 | "source/condition_variable_event_win.cc", |
| 50 | "source/condition_variable_event_win.h", |
| 51 | "source/condition_variable_native_win.cc", |
| 52 | "source/condition_variable_native_win.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 53 | "source/condition_variable_posix.cc", |
| 54 | "source/condition_variable_posix.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 55 | "source/cpu_features.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 56 | "source/cpu_info.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 57 | "source/critical_section.cc", |
| 58 | "source/critical_section_posix.cc", |
| 59 | "source/critical_section_posix.h", |
| 60 | "source/critical_section_win.cc", |
| 61 | "source/critical_section_win.h", |
| 62 | "source/data_log_c.cc", |
| 63 | "source/event.cc", |
Peter Boström | 64c0366 | 2015-04-08 11:24:19 +0200 | [diff] [blame] | 64 | "source/event_timer_posix.cc", |
| 65 | "source/event_timer_posix.h", |
| 66 | "source/event_timer_win.cc", |
| 67 | "source/event_timer_win.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 68 | "source/file_impl.cc", |
| 69 | "source/file_impl.h", |
| 70 | "source/logging.cc", |
| 71 | "source/rtp_to_ntp.cc", |
| 72 | "source/rw_lock.cc", |
tommi@webrtc.org | fe19699 | 2015-02-07 22:35:54 +0000 | [diff] [blame] | 73 | "source/rw_lock_generic.cc", |
| 74 | "source/rw_lock_generic.h", |
| 75 | "source/rw_lock_posix.cc", |
| 76 | "source/rw_lock_posix.h", |
| 77 | "source/rw_lock_win.cc", |
| 78 | "source/rw_lock_win.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 79 | "source/sleep.cc", |
| 80 | "source/sort.cc", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 81 | "source/tick_util.cc", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 82 | "source/timestamp_extrapolator.cc", |
| 83 | "source/trace_impl.cc", |
| 84 | "source/trace_impl.h", |
| 85 | "source/trace_posix.cc", |
| 86 | "source/trace_posix.h", |
| 87 | "source/trace_win.cc", |
| 88 | "source/trace_win.h", |
| 89 | ] |
| 90 | |
| 91 | configs += [ "..:common_config" ] |
| 92 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 93 | public_configs = [ "..:common_inherited_config" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 94 | |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 95 | if (rtc_enable_data_logging) { |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 96 | sources += [ "source/data_log.cc" ] |
| 97 | } else { |
| 98 | sources += [ "source/data_log_no_op.cc" ] |
| 99 | } |
| 100 | |
| 101 | defines = [] |
| 102 | libs = [] |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 103 | deps = [ |
| 104 | "..:webrtc_common", |
| 105 | ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 106 | |
| 107 | if (is_android) { |
| 108 | sources += [ |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 109 | "include/logcat_trace_context.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 110 | "source/logcat_trace_context.cc", |
| 111 | ] |
| 112 | |
| 113 | defines += [ |
| 114 | "WEBRTC_THREAD_RR", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 115 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 116 | # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC |
| 117 | # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now, |
| 118 | # remove it after I verify that CLOCK_MONOTONIC is fully functional |
| 119 | # with condition and event functions in system_wrappers. |
| 120 | "WEBRTC_CLOCK_TYPE_REALTIME", |
| 121 | ] |
| 122 | |
kjellander@webrtc.org | 62711f8 | 2014-06-29 13:37:08 +0000 | [diff] [blame] | 123 | deps += [ ":cpu_features_android" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 124 | |
| 125 | libs += [ "log" ] |
| 126 | } |
| 127 | |
| 128 | if (is_linux) { |
| 129 | defines += [ |
| 130 | "WEBRTC_THREAD_RR", |
| 131 | # TODO(andrew): can we select this automatically? |
| 132 | # Define this if the Linux system does not support CLOCK_MONOTONIC. |
| 133 | #"WEBRTC_CLOCK_TYPE_REALTIME", |
| 134 | ] |
| 135 | |
| 136 | libs += [ "rt" ] |
| 137 | } |
| 138 | |
| 139 | if (!is_mac && !is_ios) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 140 | sources += [ "source/atomic32_posix.cc" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | if (is_ios || is_mac) { |
| 144 | defines += [ |
| 145 | "WEBRTC_THREAD_RR", |
| 146 | "WEBRTC_CLOCK_TYPE_REALTIME", |
| 147 | ] |
| 148 | } |
| 149 | |
| 150 | if (is_ios) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 151 | sources += [ "source/atomic32_mac.cc" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 152 | } |
| 153 | |
| 154 | if (is_win) { |
| 155 | libs += [ "winmm.lib" ] |
| 156 | |
| 157 | cflags = [ |
| 158 | "/wd4267", # size_t to int truncation. |
| 159 | "/wd4334", # Ignore warning on shift operator promotion. |
| 160 | ] |
| 161 | } |
| 162 | |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 163 | deps += [ "../base:rtc_base_approved" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | source_set("field_trial_default") { |
| 167 | sources = [ |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 168 | "include/field_trial_default.h", |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 169 | "source/field_trial_default.cc", |
| 170 | ] |
kjellander@webrtc.org | 42ee5b5 | 2014-08-25 14:15:35 +0000 | [diff] [blame] | 171 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 172 | configs += [ "..:common_config" ] |
| 173 | public_configs = [ "..:common_inherited_config" ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 174 | } |
| 175 | |
asapersson@webrtc.org | 580d367 | 2014-10-23 12:57:56 +0000 | [diff] [blame] | 176 | source_set("metrics_default") { |
| 177 | sources = [ |
| 178 | "source/metrics_default.cc", |
| 179 | ] |
| 180 | |
| 181 | configs += [ "..:common_config" ] |
| 182 | public_configs = [ "..:common_inherited_config" ] |
asapersson@webrtc.org | 580d367 | 2014-10-23 12:57:56 +0000 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | source_set("system_wrappers_default") { |
asapersson@webrtc.org | 580d367 | 2014-10-23 12:57:56 +0000 | [diff] [blame] | 186 | configs += [ "..:common_config" ] |
| 187 | public_configs = [ "..:common_inherited_config" ] |
| 188 | |
asapersson@webrtc.org | 580d367 | 2014-10-23 12:57:56 +0000 | [diff] [blame] | 189 | deps = [ |
| 190 | ":field_trial_default", |
| 191 | ":metrics_default", |
pbos | 12411ef | 2015-11-23 14:47:56 -0800 | [diff] [blame^] | 192 | ":system_wrappers", |
asapersson@webrtc.org | 580d367 | 2014-10-23 12:57:56 +0000 | [diff] [blame] | 193 | ] |
| 194 | } |
| 195 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 196 | if (is_android) { |
| 197 | source_set("cpu_features_android") { |
| 198 | sources = [ |
| 199 | "source/cpu_features_android.c", |
| 200 | ] |
| 201 | |
kjellander@webrtc.org | f21ea91 | 2014-09-28 17:37:22 +0000 | [diff] [blame] | 202 | configs += [ "..:common_config" ] |
| 203 | public_configs = [ "..:common_inherited_config" ] |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 204 | deps = [ |
| 205 | "//third_party/android_tools:cpu_features", |
| 206 | ] |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 207 | } |
| 208 | } |