-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
67 lines (61 loc) · 1.85 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
load("//lib:defs.bzl", "dep_path", "include_flags", "library_dir", "link_flags")
load("//lib:lib.bzl", "package_lib")
# Library deps:
load("//lib/jpegturbo:package.bzl", JPEGTURBO_SPEC = "SPEC")
load("//lib/openexr:package.bzl", OPENEXR_SPEC = "SPEC")
load("//lib/openjpeg:package.bzl", OPENJPEG_SPEC = "SPEC")
load("//toolchains/cmake:cmake.bzl", "cache_entries", "cmake_lib")
load(":package.bzl", "NAME", "STATIC_LIBS")
package(default_visibility = ["//:__subpackages__"])
package_lib(
github_release = True,
github_version_prefix = "",
)
C_FLAGS = include_flags(OPENJPEG_SPEC["include_dir"])
EXE_LINKER_FLAGS_RELEASE = " ".join([
link_flags(
"jpeg",
library_dir("jpegturbo"),
),
link_flags("lzma"),
link_flags("webp"),
link_flags("zstd"),
])
cmake_lib(
name = NAME,
cache_entries = cache_entries(
build_protobuf = False,
build_shared_libs = False,
cmake_c_flags_release = C_FLAGS,
cmake_cxx_flags_release = C_FLAGS,
cmake_exe_linker_flags_release = EXE_LINKER_FLAGS_RELEASE,
install_create_distrib = True,
opencv_force_eigen_find_package_config = dep_path("eigen", "/share/eigen3/cmake/Eigen3Config.cmake"),
remap = {
# OpenJPEG find_package() uses plural.
"openjpeg_libraries": "openjpeg_library",
},
deps = {
"jpeg": JPEGTURBO_SPEC,
"openexr": OPENEXR_SPEC,
"openjpeg": OPENJPEG_SPEC,
"png": {},
"protobuf": {},
"tiff": {},
"webp": {},
"z": {},
},
),
out_static_libs = STATIC_LIBS,
deps = [
"//lib/eigen",
"//lib/jpegturbo",
"//lib/openexr",
"//lib/openjpeg",
"//lib/png",
"//lib/protobuf",
"//lib/tiff",
"//lib/webp",
"//lib/z",
],
)