Commit 0522a080 authored by nanahira's avatar nanahira

premake: add glibc detect and add dl back

parent 2cfeac47
......@@ -109,3 +109,6 @@ project "YGOPro"
links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH }
end
if GLIBC_VERSION < 546 then -- glibc less than 2.34
links { "dl", "pthread" }
end
......@@ -258,6 +258,27 @@ if os.istarget("macosx") then
end
end
function getGlibcVersion()
local output = os.outputof("getconf GNU_LIBC_VERSION")
local major, minor = output:match("glibc (%d+)%.(%d+)")
if major and minor then
major = tonumber(major)
minor = tonumber(minor)
return (major << 8) | minor
end
return 0
end
GLIBC_VERSION=0
if os.ishost("linux") then
GLIBC_VERSION = getGlibcVersion()
if GLIBC_VERSION>0 then
print("Detected glibc version: " .. string.format("%d.%d", GLIBC_VERSION >> 8, GLIBC_VERSION & 0xFF))
else
print("Could not detect glibc version, assuming it is sufficient.")
end
end
workspace "YGOPro"
location "build"
language "C++"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment