From 76679585567a4a2c51ff5b7bb3915dae31e5ef0b Mon Sep 17 00:00:00 2001 From: Gliniak Date: Sat, 5 Apr 2025 18:23:25 +0200 Subject: [PATCH] [3PP] Added Libusb --- .gitmodules | 3 +++ premake5.lua | 1 + third_party/libusb | 1 + third_party/libusb.lua | 46 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 160000 third_party/libusb create mode 100644 third_party/libusb.lua diff --git a/.gitmodules b/.gitmodules index 7bb327b53..6c40a386d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -103,3 +103,6 @@ [submodule "third_party/pugixml"] path = third_party/pugixml url = https://github.com/zeux/pugixml.git +[submodule "third_party/libusb"] + path = third_party/libusb + url = https://github.com/libusb/libusb.git diff --git a/premake5.lua b/premake5.lua index 323ca622e..17b14de89 100644 --- a/premake5.lua +++ b/premake5.lua @@ -265,6 +265,7 @@ workspace("xenia") include("third_party/fmt.lua") include("third_party/glslang-spirv.lua") include("third_party/imgui.lua") + include("third_party/libusb.lua") include("third_party/mspack.lua") include("third_party/snappy.lua") include("third_party/xxhash.lua") diff --git a/third_party/libusb b/third_party/libusb new file mode 160000 index 000000000..a61afe5f7 --- /dev/null +++ b/third_party/libusb @@ -0,0 +1 @@ +Subproject commit a61afe5f75d969c4561a1d0ad753aa23cee6329a diff --git a/third_party/libusb.lua b/third_party/libusb.lua new file mode 100644 index 000000000..c38165723 --- /dev/null +++ b/third_party/libusb.lua @@ -0,0 +1,46 @@ +group("third_party") +project("libusb") + uuid("5f8b5485-fde5-4a42-8a13-8545fcf6d25b") + kind("StaticLib") + language("C") + defines({ + "_LIB", + }) + includedirs({"libusb/libusb/"}) + + files({ + "libusb/libusb/core.c", + "libusb/libusb/descriptor.c", + "libusb/libusb/hotplug.c", + "libusb/libusb/io.c", + "libusb/libusb/strerror.c", + "libusb/libusb/sync.c", + }) + + filter({"platforms:Windows"}) + includedirs({"libusb/msvc/"}) + files({ + "libusb/libusb/os/events_windows.c", + "libusb/libusb/os/events_windows.h", + "libusb/libusb/os/threads_windows.c", + "libusb/libusb/os/threads_windows.h", + "libusb/libusb/os/windows_common.c", + "libusb/libusb/os/windows_common.h", + "libusb/libusb/os/windows_usbdk.c", + "libusb/libusb/os/windows_usbdk.h", + "libusb/libusb/os/windows_winusb.c", + "libusb/libusb/os/windows_winusb.h" + }) + + filter({"platforms:Linux"}) + files({ + "libusb/libusb/config.h", + "libusb/libusb/os/events_posix.c", + "libusb/libusb/os/events_posix.h", + "libusb/libusb/os/threads_posix.c", + "libusb/libusb/os/threads_posix.h", + "libusb/libusb/os/linux_netlink.c", + "libusb/libusb/os/linux_udev.c", + "libusb/libusb/os/linux_usbfs.c", + "libusb/libusb/os/linux_usbfs.h" + })