mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[upstream_utils] Upgrade Sleipnir (#7973)
This commit is contained in:
@@ -24,10 +24,7 @@ def copy_upstream_src(wpilib_root):
|
||||
|
||||
# Copy Sleipnir header files into allwpilib
|
||||
include_files = [
|
||||
os.path.join(dp, f)
|
||||
for dp, dn, fn in os.walk("include")
|
||||
for f in fn
|
||||
if not f.endswith("small_vector.hpp")
|
||||
os.path.join(dp, f) for dp, dn, fn in os.walk("include") for f in fn
|
||||
]
|
||||
include_files = copy_to(
|
||||
include_files, os.path.join(wpimath, "src/main/native/thirdparty/sleipnir")
|
||||
@@ -44,12 +41,42 @@ def copy_upstream_src(wpilib_root):
|
||||
os.path.join(wpimath, "src/main/native/thirdparty/sleipnir", filename),
|
||||
)
|
||||
|
||||
# Write shim for wpi::SmallVector
|
||||
try:
|
||||
os.mkdir(
|
||||
os.path.join(wpimath, "src/main/native/thirdparty/sleipnir/include/gch")
|
||||
)
|
||||
except:
|
||||
pass
|
||||
with open(
|
||||
os.path.join(
|
||||
wpimath,
|
||||
"src/main/native/thirdparty/sleipnir/include/gch/small_vector.hpp",
|
||||
),
|
||||
"w",
|
||||
) as f:
|
||||
f.write(
|
||||
"""// Copyright (c) Sleipnir contributors
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wpi/SmallVector.h>
|
||||
|
||||
namespace gch {
|
||||
|
||||
template <typename T>
|
||||
using small_vector = wpi::SmallVector<T>;
|
||||
|
||||
} // namespace gch
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
name = "sleipnir"
|
||||
url = "https://github.com/SleipnirGroup/Sleipnir"
|
||||
# main on 2024-12-07
|
||||
tag = "01206ab17d741f4c45a7faeb56b8a5442df1681c"
|
||||
# main on 2025-05-18
|
||||
tag = "2cc18ff6d25ee0a9bd0f9993a0a41a61a28bda3e"
|
||||
|
||||
sleipnir = Lib(name, url, tag, copy_upstream_src)
|
||||
sleipnir.main()
|
||||
|
||||
Reference in New Issue
Block a user