nicer.gyp (8960B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 # 5 # nrappkit.gyp 6 # 7 # 8 { 9 'variables' : { 10 'have_ethtool_cmd_speed_hi%': 1 11 }, 12 'targets' : [ 13 { 14 'target_name' : 'nicer', 15 'type' : 'static_library', 16 17 'include_dirs' : [ 18 ## EXTERNAL 19 # nrappkit 20 '../nrappkit/src/event', 21 '../nrappkit/src/log', 22 '../nrappkit/src/registry', 23 '../nrappkit/src/share', 24 '../nrappkit/src/util', 25 '../nrappkit/src/util/libekr', 26 '../nrappkit/src/port/generic/include', 27 28 # INTERNAL 29 "./src/crypto", 30 "./src/ice", 31 "./src/net", 32 "./src/stun", 33 "./src/util", 34 ], 35 36 'sources' : [ 37 # Crypto 38 "./src/crypto/nr_crypto.c", 39 "./src/crypto/nr_crypto.h", 40 41 # ICE 42 "./src/ice/ice_candidate.c", 43 "./src/ice/ice_candidate.h", 44 "./src/ice/ice_candidate_pair.c", 45 "./src/ice/ice_candidate_pair.h", 46 "./src/ice/ice_codeword.h", 47 "./src/ice/ice_component.c", 48 "./src/ice/ice_component.h", 49 "./src/ice/ice_ctx.c", 50 "./src/ice/ice_ctx.h", 51 "./src/ice/ice_handler.h", 52 "./src/ice/ice_media_stream.c", 53 "./src/ice/ice_media_stream.h", 54 "./src/ice/ice_parser.c", 55 "./src/ice/ice_peer_ctx.c", 56 "./src/ice/ice_peer_ctx.h", 57 "./src/ice/ice_reg.h", 58 "./src/ice/ice_socket.c", 59 "./src/ice/ice_socket.h", 60 61 # Net 62 "./src/net/nr_resolver.c", 63 "./src/net/nr_resolver.h", 64 "./src/net/nr_socket.c", 65 "./src/net/nr_socket.h", 66 "./src/net/nr_socket_local.h", 67 "./src/net/nr_socket_multi_tcp.c", 68 "./src/net/nr_socket_multi_tcp.h", 69 "./src/net/transport_addr.c", 70 "./src/net/transport_addr.h", 71 "./src/net/local_addr.c", 72 "./src/net/local_addr.h", 73 "./src/net/nr_interface_prioritizer.c", 74 "./src/net/nr_interface_prioritizer.h", 75 76 # STUN 77 "./src/stun/addrs.c", 78 "./src/stun/addrs.h", 79 "./src/stun/addrs-bsd.c", 80 "./src/stun/addrs-bsd.h", 81 "./src/stun/addrs-netlink.c", 82 "./src/stun/addrs-netlink.h", 83 "./src/stun/addrs-win32.c", 84 "./src/stun/addrs-win32.h", 85 "./src/stun/nr_socket_turn.c", 86 "./src/stun/nr_socket_turn.h", 87 "./src/stun/nr_socket_buffered_stun.c", 88 "./src/stun/nr_socket_buffered_stun.h", 89 "./src/stun/stun.h", 90 "./src/stun/stun_build.c", 91 "./src/stun/stun_build.h", 92 "./src/stun/stun_client_ctx.c", 93 "./src/stun/stun_client_ctx.h", 94 "./src/stun/stun_codec.c", 95 "./src/stun/stun_codec.h", 96 "./src/stun/stun_hint.c", 97 "./src/stun/stun_hint.h", 98 "./src/stun/stun_msg.c", 99 "./src/stun/stun_msg.h", 100 "./src/stun/stun_proc.c", 101 "./src/stun/stun_proc.h", 102 "./src/stun/stun_reg.h", 103 "./src/stun/stun_server_ctx.c", 104 "./src/stun/stun_server_ctx.h", 105 "./src/stun/stun_util.c", 106 "./src/stun/stun_util.h", 107 "./src/stun/turn_client_ctx.c", 108 "./src/stun/turn_client_ctx.h", 109 110 # Util 111 "./src/util/ice_util.c", 112 "./src/util/ice_util.h", 113 114 115 ], 116 117 'defines' : [ 118 'SANITY_CHECKS', 119 'USE_TURN', 120 'USE_ICE', 121 'USE_RFC_3489_BACKWARDS_COMPATIBLE', 122 'USE_STUND_0_96', 123 'USE_STUN_PEDANTIC', 124 'USE_TURN', 125 'NR_SOCKET_IS_VOID_PTR', 126 'restrict=', 127 'R_PLATFORM_INT_TYPES=<stdint.h>', 128 'R_DEFINED_INT2=int16_t', 129 'R_DEFINED_UINT2=uint16_t', 130 'R_DEFINED_INT4=int32_t', 131 'R_DEFINED_UINT4=uint32_t', 132 'R_DEFINED_INT8=int64_t', 133 'R_DEFINED_UINT8=uint64_t', 134 ], 135 136 'conditions' : [ 137 ## Mac and BSDs 138 [ 'OS == "mac" or OS == "ios"', { 139 'defines' : [ 140 'DARWIN', 141 ], 142 }], 143 [ 'os_bsd == 1', { 144 'defines' : [ 145 'BSD', 146 ], 147 }], 148 [ 'OS == "mac" or OS == "ios" or os_bsd == 1', { 149 'cflags_mozilla': [ 150 '-Wall', 151 '-Wno-parentheses', 152 '-Wno-strict-prototypes', 153 '-Wmissing-prototypes', 154 '-Wno-format', 155 '-Wno-format-security', 156 ], 157 'defines' : [ 158 'HAVE_LIBM=1', 159 'HAVE_STRDUP=1', 160 'HAVE_STRLCPY=1', 161 'HAVE_SYS_TIME_H=1', 162 'HAVE_VFPRINTF=1', 163 'NEW_STDIO' 164 'RETSIGTYPE=void', 165 'TIME_WITH_SYS_TIME_H=1', 166 '__UNUSED__=__attribute__((unused))', 167 ], 168 169 'include_dirs': [ 170 '../nrappkit/src/port/darwin/include' 171 ], 172 173 'sources': [ 174 ], 175 }], 176 177 ## Win 178 [ 'OS == "win"', { 179 'defines' : [ 180 'WIN32', 181 '_WINSOCK_DEPRECATED_NO_WARNINGS', 182 'USE_ICE', 183 'USE_TURN', 184 'USE_RFC_3489_BACKWARDS_COMPATIBLE', 185 'USE_STUND_0_96', 186 'USE_STUN_PEDANTIC', 187 '_CRT_SECURE_NO_WARNINGS', 188 '__UNUSED__=', 189 'HAVE_STRDUP', 190 'NO_REG_RPC' 191 ], 192 193 'include_dirs': [ 194 '../nrappkit/src/port/win32/include' 195 ], 196 }], 197 198 # Windows, clang-cl build 199 [ 'clang_cl == 1', { 200 'cflags_mozilla': [ 201 '-Xclang', 202 '-Wall', 203 '-Xclang', 204 '-Wno-parentheses', 205 '-Wno-pointer-sign', 206 '-Wno-strict-prototypes', 207 '-Xclang', 208 '-Wno-unused-function', 209 '-Wmissing-prototypes', 210 '-Wno-format', 211 '-Wno-format-security', 212 ], 213 }], 214 215 ## Linux/Android 216 [ '(OS == "linux") or (OS == "android")', { 217 'cflags_mozilla': [ 218 '-Wall', 219 '-Wno-parentheses', 220 '-Wno-strict-prototypes', 221 '-Wmissing-prototypes', 222 '-Wno-format', 223 '-Wno-format-security', 224 ], 225 'defines' : [ 226 'LINUX', 227 'HAVE_LIBM=1', 228 'HAVE_STRDUP=1', 229 'HAVE_STRLCPY=1', 230 'HAVE_SYS_TIME_H=1', 231 'HAVE_VFPRINTF=1', 232 'NEW_STDIO' 233 'RETSIGTYPE=void', 234 'TIME_WITH_SYS_TIME_H=1', 235 '__UNUSED__=__attribute__((unused))', 236 ], 237 238 'include_dirs': [ 239 '../nrappkit/src/port/linux/include' 240 ], 241 242 'sources': [ 243 ], 244 }], 245 ['have_ethtool_cmd_speed_hi==0', { 246 'defines': [ 247 "DONT_HAVE_ETHTOOL_SPEED_HI", 248 ] 249 }], 250 # libFuzzer instrumentation is not compatible with TSan. 251 # See also the comment in build/moz.configure/toolchain.configure. 252 ['(libfuzzer == 1) and (tsan == 0) and (libfuzzer_fuzzer_no_link_flag == 1)', { 253 'cflags_mozilla': [ 254 '-fsanitize=fuzzer-no-link' 255 ], 256 }], 257 ['(libfuzzer == 1) and (tsan == 0) and (libfuzzer_fuzzer_no_link_flag == 0)', { 258 'cflags_mozilla': [ 259 '-fsanitize-coverage=trace-pc-guard,trace-cmp' 260 ], 261 }], 262 ], 263 }] 264 } 265