forked from weidai11/cryptopp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
65 lines (58 loc) · 1.46 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
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
package(default_visibility = ["//visibility:public"])
_clang_copts = [
# disable all warnings for upstream
"-w"
]
_msvc_copts = [
# disable all warnings for upstream
"/w",
]
_copts = select({
"@bazel_tools//tools/cpp:msvc": _msvc_copts,
"@bazel_tools//tools/cpp:clang-cl": _msvc_copts + ["-Xclang " + f for f in _clang_copts],
"//conditions:default": _clang_copts,
})
# Rename .asm to .S so that it will be handled with the C preprocessor.
[copy_file(
name = "rename_%s" % name,
visibility = ["//visibility:public"],
src = "%s.asm" % name,
out = "%s.S" % name,
) for name in [
"x64dll",
"x64masm",
]]
cc_library(
name = "cryptopp_asm",
copts = [],
srcs = [
"x64dll.S",
"x64masm.S",
],
)
cc_library(
name = "cryptopp",
visibility = ["//visibility:public"],
defines = ["CRYPTOPP_DISABLE_ASM=1"],
includes = ["."],
copts = _copts,
hdrs = glob(["*.h"]) + [
"algebra.cpp",
"eccrypto.cpp",
"eprecomp.cpp",
"strciphr.cpp",
"polynomi.cpp",
],
srcs = glob(["*.cpp"], exclude = [
"test.cpp",
"fipstest.cpp",
"dlltest.cpp",
]),
deps = select({
"@bazel_tools//tools/cpp:msvc": [":cryptopp_asm"],
"@bazel_tools//tools/cpp:clang-cl": [":cryptopp_asm"],
"//conditions:default": [],
}),
)