• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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
18load("@perfetto_cfg//:perfetto_cfg.bzl", "PERFETTO_CONFIG")
19
20# #############################
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",
52] + PERFETTO_CONFIG.deps_copts.sqlite
53
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,
76    deps = PERFETTO_CONFIG.deps.sqlite,
77    visibility = ["//visibility:public"],
78)
79