sqlite3.gyp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. # ===
  2. # This configuration defines options specific to compiling SQLite3 itself.
  3. # Compile-time options are loaded by the auto-generated file "defines.gypi".
  4. # The --sqlite3 option can be provided to use a custom amalgamation instead.
  5. # ===
  6. {
  7. 'includes': ['common.gypi'],
  8. 'targets': [
  9. {
  10. 'target_name': 'locate_sqlite3',
  11. 'type': 'none',
  12. 'hard_dependency': 1,
  13. 'conditions': [
  14. ['sqlite3 == ""', {
  15. 'actions': [{
  16. 'action_name': 'copy_builtin_sqlite3',
  17. 'inputs': [
  18. 'sqlite3/sqlite3.c',
  19. 'sqlite3/sqlite3.h',
  20. 'sqlite3/sqlite3ext.h',
  21. ],
  22. 'outputs': [
  23. '<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c',
  24. '<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
  25. '<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3ext.h',
  26. ],
  27. 'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', ''],
  28. }],
  29. }, {
  30. 'actions': [{
  31. 'action_name': 'copy_custom_sqlite3',
  32. 'inputs': [
  33. '<(sqlite3)/sqlite3.c',
  34. '<(sqlite3)/sqlite3.h',
  35. ],
  36. 'outputs': [
  37. '<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c',
  38. '<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.h',
  39. ],
  40. 'action': ['node', 'copy.js', '<(SHARED_INTERMEDIATE_DIR)/sqlite3', '<(sqlite3)'],
  41. }],
  42. }],
  43. ],
  44. },
  45. {
  46. 'target_name': 'sqlite3',
  47. 'type': 'static_library',
  48. 'dependencies': ['locate_sqlite3'],
  49. 'sources': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/sqlite3.c'],
  50. 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/'],
  51. 'direct_dependent_settings': {
  52. 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/sqlite3/'],
  53. },
  54. 'cflags': ['-std=c99', '-w'],
  55. 'xcode_settings': {
  56. 'OTHER_CFLAGS': ['-std=c99'],
  57. 'WARNING_CFLAGS': ['-w'],
  58. },
  59. 'conditions': [
  60. ['sqlite3 == ""', {
  61. 'includes': ['defines.gypi'],
  62. }, {
  63. 'defines': [
  64. # This is currently required by better-sqlite3.
  65. 'SQLITE_ENABLE_COLUMN_METADATA',
  66. ],
  67. }]
  68. ],
  69. 'configurations': {
  70. 'Debug': {
  71. 'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': 1 } }, # static debug
  72. },
  73. 'Release': {
  74. 'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': 0 } }, # static release
  75. },
  76. },
  77. },
  78. ],
  79. }