srctree

Robin Linden parent 28a50048 eaa47f33
deps: Update SFML

inlinesplit
WORKSPACE added: 37, removed: 17, total 20
@@ -191,18 +191,24 @@ http_archive(
url = "https://github.com/glennrp/libpng/archive/v1.6.40.tar.gz",
)
 
# https://github.com/SFML/SFML
http_archive(
name = "sfml", # Zlib
build_file = "//third_party:sfml.BUILD",
# Work around SFML check for enough bytes for a given UTF-8 character crashing
# in MSVC debug builds with "cannot seek string_view iterator after end".
# See: https://github.com/SFML/SFML/issues/2113
patch_cmds = [
# Work around SFML check for enough bytes for a given UTF-8 character
# crashing in MSVC debug builds with "cannot seek string_view iterator
# after end".
# See: https://github.com/SFML/SFML/issues/2113
"sed -i'' -e 's/if (begin + trailingBytes < end)/if (trailingBytes < std::distance(begin, end))/' include/SFML/System/Utf.inl",
# SFML uses a non-standard include path to vulkan.h
# libvulkan-dev: /usr/include/vulkan/vulkan.h
"sed -i'' -e 's|vulkan.h|vulkan/vulkan.h|' src/SFML/Window/Win32/VulkanImplWin32.cpp",
"sed -i'' -e 's|vulkan.h|vulkan/vulkan.h|' src/SFML/Window/Unix/VulkanImplX11.cpp",
],
sha256 = "6124b5fe3d96e7f681f587e2d5b456cd0ec460393dfe46691f1933d6bde0640b",
strip_prefix = "SFML-2.5.1",
url = "https://github.com/SFML/SFML/archive/2.5.1.zip",
sha256 = "cf9535356ab37067e871270fbc5ae19e4102b658d6ea96993e6c9452ddbf99b3",
strip_prefix = "SFML-2.6.0",
url = "https://github.com/SFML/SFML/archive/2.6.0.zip",
)
 
# https://github.com/gabime/spdlog
 
third_party/sfml.BUILD added: 37, removed: 17, total 20
@@ -1,5 +1,19 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library")
 
# SFML has copied the generated files into their source tree and patched them.
# The files are generated w/ very different options from us, so we can't just
# force them to use our glad even if we patch their files to look for standard
# glad types.
# See: external/sfml/extlibs/headers/glad/include/glad/gl.h,
# external/sfml/extlibs/headers/glad/include/glad/wgl.h
#
# TODO(robinlinden): Spend more time on making SFML use our glad.
cc_library(
name = "sf_glad",
hdrs = glob(["extlibs/headers/glad/include/glad/**/*.h"]),
strip_include_prefix = "extlibs/headers/glad/include/",
)
 
SFML_DEFINES = [
"SFML_STATIC",
"UNICODE",
@@ -70,10 +84,7 @@ cc_library(
copts = ["-Iexternal/sfml/src/"],
defines = SFML_DEFINES,
linkopts = select({
"@platforms//os:linux": [
"-lGL",
"-lX11",
],
"@platforms//os:linux": ["-lX11"],
"@platforms//os:windows": [
"-DEFAULTLIB:advapi32",
"-DEFAULTLIB:gdi32",
@@ -88,9 +99,14 @@ cc_library(
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [":system"] + select({
deps = [
":sf_glad",
":system",
"@vulkan",
] + select({
"@platforms//os:linux": [
"@udev-zero",
"@xcursor",
"@xrandr",
],
"@platforms//os:windows": [],
@@ -139,16 +155,14 @@ cc_library(
defines = SFML_DEFINES,
includes = ["include/"],
linkopts = select({
"@platforms//os:linux": [
"-lGL",
"-lX11",
],
"@platforms//os:linux": ["-lX11"],
"@platforms//os:macos": [],
"@platforms//os:windows": [],
}),
strip_include_prefix = "include/",
visibility = ["//visibility:public"],
deps = [
":sf_glad",
":system",
":window",
"@freetype2",