summaryrefslogtreecommitdiffstats
path: root/testing/gtest_nacl.gyp
blob: d1c0ce0fb40387f8138f57e1e4ce0dad3a1fbeb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'variables': {
    'chromium_code': 1,
  },
  'includes': [
    '../build/common_untrusted.gypi',
    'gtest.gypi',
  ],
  'conditions': [
    ['disable_nacl==0 and disable_nacl_untrusted==0', {
      'targets': [
        {
          'target_name': 'gtest_nacl',
          'type': 'none',
          'variables': {
            'nlib_target': 'libgtest_nacl.a',
            'build_glibc': 0,
            'build_newlib': 0,
            'build_irt': 0,
            'build_pnacl_newlib': 1,
            'build_nonsfi_helper': 1,
          },
          'sources': [
            '<@(gtest_sources)',
          ],
          'include_dirs': [
            'gtest',
            'gtest/include',
          ],
          'defines': [
            # In order to allow regex matches in gtest to be shared between
            # Windows and other systems, we tell gtest to always use it's
            # internal engine.
            'GTEST_HAS_POSIX_RE=0',
            'GTEST_LANG_CXX11=0',
            # gtest isn't able to figure out when RTTI is disabled for gcc
            # versions older than 4.3.2, and assumes it's enabled.  Our Mac
            # and Linux builds disable RTTI, and cannot guarantee that the
            # compiler will be 4.3.2. or newer.  The Mac, for example, uses
            # 4.2.1 as that is the latest available on that platform.  gtest
            # must be instructed that RTTI is disabled here, and for any
            # direct dependents that might include gtest headers.
            'GTEST_HAS_RTTI=0',
          ],
          'all_dependent_settings': {
            'defines': [
              'GTEST_HAS_POSIX_RE=0',
              'GTEST_LANG_CXX11=0',
            ],
            'link_flags': [
              '-lgtest_nacl',
            ],
          },
          'direct_dependent_settings': {
            'defines': [
              'UNIT_TEST',
              'GTEST_HAS_RTTI=0',
            ],
            'include_dirs': [
              'gtest/include',  # So that gtest headers can find themselves.
            ],
          },
        },
        {
          'target_name': 'gtest_main_nacl',
          'type': 'none',
          'variables': {
            'nlib_target': 'libgtest_main_nacl.a',
            'build_glibc': 0,
            'build_newlib': 0,
            'build_irt': 0,
            'build_pnacl_newlib': 1,
            'build_nonsfi_helper': 1,
          },
          'dependencies': [
            'gtest_nacl',
          ],
          'sources': [
            'gtest/src/gtest_main.cc',
          ],
          'all_dependent_settings': {
            'link_flags': [
              '-lgtest_main_nacl',
            ],
          },
        },
      ],
    }],
  ],
}