Skip to content

Commit f700310

Browse files
committed
Fixes to Bazel build
1 parent b4caf6c commit f700310

3 files changed

Lines changed: 74 additions & 11 deletions

File tree

BUILD.bazel

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pkg_files(
7575

7676
cc_shared_library(
7777
name = "AVO",
78+
visibility = ["//visibility:public"],
7879
deps = ["//src:AVO"],
7980
)
8081

@@ -101,7 +102,7 @@ cat << 'EOF' > $@
101102
}
102103
},
103104
"cps_path": "@prefix@/lib/cps/AVO",
104-
"cps_version": "0.13.0",
105+
"cps_version": "0.14.1",
105106
"default_components": ["AVO"],
106107
"description": "Reciprocal Collision Avoidance with Acceleration-Velocity Obstacles",
107108
"license": "Apache-2.0",
@@ -114,9 +115,64 @@ EOF
114115
""",
115116
)
116117

118+
genrule(
119+
name = "avo_release_cps",
120+
outs = ["AVO@release.cps"],
121+
cmd = select({
122+
"@platforms//os:macos": """
123+
cat << 'EOF' > $@
124+
{
125+
"components":
126+
{
127+
"AVO":
128+
{
129+
"location": "@prefix@/lib/libAVO.dylib"
130+
}
131+
},
132+
"configuration": "Release",
133+
"name": "AVO"
134+
}
135+
EOF
136+
""",
137+
"@platforms//os:windows": """
138+
cat << 'EOF' > $@
139+
{
140+
"components":
141+
{
142+
"AVO":
143+
{
144+
"location": "@prefix@/lib/AVO.dll"
145+
}
146+
},
147+
"configuration": "Release",
148+
"name": "AVO"
149+
}
150+
EOF
151+
""",
152+
"//conditions:default": """
153+
cat << 'EOF' > $@
154+
{
155+
"components":
156+
{
157+
"AVO":
158+
{
159+
"location": "@prefix@/lib/libAVO.so"
160+
}
161+
},
162+
"configuration": "Release",
163+
"name": "AVO"
164+
}
165+
EOF
166+
""",
167+
}),
168+
)
169+
117170
pkg_files(
118171
name = "cps",
119-
srcs = ["AVO.cps"],
172+
srcs = [
173+
"AVO.cps",
174+
"AVO@release.cps",
175+
],
120176
attributes = pkg_attributes(mode = "0644"),
121177
prefix = "usr/lib/cps/AVO",
122178
)
@@ -197,11 +253,13 @@ pkg_tar(
197253

198254
pkg_deb(
199255
name = "deb",
200-
architecture = select({
201-
"@platforms//cpu:arm": "amd64",
202-
"@platforms//os:macos": "arm64",
203-
"//conditions:default": "all",
204-
}),
256+
architecture = select(
257+
{
258+
"@platforms//cpu:aarch64": "arm64",
259+
"@platforms//cpu:x86_64": "amd64",
260+
},
261+
no_match_error = "Unsupported CPU for //:deb. Supported CPUs: aarch64, x86_64.",
262+
),
205263
data = ":tar",
206264
depends = [
207265
"libc6",
@@ -215,6 +273,7 @@ pkg_deb(
215273
package = "avo",
216274
priority = "optional",
217275
section = "contrib/libdevel",
276+
target_compatible_with = ["@platforms//os:linux"],
218277
triggers = "triggers",
219278
version = "1.0.1",
220279
)

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module(
4242
bazel_dep(
4343
name = "apple_support",
4444
version = "2.4.0",
45+
dev_dependency = True,
4546
repo_name = "build_bazel_apple_support",
4647
)
4748

src/BUILD.bazel

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,13 @@ cc_library(
128128
"Vector2.cc",
129129
],
130130
hdrs = [":hdrs"],
131-
copts = [
132-
"-fvisibility-inlines-hidden",
133-
"-fvisibility=hidden",
134-
],
131+
copts = select({
132+
"@platforms//os:windows": [],
133+
"//conditions:default": [
134+
"-fvisibility-inlines-hidden",
135+
"-fvisibility=hidden",
136+
],
137+
}),
135138
includes = ["."],
136139
visibility = ["//visibility:public"],
137140
)

0 commit comments

Comments
 (0)