summaryrefslogtreecommitdiff
path: root/platform/qt/platform.gyp
blob: 29901544c9a8a9f909f6b4888fca3b4c32ec3377 (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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
{
  'variables': {
    'loop_lib': 'qt',
    'conditions': [
      ['OS == "mac"', {
        'headless_lib': 'cgl',
      }, {
        'headless_lib': 'glx',
      }]
    ],
    'qtlibversion': '1.0.0',
  },
  'conditions': [
    ['<(qt_version_major) == 5', {
      'includes': [ 'qmlapp/qquickmapboxgl.gypi' ],
    }],
  ],
  'includes': [
    'app/qmapboxgl.gypi',
    '../../mbgl.gypi',
    '../../test/test.gypi',
  ],
  'targets': [
    {
      'target_name': 'platform-lib',
      'product_name': 'mbgl-platform-qt',
      'type': 'static_library',
      'standalone_static_library': 1,
      'hard_dependency': 1,

      'dependencies': [
        'core',
      ],

      'includes': [
        'qt.gypi',
      ],

      'sources': [
        '../default/asset_file_source.cpp',
        '../default/default_file_source.cpp',
        '../default/jpeg_reader.cpp',
        '../default/log_stderr.cpp',
        '../default/mbgl/storage/offline.cpp',
        '../default/mbgl/storage/offline_database.cpp',
        '../default/mbgl/storage/offline_download.cpp',
        '../default/online_file_source.cpp',
        '../default/sqlite3.cpp',
        '../default/string_stdlib.cpp',
        '../default/thread.cpp',
        '../default/webp_reader.cpp',
        'include/qmapbox.hpp',
        'include/qmapboxgl.hpp',
        'include/qquickmapboxgl.hpp',
        'qmapbox.qrc',
        'src/async_task.cpp',
        'src/async_task_impl.hpp',
        'src/http_file_source.cpp',
        'src/http_file_source.hpp',
        'src/http_request.cpp',
        'src/http_request.hpp',
        'src/image.cpp',
        'src/qmapbox.cpp',
        'src/qmapboxgl.cpp',
        'src/qmapboxgl_p.hpp',
        'src/qquickmapboxgl.cpp',
        'src/qquickmapboxglrenderer.cpp',
        'src/qquickmapboxglrenderer.hpp',
        'src/run_loop.cpp',
        'src/run_loop_impl.hpp',
        'src/timer.cpp',
        'src/timer_impl.hpp',
      ],

      'variables': {
        'cflags': [
          '<@(boost_cflags)',
          '<@(libjpeg-turbo_cflags)',
          '<@(nunicode_cflags)',
          '<@(opengl_cflags)',
          '<@(qt_core_cflags)',
          '<@(qt_gui_cflags)',
          '<@(qt_network_cflags)',
          '<@(rapidjson_cflags)',
          '<@(sqlite_cflags)',
          '<@(variant_cflags)',
          '<@(webp_cflags)',
          '-fPIC',
        ],
        'ldflags': [
          '<@(libjpeg-turbo_ldflags)',
          '<@(nunicode_ldflags)',
          '<@(opengl_ldflags)',
          '<@(qt_core_ldflags)',
          '<@(qt_gui_ldflags)',
          '<@(qt_network_ldflags)',
          '<@(sqlite_ldflags)',
          '<@(webp_ldflags)',
          '<@(zlib_ldflags)',
        ],
        'libraries': [
          '<@(nunicode_static_libs)',
          '<@(sqlite_static_libs)',
          '<@(libjpeg-turbo_static_libs)',
          '<@(webp_static_libs)',
          '<@(zlib_static_libs)',
        ],
      },

      'include_dirs': [
        'include',
        '../default',
        '../../include',
        '../../src', # TODO: eliminate
      ],

      'conditions': [
        ['<(qt_version_major) == 5', {
          'variables': {
            'cflags': [
              '<@(qt_quick_cflags)',
            ],
            'ldflags': [
              '<@(qt_quick_ldflags)',
            ],
          },
        }, {
          'sources/': [ [ 'exclude', 'qquick*' ] ],
        }],
        ['OS == "mac"', {
          'xcode_settings': {
            'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags)' ],
          }
        }, {
          'cflags_cc': [ '<@(cflags)' ],
        }]
      ],

      'link_settings': {
        'conditions': [
          ['OS == "mac"', {
            'libraries': [ '<@(libraries)' ],
            'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] }
          }, {
            'libraries': [ '<@(libraries)', '<@(ldflags)' ],
          }]
        ],
      },
    },
    {
      'target_name': 'qt-lib',
      'product_name': 'qmapboxgl',
      'type': 'shared_library',
      'product_extension': 'so.<(qtlibversion)',

      'includes': [
        'qt.gypi',
      ],

      'dependencies': [
        'platform-lib',
      ],

      'link_settings': {
        'conditions': [
          ['OS == "mac"', {
            'xcode_settings': {
              'OTHER_LDFLAGS': [ '-all_load' ],
              'LD_DYLIB_INSTALL_NAME': '@executable_path/libqmapboxgl.so.<(qtlibversion)',
            }
          }]
        ],
      },
    },
    {
      'target_name': 'test',
      'type': 'executable',

      'dependencies': [
        'test-lib',
        'platform-lib',
      ],

      'sources': [
        '../../test/src/main.cpp',
      ],
    },
  ],
}