Add support for android build
Using NPM, this module can be cross-compiled for Android using NDK. But, when compiling for Android, we need to add glob.c to source files (as in Android.mk). Also, re-arranged the layout in binding.gyp for better readability. Signed-off-by: Robert Chiras <robert.chiras@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
c1465bd694
commit
cdfdd2b9e3
@@ -3,11 +3,12 @@
|
|||||||
{
|
{
|
||||||
'target_name': 'mraa',
|
'target_name': 'mraa',
|
||||||
'sources': [
|
'sources': [
|
||||||
@mraa_LIB_SRCS_GYP@
|
@mraa_LIB_SRCS_GYP@
|
||||||
'src/version.c',
|
'src/version.c',
|
||||||
'src/mraajsJAVASCRIPT_wrap.cxx' ],
|
'src/mraajsJAVASCRIPT_wrap.cxx'
|
||||||
|
],
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
@mraa_LIB_INCLUDE_DIRS_GYP@
|
@mraa_LIB_INCLUDE_DIRS_GYP@
|
||||||
],
|
],
|
||||||
'variables': {
|
'variables': {
|
||||||
"v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g' | cut -c 1-5)",
|
"v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g' | cut -c 1-5)",
|
||||||
@@ -16,17 +17,19 @@
|
|||||||
'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
|
'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
|
||||||
'cflags!': [ '-fno-exceptions' ],
|
'cflags!': [ '-fno-exceptions' ],
|
||||||
'conditions' : [
|
'conditions' : [
|
||||||
[ 'arch=="x64"',
|
['OS=="android"', {
|
||||||
{ 'defines' : [ 'X86PLAT=ON' ], },
|
'sources' : [ 'src/glob/glob.c' ],
|
||||||
|
'include_dirs' : [ 'src/glob' ],
|
||||||
|
}],
|
||||||
|
[ 'arch=="x64" or arch=="ia32"', {
|
||||||
|
'defines' : [ 'X86PLAT=ON' ],
|
||||||
|
}],
|
||||||
|
[ 'arch=="arm"', {
|
||||||
|
'defines' : [ 'ARMPLAT=ON'],
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
[ 'arch=="ia32"',
|
'defines' : [
|
||||||
{ 'defines' : [ 'X86PLAT=ON'], },
|
'SWIG',
|
||||||
],
|
|
||||||
[ 'arch=="arm"',
|
|
||||||
{ 'defines' : [ 'ARMPLAT=ON'], },
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'defines' : [ 'SWIG',
|
|
||||||
'SWIGJAVASCRIPT',
|
'SWIGJAVASCRIPT',
|
||||||
'FIRMATA=ON',
|
'FIRMATA=ON',
|
||||||
'ONEWIRE=ON',
|
'ONEWIRE=ON',
|
||||||
|
|||||||
Reference in New Issue
Block a user