-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
BUILD
137 lines (129 loc) · 3.68 KB
/
BUILD
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
load("@base_pip3//:requirements.bzl", "requirement")
load("@rules_cc//cc:defs.bzl", "cc_library")
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_contrib_extension",
"envoy_cc_library",
"envoy_cmake",
"envoy_contrib_package",
)
licenses(["notice"]) # Apache 2
# VPP Comms Lib (VCL) adaptor.
envoy_contrib_package()
cc_library(
name = "vpp_vcl",
hdrs = ["external/vppcom.h"],
additional_linker_inputs = [
"external/libsvm.a",
"external/libvlibmemoryclient.a",
"external/libvlibapi.a",
"external/libvppcom.a",
"external/libvppinfra.a",
],
defines = ["VPP_VCL"],
includes = ["external/"],
linkopts = [
"-Wl,--start-group",
"$(location external/libsvm.a)",
"$(location external/libvlibmemoryclient.a)",
"$(location external/libvlibapi.a)",
"$(location external/libvppcom.a)",
"$(location external/libvppinfra.a)",
"-Wl,--end-group",
],
tags = ["skip_on_windows"],
visibility = ["//visibility:public"],
)
envoy_cmake(
name = "build",
build_data = [requirement("ply")],
cache_entries = {
"CMAKE_BUILD_TYPE": "Release",
"VPP_API_TEST_BUILTIN": "OFF",
"BUILD_SHARED_LIBS": "OFF",
"CMAKE_ENABLE_EXPORTS": "OFF",
},
copts = [
"-Wno-unused-variable",
"-Wno-error=array-bounds",
],
default_cache_entries = {},
env = {
"PLYPATHS": "$(locations %s)" % requirement("ply"),
},
lib_source = "@com_github_fdio_vpp_vcl//:all",
linkopts = ["-Wno-unused-variable"],
out_static_libs = [
"libvppcom.a",
"libvppinfra.a",
"libsvm.a",
"libvlibapi.a",
"libvlibmemoryclient.a",
],
postfix_script = """
mkdir -p $INSTALLDIR/lib/external $INSTALLDIR/include/external \
&& find . -name "*.a" | xargs -I{} cp -a {} $INSTALLDIR/lib/ \
&& find . -name "*.h" ! -name config.h | xargs -I{} cp -a {} $INSTALLDIR/include
""",
tags = [
"cpu:16",
"skip_on_windows",
],
targets = [
"vppcom",
],
working_directory = "src",
)
genrule(
name = "build_files",
outs = [
"external/libsvm.a",
"external/libvlibmemoryclient.a",
"external/libvlibapi.a",
"external/libvppcom.a",
"external/libvppinfra.a",
"external/vppcom.h",
],
cmd = """
find . -name "*.a" | grep -v copy_build | xargs -I{} cp -a {} $(RULEDIR)/external \
&& find . -name "vppcom.h" | grep -v copy_build | xargs -I{} cp -a {} $(RULEDIR)/external
""",
tools = [":build"],
)
envoy_cc_library(
name = "vcl_interface_lib",
srcs = [
"vcl_event.cc",
"vcl_interface.cc",
"vcl_io_handle.cc",
],
hdrs = [
"vcl_event.h",
"vcl_interface.h",
"vcl_io_handle.h",
],
visibility = ["//visibility:public"],
deps = [
":vpp_vcl",
"//envoy/event:dispatcher_interface",
"//envoy/network:socket_interface",
"//source/common/common:minimal_logger_lib",
"//source/common/event:dispatcher_includes",
"//source/common/event:dispatcher_lib",
"//source/common/event:libevent_scheduler_lib",
"//source/common/network:address_lib",
"//source/common/network:io_socket_error_lib",
"//source/common/network:socket_interface_lib",
"//source/common/network:socket_lib",
],
)
envoy_cc_contrib_extension(
name = "config",
srcs = ["config.cc"],
hdrs = ["config.h"],
visibility = ["//visibility:public"],
deps = [
":vcl_interface_lib",
"@envoy_api//contrib/envoy/extensions/vcl/v3alpha:pkg_cc_proto",
],
)