GN (Android): Fix packaging excess libs when target_cpu is changed
[chromium-blink-merge.git] / sql / BUILD.gn
blob38f85b4f26f72e6ae30a9f1f68cf0320b2f11a10
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//testing/test.gni")
7 component("sql") {
8   sources = [
9     "connection.cc",
10     "connection.h",
11     "error_delegate_util.cc",
12     "error_delegate_util.h",
13     "init_status.h",
14     "meta_table.cc",
15     "meta_table.h",
16     "proxy.cc",
17     "proxy.h",
18     "recovery.cc",
19     "recovery.h",
20     "statement.cc",
21     "statement.h",
22     "transaction.cc",
23     "transaction.h",
24   ]
26   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
27   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
29   defines = [ "SQL_IMPLEMENTATION" ]
31   deps = [
32     "//base",
33     "//third_party/sqlite",
34     "//base/third_party/dynamic_annotations",
35   ]
38 source_set("test_support") {
39   testonly = true
40   sources = [
41     "test/error_callback_support.cc",
42     "test/error_callback_support.h",
43     "test/scoped_error_ignorer.cc",
44     "test/scoped_error_ignorer.h",
45     "test/test_helpers.cc",
46     "test/test_helpers.h",
47   ]
49   deps = [
50     ":sql",
51     "//base",
52     "//testing/gtest",
53     "//third_party/sqlite",
54   ]
57 source_set("redirection_header") {
58   # This target exists because we need a way to switch between
59   # "test/sql_test_base.h" and "mojo/sql_test_base.h" at compile time, to allow
60   # us to switch out the gtest vs mojo:apptest frameworks.
61   check_includes = false
63   sources = [
64     "correct_sql_test_base.h",
65   ]
68 # TODO(GYP): Delete this after we've converted everything to GN.
69 # The _run targets exist only for compatibility w/ GYP.
70 group("sql_unittests_run") {
71   testonly = true
72   deps = [
73     ":sql_unittests",
74   ]
77 test("sql_unittests") {
78   sources = [
79     "connection_unittest.cc",
80     "meta_table_unittest.cc",
81     "recovery_unittest.cc",
82     "sqlite_features_unittest.cc",
83     "statement_unittest.cc",
84     "test/paths.cc",
85     "test/paths.h",
86     "test/run_all_unittests.cc",
87     "test/sql_test_base.cc",
88     "test/sql_test_base.h",
89     "test/sql_test_suite.cc",
90     "test/sql_test_suite.h",
91     "transaction_unittest.cc",
92   ]
94   data = [
95     "test/data/",
96   ]
98   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
99   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
101   deps = [
102     ":sql",
103     ":redirection_header",
104     ":test_support",
105     "//base/allocator",
106     "//base/test:test_support",
107     "//testing/gtest",
108     "//third_party/sqlite",
109   ]
111   if (is_android) {
112     isolate_file = "sql_unittests.isolate"
113   }
115   # TODO(GYP)
116   #['OS == "android"', {
117   #  'dependencies': [
118   #    '../testing/android/native_test.gyp:native_test_native_code',
119   #  ],
120   #}],
123 if (is_android) {
124   #TODO(GYP)
125   #'target_name': 'sql_unittests_apk',
126   #'type': 'none',
127   #'dependencies': [
128   #  'sql_unittests',
129   #],
130   #'variables': {
131   #  'test_suite_name': 'sql_unittests',
132   #},
133   #'includes': [ '../build/apk_test.gypi' ],