binding.gyp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {
  2. 'variables': {
  3. 'openssl_fips': ''
  4. },
  5. 'targets': [{
  6. 'target_name': 'bindings',
  7. 'sources': [
  8. 'src/serialport.cpp'
  9. ],
  10. 'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")"],
  11. 'cflags!': [ '-fno-exceptions' ],
  12. 'cflags_cc!': [ '-fno-exceptions' ],
  13. "defines": ["NAPI_CPP_EXCEPTIONS"],
  14. 'conditions': [
  15. ['OS=="win"',
  16. {
  17. 'defines': ['CHECK_NODE_MODULE_VERSION'],
  18. 'sources': [
  19. 'src/serialport_win.cpp'
  20. ],
  21. 'msvs_settings': {
  22. 'VCCLCompilerTool': {
  23. 'ExceptionHandling': '1',
  24. 'DisableSpecificWarnings': [ '4530', '4506' ],
  25. }
  26. }
  27. }
  28. ],
  29. ['OS=="mac"',
  30. {
  31. 'sources': [
  32. 'src/serialport_unix.cpp',
  33. 'src/poller.cpp',
  34. 'src/darwin_list.cpp'
  35. ],
  36. 'xcode_settings': {
  37. 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
  38. 'MACOSX_DEPLOYMENT_TARGET': '10.9',
  39. 'OTHER_CFLAGS': [
  40. '-arch x86_64',
  41. '-arch arm64'
  42. ],
  43. 'OTHER_LDFLAGS': [
  44. '-framework CoreFoundation',
  45. '-framework IOKit',
  46. '-arch x86_64',
  47. '-arch arm64'
  48. ]
  49. }
  50. }
  51. ],
  52. ['OS=="linux"',
  53. {
  54. 'sources': [
  55. 'src/serialport_unix.cpp',
  56. 'src/poller.cpp',
  57. 'src/serialport_linux.cpp'
  58. ]
  59. }
  60. ],
  61. ['OS=="android"',
  62. {
  63. 'sources': [
  64. 'src/serialport_unix.cpp',
  65. 'src/poller.cpp',
  66. 'src/serialport_linux.cpp'
  67. ]
  68. }
  69. ],
  70. ['OS!="win"',
  71. {
  72. 'sources': [
  73. 'src/serialport_unix.cpp',
  74. 'src/poller.cpp'
  75. ]
  76. }
  77. ]
  78. ]
  79. }],
  80. }