Skip to content

Commit

Permalink
[WORKSPACE, glib.BUILD, q3map] Add local version of glib repository
Browse files Browse the repository at this point in the history
This is currently for use on MacOS only. On Linux, we can build glib
from source.
  • Loading branch information
tkoeppe committed Jul 22, 2021
1 parent d3b1882 commit 2908d0d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ http_archive(
)

# TODO: Replace with hermetic build
new_local_repository(
name = "glib_local_archive",
build_file = "@//bazel:glib.BUILD",
path ="/usr/local/Cellar/glib/2.68.3",
)

new_local_repository(
name = "sdl_system",
build_file = "@//bazel:sdl.BUILD",
Expand Down
15 changes: 15 additions & 0 deletions bazel/glib.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,18 @@ cc_library(
visibility = ["//visibility:public"],
deps = [":charset"],
)

cc_library(
name = "glib_local",
srcs = ["lib/libglib-2.0.0.dylib"],
hdrs = glob([
"include/glib-2.0/**/*.h",
"lib/glib-2.0/**/*.h",
]),
includes = [
"include/glib-2.0",
"lib/glib-2.0/include",
],
linkopts = ["-liconv"],
visibility = ["//visibility:public"],
)
6 changes: 4 additions & 2 deletions q3map2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ cc_binary(
":picomodel",
"//third_party/md:md4",
"//third_party/md:md5",
"@glib_archive//:glib",
"@jpeg_archive//:jpeg",
"@libxml_archive//:libxml",
"@png_archive//:png",
],
] + select({
"//:is_linux": ["@glib_archive//:glib"],
"//:is_macos": ["@glib_local_archive//:glib_local"],
}),
)

0 comments on commit 2908d0d

Please sign in to comment.