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