-
Notifications
You must be signed in to change notification settings - Fork 645
premake: add glibc detect and add dl back #2823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -258,6 +258,30 @@ if os.istarget("macosx") then | |
| end | ||
| end | ||
|
|
||
| function getGlibcVersion() | ||
| local output = os.outputof("getconf GNU_LIBC_VERSION") | ||
| local major, minor, patch = output:match("glibc (%d+)%.(%d+)%.?(%d*)") | ||
|
|
||
| if major and minor then | ||
| major = tonumber(major) | ||
| minor = tonumber(minor) | ||
| patch = tonumber(patch) or 0 | ||
| return (major << 16) | (minor << 8) | patch | ||
| end | ||
|
|
||
| return nil | ||
| end | ||
|
|
||
| GLIBC_VERSION=0 | ||
| if os.ishost("linux") then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. istarget?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if Linux generating other OSes, this function still works. |
||
| GLIBC_VERSION = getGlibcVersion() | ||
| if GLIBC_VERSION>0 then | ||
| print("Detected glibc version: " .. string.format("%d.%d.%d", GLIBC_VERSION >> 16, (GLIBC_VERSION >> 8) & 0xFF, GLIBC_VERSION & 0xFF)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not interested in detailed format, and this is for debugging only, just as the Rosetta thing. |
||
| else | ||
| print("Could not detect glibc version, assuming it is sufficient.") | ||
|
mercury233 marked this conversation as resolved.
Outdated
|
||
| end | ||
| end | ||
|
|
||
| workspace "YGOPro" | ||
| location "build" | ||
| language "C++" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.