summaryrefslogtreecommitdiff
path: root/binding.gyp
blob: acd812926054b0e15338a11cfe5aa58090d01f8e (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
{
  'variables': {
    'loop_lib': 'uv',
    'headless_lib': 'glx',
  },
  'conditions': [
    ['OS == "mac"', {
      'variables': {
        'headless_lib': 'cgl',
      }
    }],
  ],
  'includes': [
    'mbgl.gypi',
  ],
  'targets': [
    {
      'target_name': '<(module_name)',
      'dependencies': [
        'core',
      ],

      'include_dirs': [
        '<(node_root_dir)/include/node',
        "<!(node -e \"require('nan')\")",
        'include',
        'src', # TODO: eliminate
      ],

      'sources': [
        'platform/node/src/node_mapbox_gl_native.cpp',
        'platform/node/src/node_log.hpp',
        'platform/node/src/node_log.cpp',
        'platform/node/src/node_map.hpp',
        'platform/node/src/node_map.cpp',
        'platform/node/src/node_request.hpp',
        'platform/node/src/node_request.cpp',
        'platform/node/src/node_feature.hpp',
        'platform/node/src/node_feature.cpp',
        'platform/node/src/util/async_queue.hpp',
      ],

      'conditions': [
        ['OS == "mac"', {
          'sources': [
            'platform/darwin/src/log_nslog.mm',
            'platform/darwin/src/string_nsstring.mm',
            'platform/darwin/src/image.mm',
            'platform/darwin/src/nsthread.mm',
          ]
        }, {
          'sources': [
            'platform/default/log_stderr.cpp',
            'platform/default/string_stdlib.cpp',
            'platform/default/thread.cpp',
            'platform/default/image.cpp',
            'platform/default/webp_reader.cpp',
            'platform/default/png_reader.cpp',
            'platform/default/jpeg_reader.cpp',
          ],

          'cflags_cc': [
            '<@(boost_cflags)',
            '<@(nunicode_cflags)',
            '<@(webp_cflags)',
            '<@(libpng_cflags)',
            '<@(libjpeg-turbo_cflags)',
          ],

          'link_settings': {
            'libraries': [
              '<@(nunicode_static_libs)',
              '<@(nunicode_ldflags)',
              '<@(webp_static_libs)',
              '<@(webp_ldflags)',
              '<@(libpng_static_libs)',
              '<@(libpng_ldflags)',
              '<@(libjpeg-turbo_static_libs)',
              '<@(libjpeg-turbo_ldflags)',
            ],
          },
        }]
      ],

      'ldflags': [
        '-Wl,-z,now',
      ],

      'xcode_settings': {
        'OTHER_LDFLAGS':[
          '-Wl,-bind_at_load'
        ],
      },
    },
    {
      'target_name': 'action_after_build',
      'type': 'none',
      'dependencies': [ '<(module_name)' ],
      'copies': [
        {
          'files': [ '<(PRODUCT_DIR)/<(module_name).node' ],
          'destination': '<(module_path)'
        }
      ]
    }
  ]
}