sqlite3.gyp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {
  2. 'includes': [ 'common-sqlite.gypi' ],
  3. 'variables': {
  4. 'sqlite_magic%': '',
  5. },
  6. 'target_defaults': {
  7. 'default_configuration': 'Release',
  8. 'cflags':[
  9. '-std=c99'
  10. ],
  11. 'configurations': {
  12. 'Debug': {
  13. 'defines': [ 'DEBUG', '_DEBUG' ],
  14. 'msvs_settings': {
  15. 'VCCLCompilerTool': {
  16. 'RuntimeLibrary': 1, # static debug
  17. },
  18. },
  19. },
  20. 'Release': {
  21. 'defines': [ 'NDEBUG' ],
  22. 'msvs_settings': {
  23. 'VCCLCompilerTool': {
  24. 'RuntimeLibrary': 0, # static release
  25. },
  26. },
  27. }
  28. },
  29. 'msvs_settings': {
  30. 'VCCLCompilerTool': {
  31. },
  32. 'VCLibrarianTool': {
  33. },
  34. 'VCLinkerTool': {
  35. 'GenerateDebugInformation': 'true',
  36. },
  37. },
  38. 'conditions': [
  39. ['OS == "win"', {
  40. 'defines': [
  41. 'WIN32'
  42. ],
  43. }]
  44. ],
  45. },
  46. 'targets': [
  47. {
  48. 'target_name': 'action_before_build',
  49. 'type': 'none',
  50. 'hard_dependency': 1,
  51. 'actions': [
  52. {
  53. 'action_name': 'unpack_sqlite_dep',
  54. 'inputs': [
  55. './sqlite-autoconf-<@(sqlite_version).tar.gz'
  56. ],
  57. 'outputs': [
  58. '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
  59. ],
  60. 'action': ['node','./extract.js','./sqlite-autoconf-<@(sqlite_version).tar.gz','<(SHARED_INTERMEDIATE_DIR)']
  61. }
  62. ],
  63. 'direct_dependent_settings': {
  64. 'include_dirs': [
  65. '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/',
  66. ]
  67. },
  68. },
  69. {
  70. 'target_name': 'sqlite3',
  71. 'type': 'static_library',
  72. 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ],
  73. 'dependencies': [
  74. 'action_before_build'
  75. ],
  76. 'sources': [
  77. '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/sqlite3.c'
  78. ],
  79. 'direct_dependent_settings': {
  80. 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/sqlite-autoconf-<@(sqlite_version)/' ],
  81. 'defines': [
  82. 'SQLITE_THREADSAFE=1',
  83. 'HAVE_USLEEP=1',
  84. 'SQLITE_ENABLE_FTS3',
  85. 'SQLITE_ENABLE_FTS4',
  86. 'SQLITE_ENABLE_FTS5',
  87. 'SQLITE_ENABLE_RTREE',
  88. 'SQLITE_ENABLE_DBSTAT_VTAB=1',
  89. 'SQLITE_ENABLE_MATH_FUNCTIONS'
  90. ],
  91. },
  92. 'cflags_cc': [
  93. '-Wno-unused-value'
  94. ],
  95. 'defines': [
  96. '_REENTRANT=1',
  97. 'SQLITE_THREADSAFE=1',
  98. 'HAVE_USLEEP=1',
  99. 'SQLITE_ENABLE_FTS3',
  100. 'SQLITE_ENABLE_FTS4',
  101. 'SQLITE_ENABLE_FTS5',
  102. 'SQLITE_ENABLE_RTREE',
  103. 'SQLITE_ENABLE_DBSTAT_VTAB=1',
  104. 'SQLITE_ENABLE_MATH_FUNCTIONS'
  105. ],
  106. 'export_dependent_settings': [
  107. 'action_before_build',
  108. ],
  109. 'conditions': [
  110. ["sqlite_magic != ''", {
  111. 'defines': [
  112. 'SQLITE_FILE_HEADER="<(sqlite_magic)"'
  113. ]
  114. }]
  115. ],
  116. }
  117. ]
  118. }