summaryrefslogtreecommitdiff
path: root/test/test.gypi
blob: 6c2e8ad493d072c99556b9433750e742bd51a2bf (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
  'targets': [
    {
      'target_name': 'test-lib',
      'type': 'static_library',
      'standalone_static_library': 1,
      'hard_dependency': 1,

      'include_dirs': [
        '../include',
        '../src',
        '../platform/default',
        'include',
        'src',
      ],

      'sources': [
        'util/assert.cpp',
        'util/async_task.cpp',
        'util/clip_ids.cpp',
        'util/geo.cpp',
        'util/image.cpp',
        'util/mapbox.cpp',
        'util/math.cpp',
        'util/merge_lines.cpp',
        'util/run_loop.cpp',
        'util/text_conversions.cpp',
        'util/thread.cpp',
        'util/thread_local.cpp',
        'util/tile_cover.cpp',
        'util/timer.cpp',
        'util/token.cpp',
        'util/work_queue.cpp',

        'api/annotations.cpp',
        'api/api_misuse.cpp',
        'api/repeated_render.cpp',
        'api/render_missing.cpp',
        'api/set_style.cpp',
        'api/custom_layer.cpp',

        'geometry/binpack.cpp',

        'map/map.cpp',
        'map/tile.cpp',
        'map/transform.cpp',

        'storage/offline.cpp',
        'storage/offline_database.cpp',
        'storage/offline_download.cpp',
        'storage/asset_file_source.cpp',
        'storage/default_file_source.cpp',
        'storage/http_file_source.cpp',
        'storage/online_file_source.cpp',
        'storage/headers.cpp',
        'storage/resource.cpp',

        'style/glyph_store.cpp',
        'style/source.cpp',
        'style/style.cpp',
        'style/style_layer.cpp',
        'style/comparisons.cpp',
        'style/functions.cpp',
        'style/style_parser.cpp',
        'style/variant.cpp',

        'sprite/sprite_atlas.cpp',
        'sprite/sprite_image.cpp',
        'sprite/sprite_parser.cpp',
        'sprite/sprite_store.cpp',

        'src/mbgl/test/stub_file_source.hpp',
        'src/mbgl/test/stub_file_source.cpp',
        'src/mbgl/test/mock_view.hpp',
        'src/mbgl/test/util.hpp',
        'src/mbgl/test/util.cpp',
        'src/mbgl/test/fixture_log_observer.hpp',
        'src/mbgl/test/fixture_log_observer.cpp',
        'src/mbgl/test/test.cpp'
      ],

      'variables': {
        'cflags_cc': [
          '<@(gtest_cflags)',
          '<@(opengl_cflags)',
          '<@(boost_cflags)',
          '<@(sqlite_cflags)',
          '<@(geojsonvt_cflags)',
          '<@(rapidjson_cflags)',
          '<@(pixelmatch_cflags)',
          '<@(variant_cflags)',
        ],
        'ldflags': [
          '<@(gtest_ldflags)',
          '<@(sqlite_ldflags)',
        ],
        'libraries': [
          '<@(gtest_static_libs)',
          '<@(sqlite_static_libs)',
          '<@(geojsonvt_static_libs)',
        ],
      },

      'conditions': [
        ['OS == "mac"', {
          'xcode_settings': {
            'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ],
          },
        }, {
         'cflags_cc': [ '<@(cflags_cc)' ],
        }],
      ],
      'link_settings': {
        'conditions': [
          ['OS == "mac"', {
            'libraries': [ '<@(libraries)' ],
            'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] }
          }, {
            'libraries': [ '<@(libraries)', '<@(ldflags)' ],
          }]
        ],
      },

      'direct_dependent_settings': {
        'include_dirs': [
          'include',
        ],

        # Force the linker to include all the objects from the lib-test archive. Otherwise they'd
        # be discarded because there are no undefined symbols to pull them in, and the resulting
        # executable would run zero tests.

        'conditions': [
          ['OS == "mac"', {
            'xcode_settings': {
              'OTHER_LDFLAGS': [
                '-Wl,-force_load,<(PRODUCT_DIR)/libtest-lib.a',
              ],
            }
          }, {
            'link_settings': {
              'ldflags': [
                '-Wl,-whole-archive <(PRODUCT_DIR)/libtest-lib.a -Wl,-no-whole-archive',
              ],
            },
          }],
        ],
      },
    },
  ]
}