Files
basalt/buildscripts/configure.lua

37 lines
1.1 KiB
Lua

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"},
{"clone https://github.com/g-truc/glm.git thirdparty/glm"}
}
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(...)