mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2025-08-30 13:23:13 +00:00
add mysql + update build
This commit is contained in:
52
deps/premake/mysql.lua
vendored
Normal file
52
deps/premake/mysql.lua
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
if (os.host() ~= "windows") then
|
||||
error("automatic mysql installation is not supported on your os")
|
||||
end
|
||||
|
||||
mysql = {
|
||||
source = path.join(dependencies.basePath, "mysql"),
|
||||
version = "5.7.43",
|
||||
download = "https://cdn.alicent.cat/mysql-5.7.43-win32.zip",
|
||||
}
|
||||
|
||||
function mysql.install()
|
||||
local hfile = io.open(string.format("%s/include/mysql.h", mysql.source), "r")
|
||||
if (hfile) then
|
||||
return
|
||||
end
|
||||
|
||||
os.execute(string.format("mkdir \"%s\" 2> nul", mysql.source))
|
||||
|
||||
local folder = path.join(mysql.source, "mysql-5.7.43-win32")
|
||||
local archive = path.join(mysql.source, "mysql-5.7.43-win32.zip")
|
||||
|
||||
print("Downloading MYSQL")
|
||||
os.execute(string.format("curl \"%s\" -L -o \"%s\"", mysql.download, archive))
|
||||
|
||||
os.execute(string.format("powershell -command \"Expand-Archive -Force \\\"%s\\\" \\\"%s\\\"\"", archive, mysql.source))
|
||||
os.execute(string.format("powershell -command \"mv \\\"%s/*\\\" \\\"%s\\\"\"", folder, mysql.source))
|
||||
os.execute(string.format("powershell -command \"rm \\\"%s\\\"\"", archive))
|
||||
os.execute(string.format("rmdir \"%s\"", folder))
|
||||
end
|
||||
|
||||
function mysql.import()
|
||||
mysql.install()
|
||||
mysql.includes()
|
||||
end
|
||||
|
||||
function mysql.includes()
|
||||
includedirs {
|
||||
path.join(mysql.source, "include"),
|
||||
}
|
||||
end
|
||||
|
||||
function mysql.project()
|
||||
project "mysql"
|
||||
language "C"
|
||||
|
||||
mysql.includes()
|
||||
|
||||
warnings "Off"
|
||||
kind "StaticLib"
|
||||
end
|
||||
|
||||
table.insert(dependencies, mysql)
|
Reference in New Issue
Block a user