blob: 8b02c6de91cfed4fd212e62f67642caef8ef54bd [file] [log] [blame]
Primiano Tucci1d409982019-09-19 10:15:18 +01001# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# This build file is used for both @perfetto_dep_sqlite and
16# @perfetto_dep_sqlite_src.
17
Primiano Tuccia4defd62019-09-19 23:00:30 +010018load("@perfetto_cfg//:perfetto_cfg.bzl", "PERFETTO_CONFIG")
19
Primiano Tucci1d409982019-09-19 10:15:18 +010020# #############################
21# @perfetto_dep_sqlite section
22# #############################
23
24filegroup(
25 name = "headers",
26 srcs = [
27 "sqlite3.h",
28 "sqlite3ext.h",
29 ],
30 visibility = ["//visibility:public"],
31)
32
33include_sqlite = [
34 ".",
35]
36
37sqlite_copts = [
38 "-DSQLITE_THREADSAFE=0",
39 "-DQLITE_DEFAULT_MEMSTATUS=0",
40 "-DSQLITE_LIKE_DOESNT_MATCH_BLOBS",
41 "-DSQLITE_OMIT_DEPRECATED",
42 "-DSQLITE_OMIT_SHARED_CACHE",
43 "-DHAVE_USLEEP",
44 "-DHAVE_UTIME",
45 "-DSQLITE_BYTEORDER=1234",
46 "-DSQLITE_DEFAULT_AUTOVACUUM=0",
47 "-DSQLITE_DEFAULT_MMAP_SIZE=0",
48 "-DSQLITE_CORE",
49 "-DSQLITE_TEMP_STORE=3",
50 "-DSQLITE_OMIT_LOAD_EXTENSION",
51 "-DSQLITE_OMIT_RANDOMNESS",
Pascal Muetschard6df59d52019-09-25 16:28:00 -070052] + PERFETTO_CONFIG.deps_copts.sqlite
Primiano Tucci1d409982019-09-19 10:15:18 +010053
54cc_library(
55 name = "sqlite",
56 srcs = [
57 "sqlite3.c",
58 "sqlite3.h",
59 ],
60 hdrs = [":headers"],
61 copts = sqlite_copts,
62 includes = include_sqlite,
63 visibility = ["//visibility:public"],
64)
65
66# ################################
67# @perfetto_dep_sqlite_src section
68# ################################
69
70cc_library(
71 name = "percentile_ext",
72 srcs = [
73 "ext/misc/percentile.c",
74 ],
75 copts = sqlite_copts,
Primiano Tuccia4defd62019-09-19 23:00:30 +010076 deps = PERFETTO_CONFIG.deps.sqlite,
Primiano Tucci1d409982019-09-19 10:15:18 +010077 visibility = ["//visibility:public"],
78)