srctree

Robin Linden parent ebe2e8be 042be7e7
deps/imgui-sfml: Patch out the system GL dependency in favour of glad

inlinesplit
WORKSPACE added: 15, removed: 7, total 8
@@ -163,6 +163,11 @@ http_archive(
http_archive(
name = "imgui-sfml", # MIT
build_file = "//third_party:imgui-sfml.BUILD",
patch_cmds = [
# Use glad for OpenGL instead of the system OpenGL headers.
"sed -i'' -e /OpenGL.hpp/d imgui-SFML.cpp",
"sed -i'' -e '4i\\\n#include <glad/gl.h>' imgui-SFML.cpp",
],
sha256 = "b1195ca1210dd46c8049cfc8cae7f31cd34f1591da7de1c56297b277ac9c5cc0",
strip_prefix = "imgui-sfml-2.6",
url = "https://github.com/eliasdaler/imgui-sfml/archive/v2.6.tar.gz",
 
third_party/imgui-sfml.BUILD added: 15, removed: 7, total 8
@@ -1,18 +1,21 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
 
# TODO(robinlinden): False positive layering check error. Related to glad being
# a local_repository? See: bazel-out/k8-fastbuild/bin/external/glad/glad.cppmap
#
# external/imgui-sfml/imgui-SFML.cpp:4:10: error: module imgui-sfml//:imgui-sfml
# does not depend on a module exporting 'glad/gl.h'
package(features = ["-layering_check"])
 
cc_library(
name = "imgui-sfml",
srcs = ["imgui-SFML.cpp"],
hdrs = glob(["*.h"]),
defines = ["IMGUI_SFML_SHARED_LIB=0"],
includes = ["."],
linkopts = select({
"@platforms//os:linux": ["-lGL"],
"@platforms//os:macos": ["-lGL"],
"@platforms//os:windows": ["-DEFAULTLIB:opengl32"],
}),
visibility = ["//visibility:public"],
deps = [
"@glad",
"@imgui",
"@sfml//:graphics",
"@sfml//:system",