List lua version in toolchain configs

feature/quick-start-py
kaetemi 3 years ago
parent a1285106b3
commit 88631d8570
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -46,6 +46,9 @@ for ts in SortedToolsets:
toolchain["HasXAudio2"] = True
if vs["HasMFC"]:
toolchain["HasMFC"] = True
luaVersion = FindLuaVersion(toolchain["Prefix"])
if luaVersion:
toolchain["LuaVersion"] = luaVersion
if platform == "x64":
toolchain["OS"] = "Win64"
toolchain["VCVars"] = FindVCVars64(vs["Path"])

@ -125,4 +125,21 @@ def FindVSPrefixPaths(toolset, platform):
return FindPrefixPaths(os.path.join("C:\\", found[0]))
return []
def FindLuaVersion(prefixPaths):
for dir in prefixPaths:
luaHeader = os.path.join(dir, "include/lua.h")
if os.path.isfile(luaHeader):
fi = open(luaHeader)
line = fi.readline()
while line:
if "LUA_VERSION_NUM" in line:
fi.close()
line = line.strip()
syms = line.split()
vers = syms[len(syms) - 1]
return int(vers)
line = fi.readline()
fi.close()
return
# end of file

Loading…
Cancel
Save