Skip to content

Commit d45c445

Browse files
committed
[WORKSPACE, glib.BUILD, q3map] Add local version of glib repository
This is currently for use on MacOS only. On Linux, we can build glib from source.
1 parent c90f68f commit d45c445

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Diff for: WORKSPACE

+6
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ http_archive(
153153
)
154154

155155
# TODO: Replace with hermetic build
156+
new_local_repository(
157+
name = "glib_local_archive",
158+
build_file = "@//bazel:glib.BUILD",
159+
path ="/usr/local/Cellar/glib/2.68.3",
160+
)
161+
156162
new_local_repository(
157163
name = "sdl_system",
158164
build_file = "@//bazel:sdl.BUILD",

Diff for: bazel/glib.BUILD

+15
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,18 @@ cc_library(
244244
visibility = ["//visibility:public"],
245245
deps = [":charset"],
246246
)
247+
248+
cc_library(
249+
name = "glib_local",
250+
srcs = ["lib/libglib-2.0.0.dylib"],
251+
hdrs = glob([
252+
"include/glib-2.0/**/*.h",
253+
"lib/glib-2.0/**/*.h",
254+
]),
255+
includes = [
256+
"include/glib-2.0",
257+
"lib/glib-2.0/include",
258+
],
259+
linkopts = ["-liconv"],
260+
visibility = ["//visibility:public"],
261+
)

Diff for: q3map2/BUILD

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ cc_binary(
9191
":picomodel",
9292
"//third_party/md:md4",
9393
"//third_party/md:md5",
94-
"@glib_archive//:glib",
9594
"@jpeg_archive//:jpeg",
9695
"@libxml_archive//:libxml",
9796
"@png_archive//:png",
98-
],
97+
] + select({
98+
"//:is_linux": ["@glib_archive//:glib"],
99+
"//:is_macos": ["@glib_local_archive//:glib_local"],
100+
}),
99101
)

0 commit comments

Comments
 (0)