summaryrefslogtreecommitdiff
path: root/peripheral/libmraa/src/javascript/binding.gyp.cmake
blob: 4675e269a7f184993d5aaa5977b1d0c8cdaeaadc (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
{
  'targets': [
    {
      'target_name': 'mraa',
      'sources': [
@mraa_LIB_SRCS_GYP@
'src/version.c',
'src/mraajsJAVASCRIPT_wrap.cxx' ],
      'include_dirs': [
@mraa_LIB_INCLUDE_DIRS_GYP@
                      ],
      'variables': {
          "v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g' | cut -c 1-5)",
          "arch%": "<!(node -e 'console.log(process.arch)')"
      },
      'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
      'cflags!': [ '-fno-exceptions' ],
      'conditions' : [
          [ 'arch=="x64"',
            { 'defines' : [ 'X86PLAT=ON' ], },
          ],
          [ 'arch=="ia32"',
            { 'defines' : [ 'X86PLAT=ON'], },
          ],
          [ 'arch=="arm"',
            { 'defines' : [ 'ARMPLAT=ON'], },
          ],
      ],
      'defines' : [ 'SWIG',
                    'SWIGJAVASCRIPT',
                    'BUILDING_NODE_EXTENSION=1',
                    'SWIG_V8_VERSION=0x0<(v8_version)',
                    'V8_VERSION=0x0<(v8_version)'
      ]
    }
  ]
}