From b6bd8f306be2ff63146c240fdbcde447e30d8b43 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 4 Feb 2026 21:00:20 +0900 Subject: [PATCH] Third-party: add Metal dependency submodules --- .gitmodules | 6 ++++++ premake5.lua | 2 ++ third_party/metal-cpp | 1 + third_party/metal-cpp.lua | 21 ++++++++++++++++++ third_party/metal-shader-converter | 1 + third_party/metal-shader-converter.lua | 30 ++++++++++++++++++++++++++ 6 files changed, 61 insertions(+) create mode 160000 third_party/metal-cpp create mode 100644 third_party/metal-cpp.lua create mode 160000 third_party/metal-shader-converter create mode 100644 third_party/metal-shader-converter.lua diff --git a/.gitmodules b/.gitmodules index b9c2abe71..b9dc2aa1b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -111,6 +111,12 @@ [submodule "third_party/DirectX-Headers"] path = third_party/DirectX-Headers url = https://github.com/microsoft/DirectX-Headers.git +[submodule "third_party/metal-cpp"] + path = third_party/metal-cpp + url = https://github.com/wmarti/metal-cpp.git +[submodule "third_party/metal-shader-converter"] + path = third_party/metal-shader-converter + url = https://github.com/wmarti/metal-shader-converter.git [submodule "third_party/asio"] path = third_party/asio url = https://github.com/chriskohlhoff/asio.git diff --git a/premake5.lua b/premake5.lua index 9223c387a..5272229ed 100644 --- a/premake5.lua +++ b/premake5.lua @@ -434,6 +434,8 @@ workspace("xenia") include("third_party/fmt.lua") include("third_party/glslang-spirv.lua") include("third_party/imgui.lua") + include("third_party/metal-shader-converter.lua") + include("third_party/metal-cpp.lua") include("third_party/miniaudio.lua") include("third_party/mspack.lua") include("third_party/snappy.lua") diff --git a/third_party/metal-cpp b/third_party/metal-cpp new file mode 160000 index 000000000..13a670136 --- /dev/null +++ b/third_party/metal-cpp @@ -0,0 +1 @@ +Subproject commit 13a670136712be815f7e386a470eafac7971d702 diff --git a/third_party/metal-cpp.lua b/third_party/metal-cpp.lua new file mode 100644 index 000000000..50bf89b2c --- /dev/null +++ b/third_party/metal-cpp.lua @@ -0,0 +1,21 @@ +if not os.istarget("macosx") then + return +end + +group("third_party") +project("metal-cpp") + uuid("11c84c8d-bfa2-4b14-b832-4e85e9ca8e3b") + kind("None") -- Header-only library + language("C++") + defines({ + "METAL_CPP_AVAILABLE=1", + }) + includedirs({ + "metal-cpp", + }) + files({ + "metal-cpp/Foundation/Foundation.hpp", + "metal-cpp/Metal/Metal.hpp", + "metal-cpp/MetalFX/MetalFX.hpp", + "metal-cpp/QuartzCore/QuartzCore.hpp", + }) diff --git a/third_party/metal-shader-converter b/third_party/metal-shader-converter new file mode 160000 index 000000000..eb320d8a6 --- /dev/null +++ b/third_party/metal-shader-converter @@ -0,0 +1 @@ +Subproject commit eb320d8a6d65fc15ef2c226da7a405f39cb0d697 diff --git a/third_party/metal-shader-converter.lua b/third_party/metal-shader-converter.lua new file mode 100644 index 000000000..d762e9015 --- /dev/null +++ b/third_party/metal-shader-converter.lua @@ -0,0 +1,30 @@ +if not os.istarget("macosx") then + return +end + +group("third_party") +project("metal-shader-converter") + uuid("b1b2c3d4-e5f6-7890-abcd-ef1234567890") + kind("StaticLib") + language("C++") + defines({ + "_LIB", + }) + includedirs({ + "metal-shader-converter/include", + }) + files({ + "metal-shader-converter/include/metal_irconverter.h", + "metal-shader-converter/include/metal_irconverter_runtime.h", + }) + -- Link against the Metal Shader Converter dynamic library + libdirs({ + "metal-shader-converter/lib", + }) + links({ + "metalirconverter", + }) + links({ + "Metal.framework", + "MetalKit.framework", + })