1+ # Copyright 2018- The Pixie Authors.
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+ # SPDX-License-Identifier: Apache-2.0
16+
17+ load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
18+
19+ licenses(["notice"])
20+
21+ exports_files(["LICENSE"])
22+
23+ filegroup(
24+ name = "all",
25+ srcs = glob(["**"]),
26+ )
27+
28+ cmake(
29+ name = "clickhouse_cpp",
30+ build_args = [
31+ "--", # <- Pass remaining options to the native tool.
32+ "-j`nproc`",
33+ "-l`nproc`",
34+ ],
35+ cache_entries = {
36+ "BUILD_BENCHMARK": "OFF",
37+ "BUILD_TESTS": "OFF",
38+ "BUILD_SHARED_LIBS": "OFF",
39+ "CMAKE_BUILD_TYPE": "Release",
40+ "WITH_OPENSSL": "OFF", # Disable OpenSSL for now
41+ "WITH_SYSTEM_ABSEIL": "OFF", # Use bundled abseil
42+ "WITH_SYSTEM_LZ4": "OFF", # Use bundled for now
43+ "WITH_SYSTEM_CITYHASH": "OFF", # Use bundled for now
44+ "WITH_SYSTEM_ZSTD": "OFF", # Use bundled for now
45+ "CMAKE_POSITION_INDEPENDENT_CODE": "ON",
46+ },
47+ lib_source = ":all",
48+ out_static_libs = [
49+ "libclickhouse-cpp-lib.a",
50+ "liblz4.a",
51+ "libcityhash.a",
52+ "libzstdstatic.a",
53+ "libabsl_int128.a",
54+ ],
55+ targets = [
56+ "clickhouse-cpp-lib",
57+ "lz4",
58+ "cityhash",
59+ "zstdstatic",
60+ "absl_int128",
61+ ],
62+ visibility = ["//visibility:public"],
63+ working_directory = "",
64+ )
0 commit comments