forked from osu-crypto/libPSI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBUILD.bazel
91 lines (82 loc) · 1.87 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package(default_visibility = ["//visibility:public",],)
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
LINK_OPTS = [
"-pthread",
"-ldl",
]
DEFINES = [
"ENABLE_FULL_GSL",
"ENABLE_BOOST",
"ENABLE_RELIC",
"ENABLE_CIRCUITS",
"ENABLE_NASM",
"OC_ENABLE_PORTABLE_AES",
"USE_JSON",
"NDEBUG",
"TEST_LIBP2P",
]
C_OPT = [
"-O0",
"-g",
"-Wall",
"-ggdb",
"-rdynamic",
"-maes",
"-mpclmul",
"-Wno-reserved-user-defined-literal",
]
## sparsehash
cc_library(
name = "sparsehash_config",
hdrs = ["sparseconfig.h"],
include_prefix = "sparsehash/internal",
visibility = ["//visibility:public"],
)
## libpsi
cc_library(
name = "libpsi_config",
hdrs = ["config.h"],
include_prefix = "libPSI",
visibility = ["//visibility:public"],
)
cc_library(
name = "libpsi",
srcs = glob(
[
"libPSI/**/*.cpp",
"libPSI/**/*.h",
#"frontend/**/*.cpp",
],
),
hdrs = glob([
"libPSI/**/*.h",
#"frontend/**/*.h",
]),
includes = ["libPSI"],
visibility = ["//visibility:public"],
linkopts = ["-pthread -lstdc++"],
copts = ["-I. -std=c++14 -O0 -g -ggdb -rdynamic -maes -msse2 -msse3 -msse4.1 -mpclmul"],
strip_include_prefix = "libPSI",
# Using an empty include_prefix causes Bazel to emit -I instead of -iquote
# options for the include directory, so that #include <gmp.h> works.
include_prefix = "libPSI",
deps = [
":libpsi_config",
"@ladnir_cryptoTools//:libcryptoTools",
"@osu_libote//:libOTe",
"@github_ntl//:libntl",
"@google_sparsehash//:sparsehash",
],
)
# test
cc_test(
name = "test",
copts = C_OPT,
defines = DEFINES,
linkopts = LINK_OPTS,
linkstatic = False,
deps = [
"@google_sparsehash//:sparsehash",
":libpsi",
],
)