Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / build / sanitizer_options.gyp
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
9 # This is a similar target to the one in Chromium's base.gyp. It's needed to get
10 # the same sanitizer settings as Chromium uses (i.e. ASan, LSan, TSan...).
11 {
12   'targets': [
13     {
14       'target_name': 'sanitizer_options',
15       'type': 'static_library',
16       'toolsets': ['host', 'target'],
17       'variables': {
18          # Every target is going to depend on sanitizer_options, so allow
19          # this one to depend on itself.
20          'prune_self_dependency': 1,
21          # Do not let 'none' targets depend on this one, they don't need to.
22          'link_dependency': 1,
23        },
24       'sources': [
25         '<(DEPTH)/tools/sanitizer_options/sanitizer_options.cc',
26       ],
27       'include_dirs': [
28         '<(DEPTH)',
29       ],
30       # Some targets may want to opt-out from ASan, TSan and MSan and link
31       # without the corresponding runtime libraries. We drop the libc++
32       # dependency and omit the compiler flags to avoid bringing instrumented
33       # code to those targets.
34       'conditions': [
35         ['use_custom_libcxx==1', {
36           'dependencies!': [
37             '<(DEPTH)/third_party/libc++/libc++.gyp:libcxx_proxy',
38           ],
39         }],
40         ['tsan==1', {
41           'sources': [
42             'tsan_suppressions.cc',
43           ],
44         }],
45       ],
46       'cflags!': [
47         '-fsanitize=address',
48         '-fsanitize=thread',
49         '-fsanitize=memory',
50         '-fsanitize-memory-track-origins',
51       ],
52       'direct_dependent_settings': {
53         'ldflags': [
54           '-Wl,-u_sanitizer_options_link_helper',
55         ],
56       },
57     },
58   ],  # targets
59 }