inital code drop.
This commit is contained in:
parent
fe934db383
commit
3f023baa2f
14 changed files with 571 additions and 2 deletions
28
build/external/premake_external.lua
vendored
Normal file
28
build/external/premake_external.lua
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
function download_progress(total, current)
|
||||
local ratio = current / total;
|
||||
ratio = math.min(math.max(ratio, 0), 1);
|
||||
local percent = math.floor(ratio * 100);
|
||||
print("Download progress (" .. percent .. "%/100%)")
|
||||
end
|
||||
|
||||
function check_raylib()
|
||||
os.chdir("external")
|
||||
if(os.isdir("raylib-master") == false) then
|
||||
if(not os.isfile("raylib-master.zip")) then
|
||||
print("Raylib not found, downloading from github")
|
||||
local result_str, response_code = http.download("https://github.com/raysan5/raylib/archive/refs/heads/master.zip", "raylib-master.zip", {
|
||||
progress = download_progress,
|
||||
headers = { "From: Premake", "Referer: Premake" }
|
||||
})
|
||||
end
|
||||
print("Unzipping to " .. os.getcwd())
|
||||
zip.extract("raylib-master.zip", os.getcwd())
|
||||
os.remove("raylib-master.zip")
|
||||
end
|
||||
os.chdir("../")
|
||||
end
|
||||
|
||||
function build_externals()
|
||||
print("calling externals")
|
||||
check_raylib()
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue