2025-06-20 15:10:02 +10:00
parent 912d5cb768
commit 62b1e79ec5
15 changed files with 522 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
local function download_requirements()
-- Git module is not yet implemented, so delegate to the command-line
local argv = {
{"clone https://github.com/glfw/glfw.git thirdparty/glfw"}
}
local ec, stdout, stderr = platform.exec_parallel("git", 1, argv)
for i,ec in pairs(ec) do
if (ec ~= 0) then
print("Command ".. tostring(i) .." git " .. table.concat(argv[i], " ") .. "\" failed with exit code " .. tostring(ec) .. " and output;")
print(stderr[i])
print()
print(stdout[i])
print()
end
end
end
local function build_glfw3(...)
fs.create_dir("thirdparty/glfw/bin")
local err, stdout, stderr = platform.exec("cmake", {
"-S", "thirdparty/glfw",
"-B", "thirdparty/glfw/bin",
"-D BUILD_SHARED_LIBS=ON",
"-D GLFW_LIBRARY_TYPE=STATIC",
"-D GLFW_BUILD_TESTS=OFF",
"-D GLFW_BUILD_DOCS=OFF",
--"-D USE_MSVC_RUNTIME_LIBRARY_DLL=ON",
...
})
platform.exec("cmake", {"--build thirdparty/glfw/bin"})
if err ~= 0 then print(stdout); print(); print(stderr); print(); end
end
download_requirements()
build_glfw3(...)