binding.gyp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. "variables": {
  3. "os_linux_compiler%": "gcc",
  4. "enable_v8%": "true",
  5. "enable_pointer_compression%": "false",
  6. "build_v8_with_gn": "false"
  7. },
  8. "conditions": [
  9. ['OS=="win"', {
  10. "variables": {
  11. "enable_v8%": "<!(echo %ENABLE_V8_FUNCTIONS%)",
  12. }
  13. }],
  14. ['OS!="win"', {
  15. "variables": {
  16. "enable_v8%": "<!(echo $ENABLE_V8_FUNCTIONS)",
  17. }
  18. }]
  19. ],
  20. "targets": [
  21. {
  22. "target_name": "extract",
  23. "sources": [
  24. "src/extract.cpp",
  25. ],
  26. "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
  27. "conditions": [
  28. ["OS=='linux'", {
  29. "variables": {
  30. "gcc_version" : "<!(<(os_linux_compiler) -dumpversion | cut -d '.' -f 1)",
  31. },
  32. "cflags_cc": [
  33. "-fPIC",
  34. "-fvisibility=hidden",
  35. "-fvisibility-inlines-hidden",
  36. ],
  37. "conditions": [
  38. ["gcc_version>=7", {
  39. "cflags": [
  40. "-Wimplicit-fallthrough=2",
  41. ],
  42. }],
  43. ],
  44. "ldflags": [
  45. "-fPIC",
  46. "-fvisibility=hidden"
  47. ],
  48. "cflags": [
  49. "-fPIC",
  50. "-fvisibility=hidden",
  51. "-O3"
  52. ],
  53. }],
  54. ["enable_v8!='false'", {
  55. "defines": ["ENABLE_V8_API=1"]
  56. }],
  57. ["enable_pointer_compression=='true'", {
  58. "defines": ["V8_COMPRESS_POINTERS", "V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE"],
  59. }],
  60. ],
  61. }
  62. ]
  63. }