OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'use_system_sqlite%': 0, | 7 'use_system_sqlite%': 0, |
8 'required_sqlite_version': '3.6.1', | 8 'required_sqlite_version': '3.6.1', |
9 }, | 9 }, |
10 'target_defaults': { | 10 'target_defaults': { |
(...skipping 16 matching lines...) Expand all Loading... |
27 [ 'chromeos==1' , { | 27 [ 'chromeos==1' , { |
28 'defines': [ | 28 'defines': [ |
29 # Despite obvious warnings about not using this flag | 29 # Despite obvious warnings about not using this flag |
30 # in deployment, we are turning off sync in ChromeOS | 30 # in deployment, we are turning off sync in ChromeOS |
31 # and relying on the underlying journaling filesystem | 31 # and relying on the underlying journaling filesystem |
32 # to do error recovery properly. It's much faster. | 32 # to do error recovery properly. It's much faster. |
33 'SQLITE_NO_SYNC', | 33 'SQLITE_NO_SYNC', |
34 ], | 34 ], |
35 }, | 35 }, |
36 ], | 36 ], |
37 ['OS=="linux" and not use_system_sqlite', { | |
38 'link_settings': { | |
39 'libraries': [ | |
40 '-ldl', | |
41 ], | |
42 }, | |
43 }], | |
44 ['OS == "android"', { | 37 ['OS == "android"', { |
45 'defines': [ | 38 'defines': [ |
46 'SQLITE_TEMP_STORE=3', | 39 'SQLITE_TEMP_STORE=3', |
47 ], | 40 ], |
48 }], | 41 }], |
49 ['os_posix == 1 and OS != "mac" and use_system_sqlite', { | 42 ['use_system_sqlite', { |
50 'type': 'none', | 43 'type': 'none', |
51 'direct_dependent_settings': { | 44 'direct_dependent_settings': { |
52 'cflags': [ | |
53 # This next command produces no output but it it will fail (and | |
54 # cause GYP to fail) if we don't have a recent enough version of | |
55 # sqlite. | |
56 '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlit
e3)', | |
57 | |
58 '<!@(pkg-config --cflags sqlite3)', | |
59 ], | |
60 'defines': [ | 45 'defines': [ |
61 'USE_SYSTEM_SQLITE', | 46 'USE_SYSTEM_SQLITE', |
62 ], | 47 ], |
63 }, | 48 }, |
64 'link_settings': { | 49 |
65 'ldflags': [ | 50 'conditions': [ |
66 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)', | 51 ['OS == "ios"', { |
67 ], | 52 'link_settings': { |
68 'libraries': [ | 53 'libraries': [ |
69 '<!@(pkg-config --libs-only-l sqlite3)', | 54 '$(SDKROOT)/usr/lib/libsqlite3.dylib', |
70 ], | 55 ], |
71 }, | 56 }, |
72 }, { # else: os_posix == 1 or OS == "mac" or ! use_system_sqlite | 57 }], |
| 58 ['os_posix == 1 and OS != "mac" and OS != "ios"', { |
| 59 'direct_dependent_settings': { |
| 60 'cflags': [ |
| 61 # This next command produces no output but it it will fail |
| 62 # (and cause GYP to fail) if we don't have a recent enough |
| 63 # version of sqlite. |
| 64 '<!@(pkg-config --atleast-version=<(required_sqlite_version) s
qlite3)', |
| 65 |
| 66 '<!@(pkg-config --cflags sqlite3)', |
| 67 ], |
| 68 }, |
| 69 'link_settings': { |
| 70 'ldflags': [ |
| 71 '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)', |
| 72 ], |
| 73 'libraries': [ |
| 74 '<!@(pkg-config --libs-only-l sqlite3)', |
| 75 ], |
| 76 }, |
| 77 }], |
| 78 ], |
| 79 }, { # !use_system_sqlite |
73 'product_name': 'sqlite3', | 80 'product_name': 'sqlite3', |
74 'type': 'static_library', | 81 'type': 'static_library', |
75 'sources': [ | 82 'sources': [ |
76 'amalgamation/sqlite3.h', | 83 'amalgamation/sqlite3.h', |
77 'amalgamation/sqlite3.c', | 84 'amalgamation/sqlite3.c', |
78 # fts2.c currently has a lot of conflicts when added to | 85 # fts2.c currently has a lot of conflicts when added to |
79 # the amalgamation. It is probably not worth fixing that. | 86 # the amalgamation. It is probably not worth fixing that. |
80 'src/ext/fts2/fts2.c', | 87 'src/ext/fts2/fts2.c', |
81 'src/ext/fts2/fts2.h', | 88 'src/ext/fts2/fts2.h', |
82 'src/ext/fts2/fts2_hash.c', | 89 'src/ext/fts2/fts2_hash.c', |
(...skipping 24 matching lines...) Expand all Loading... |
107 'direct_dependent_settings': { | 114 'direct_dependent_settings': { |
108 'include_dirs': [ | 115 'include_dirs': [ |
109 '.', | 116 '.', |
110 '../..', | 117 '../..', |
111 ], | 118 ], |
112 }, | 119 }, |
113 'msvs_disabled_warnings': [ | 120 'msvs_disabled_warnings': [ |
114 4018, 4244, | 121 4018, 4244, |
115 ], | 122 ], |
116 'conditions': [ | 123 'conditions': [ |
| 124 ['OS=="linux"', { |
| 125 'link_settings': { |
| 126 'libraries': [ |
| 127 '-ldl', |
| 128 ], |
| 129 }, |
| 130 }], |
117 ['os_posix == 1 and OS != "mac"', { | 131 ['os_posix == 1 and OS != "mac"', { |
118 'cflags': [ | 132 'cflags': [ |
119 # SQLite doesn't believe in compiler warnings, | 133 # SQLite doesn't believe in compiler warnings, |
120 # preferring testing. | 134 # preferring testing. |
121 # http://www.sqlite.org/faq.html#q17 | 135 # http://www.sqlite.org/faq.html#q17 |
122 '-Wno-int-to-pointer-cast', | 136 '-Wno-int-to-pointer-cast', |
123 '-Wno-pointer-to-int-cast', | 137 '-Wno-pointer-to-int-cast', |
124 ], | 138 ], |
125 }], | 139 }], |
126 ['clang==1', { | 140 ['clang==1', { |
127 'xcode_settings': { | 141 'xcode_settings': { |
128 'WARNING_CFLAGS': [ | 142 'WARNING_CFLAGS': [ |
129 # sqlite does `if (*a++ && *b++);` in a non-buggy way. | 143 # sqlite does `if (*a++ && *b++);` in a non-buggy way. |
130 '-Wno-empty-body', | 144 '-Wno-empty-body', |
131 # sqlite has some `unsigned < 0` checks. | 145 # sqlite has some `unsigned < 0` checks. |
132 '-Wno-tautological-compare', | 146 '-Wno-tautological-compare', |
133 ], | 147 ], |
134 }, | 148 }, |
135 'cflags': [ | 149 'cflags': [ |
136 '-Wno-empty-body', | 150 '-Wno-empty-body', |
137 '-Wno-tautological-compare', | 151 '-Wno-tautological-compare', |
138 ], | 152 ], |
139 }], | 153 }], |
140 ], | 154 ], |
141 }], | 155 }], |
142 ], | 156 ], |
143 }, | 157 }, |
144 ], | 158 ], |
145 'conditions': [ | 159 'conditions': [ |
146 ['os_posix == 1 and OS != "mac" and not use_system_sqlite', { | 160 ['os_posix == 1 and OS != "mac" and OS != "ios" and not use_system_sqlite',
{ |
147 'targets': [ | 161 'targets': [ |
148 { | 162 { |
149 'target_name': 'sqlite_shell', | 163 'target_name': 'sqlite_shell', |
150 'type': 'executable', | 164 'type': 'executable', |
151 'dependencies': [ | 165 'dependencies': [ |
152 '../icu/icu.gyp:icuuc', | 166 '../icu/icu.gyp:icuuc', |
153 'sqlite', | 167 'sqlite', |
154 ], | 168 ], |
155 'sources': [ | 169 'sources': [ |
156 'src/src/shell.c', | 170 'src/src/shell.c', |
157 'src/src/shell_icu_linux.c', | 171 'src/src/shell_icu_linux.c', |
158 ], | 172 ], |
159 'link_settings': { | 173 'link_settings': { |
160 'link_languages': ['c++'], | 174 'link_languages': ['c++'], |
161 }, | 175 }, |
162 }, | 176 }, |
163 ], | 177 ], |
164 },] | 178 },] |
165 ], | 179 ], |
166 } | 180 } |
OLD | NEW |