1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6  'variables': {
7    'chromium_code': 1,
8  },
9  'includes': [
10    '../build/common_untrusted.gypi',
11    'gtest.gypi',
12  ],
13  'conditions': [
14    ['disable_nacl==0 and disable_nacl_untrusted==0', {
15      'targets': [
16        {
17          'target_name': 'gtest_nacl',
18          'type': 'none',
19          'variables': {
20            'nlib_target': 'libgtest_nacl.a',
21            'build_glibc': 0,
22            'build_newlib': 1,
23            'build_pnacl_newlib': 0,
24          },
25          'sources': [
26            '<@(gtest_sources)',
27          ],
28          'include_dirs': [
29            'gtest',
30            'gtest/include',
31          ],
32          'defines': [
33            # In order to allow regex matches in gtest to be shared between
34            # Windows and other systems, we tell gtest to always use it's
35            # internal engine.
36            'GTEST_HAS_POSIX_RE=0',
37            'GTEST_LANG_CXX11=0',
38            # gtest isn't able to figure out when RTTI is disabled for gcc
39            # versions older than 4.3.2, and assumes it's enabled.  Our Mac
40            # and Linux builds disable RTTI, and cannot guarantee that the
41            # compiler will be 4.3.2. or newer.  The Mac, for example, uses
42            # 4.2.1 as that is the latest available on that platform.  gtest
43            # must be instructed that RTTI is disabled here, and for any
44            # direct dependents that might include gtest headers.
45            'GTEST_HAS_RTTI=0',
46          ],
47          'all_dependent_settings': {
48            'defines': [
49              'GTEST_HAS_POSIX_RE=0',
50              'GTEST_LANG_CXX11=0',
51            ],
52            'link_flags': [
53              '-lgtest_nacl',
54            ],
55          },
56          'direct_dependent_settings': {
57            'defines': [
58              'UNIT_TEST',
59              'GTEST_HAS_RTTI=0',
60            ],
61            'include_dirs': [
62              'gtest/include',  # So that gtest headers can find themselves.
63            ],
64          },
65        },
66        {
67          'target_name': 'gtest_main_nacl',
68          'type': 'none',
69          'variables': {
70            'nlib_target': 'libgtest_main_nacl.a',
71            'build_glibc': 0,
72            'build_newlib': 1,
73            'build_pnacl_newlib': 0,
74          },
75          'dependencies': [
76            'gtest_nacl',
77          ],
78          'sources': [
79            'gtest/src/gtest_main.cc',
80          ],
81          'all_dependent_settings': {
82            'link_flags': [
83              '-lgtest_main_nacl',
84            ],
85          },
86        },
87      ],
88    }],
89  ],
90}
91