]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/buckifier/targets_cfg.py
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / buckifier / targets_cfg.py
1 from __future__ import absolute_import
2 from __future__ import division
3 from __future__ import print_function
4 from __future__ import unicode_literals
5 rocksdb_target_header = """REPO_PATH = "internal_repo_rocksdb/repo/"
6 BUCK_BINS = "buck-out/gen/" + REPO_PATH
7 TEST_RUNNER = REPO_PATH + "buckifier/rocks_test_runner.sh"
8 rocksdb_compiler_flags = [
9 "-msse",
10 "-msse4.2",
11 "-fno-builtin-memcmp",
12 "-DROCKSDB_PLATFORM_POSIX",
13 "-DROCKSDB_LIB_IO_POSIX",
14 "-DROCKSDB_FALLOCATE_PRESENT",
15 "-DROCKSDB_MALLOC_USABLE_SIZE",
16 "-DOS_LINUX",
17 # Flags to enable libs we include
18 "-DSNAPPY",
19 "-DZLIB",
20 "-DBZIP2",
21 "-DLZ4",
22 "-DZSTD",
23 "-DGFLAGS=gflags",
24 "-DNUMA",
25 "-DTBB",
26 # Needed to compile in fbcode
27 "-Wno-expansion-to-defined",
28 ]
29
30 rocksdb_external_deps = [
31 ('bzip2', None, 'bz2'),
32 ('snappy', None, "snappy"),
33 ('zlib', None, 'z'),
34 ('gflags', None, 'gflags'),
35 ('lz4', None, 'lz4'),
36 ('zstd', None),
37 ('tbb', None),
38 ("numa", "2.0.8", "numa"),
39 ("googletest", None, "gtest"),
40 ]
41
42 rocksdb_preprocessor_flags = [
43 # Directories with files for #include
44 "-I" + REPO_PATH + "include/",
45 "-I" + REPO_PATH,
46 ]
47 """
48
49
50 library_template = """
51 cpp_library(
52 name = "%s",
53 headers = %s,
54 srcs = [%s],
55 deps = [%s],
56 preprocessor_flags = rocksdb_preprocessor_flags,
57 compiler_flags = rocksdb_compiler_flags,
58 external_deps = rocksdb_external_deps,
59 )
60 """
61
62 binary_template = """
63 cpp_binary(
64 name = "%s",
65 srcs = [%s],
66 deps = [%s],
67 preprocessor_flags = rocksdb_preprocessor_flags,
68 compiler_flags = rocksdb_compiler_flags,
69 external_deps = rocksdb_external_deps,
70 )
71 """
72
73 unittests_template = """
74 # [test_name, test_src, test_type]
75 ROCKS_TESTS = %s
76
77
78 # Generate a test rule for each entry in ROCKS_TESTS
79 for test_cfg in ROCKS_TESTS:
80 test_name = test_cfg[0]
81 test_cc = test_cfg[1]
82 ttype = "gtest" if test_cfg[2] == "parallel" else "simple"
83 test_bin = test_name + "_bin"
84
85 cpp_binary (
86 name = test_bin,
87 srcs = [test_cc],
88 deps = [":rocksdb_test_lib"],
89 preprocessor_flags = rocksdb_preprocessor_flags,
90 compiler_flags = rocksdb_compiler_flags,
91 external_deps = rocksdb_external_deps,
92 )
93
94 custom_unittest(
95 name = test_name,
96 type = ttype,
97 deps = [":" + test_bin],
98 command = [TEST_RUNNER, BUCK_BINS + test_bin]
99 )
100
101 custom_unittest(
102 name = "make_rocksdbjavastatic",
103 type = "simple",
104 command = ["internal_repo_rocksdb/make_rocksdbjavastatic.sh"],
105 )
106
107 custom_unittest(
108 name = "make_rocksdb_lite_release",
109 type = "simple",
110 command = ["internal_repo_rocksdb/make_rocksdb_lite_release.sh"],
111 )
112 """