Skip to content

Commit 4ba75db

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 eecb8c0 commit 4ba75db

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ http_archive(
160160
)
161161

162162
# TODO: Replace with hermetic build
163+
new_local_repository(
164+
name = "glib_local_archive",
165+
build_file = "@//bazel:glib.BUILD",
166+
path ="/usr/local/Cellar/glib/2.66.2_1",
167+
)
168+
163169
new_local_repository(
164170
name = "sdl_system",
165171
build_file = "@//bazel:sdl.BUILD",

bazel/glib.BUILD

Lines changed: 15 additions & 0 deletions
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+
)

q3map2/BUILD

Lines changed: 4 additions & 2 deletions
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)