-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
39 lines (34 loc) · 1.11 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
# Complete copy (with a bit of a change) of https://github.com/bazelbuild/rules_foreign_cc/blob/main/examples/third_party/libssh2/BUILD.libssh2.bazel
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
filegroup(
name = "all_srcs",
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)
_CACHE_ENTRIES = {
"BUILD_EXAMPLES": "OFF",
"BUILD_SHARED_LIBS": "OFF",
"BUILD_TESTING": "OFF",
"CMAKE_FIND_DEBUG_MODE": "ON",
#"CMAKE_PREFIX_PATH": "${CMAKE_PREFIX_PATH:-};$EXT_BUILD_DEPS/openssl",
}
_LINUX_CACHE_ENTRIES = dict(_CACHE_ENTRIES.items() + {
"CMAKE_C_FLAGS": "${CMAKE_C_FLAGS:-} -fPIC",
}.items())
cmake(
name = "libssh2",
cache_entries = select({
"@platforms//os:linux": _LINUX_CACHE_ENTRIES,
"//conditions:default": _CACHE_ENTRIES,
}),
lib_source = ":all_srcs",
out_static_libs = select({
# TODO: I'm guessing at this name. Needs to be checked on windows.
"@platforms//os:windows": ["ssh2.lib"],
"//conditions:default": ["libssh2.a"],
}),
visibility = ["//visibility:public"],
deps = [
"@openssl",
],
)