forked from LuaJIT/LuaJIT
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since Alpine uses musl [1] as its C standard library, the build for it failed after the commit af0f59d ("test: fix LuaJIT-tests for old libc version"), since `GetLibCVersion()` raises an error. This patch adds the check of the ID in the /etc/os-release [2] of the Linux distribution and avoids setting the GLibC version if the distro is "alpine". [1]: https://wiki.alpinelinux.org/wiki/Musl [2]: https://www.linux.org/docs/man5/os-release.html
- Loading branch information
Showing
3 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Determine the Linux distro id and return it in the `output` | ||
# variable. See https://www.linux.org/docs/man5/os-release.html | ||
# for details. | ||
macro(GetLinuxDistro output) | ||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
message(FATAL_ERROR "GetLinuxDistro macro must be used only on Linux") | ||
endif() | ||
file(READ /etc/os-release OS_RELEASE) | ||
string(REGEX MATCH "ID=([0-9a-z._-]+)" MATCH ${OS_RELEASE}) | ||
if(MATCH) | ||
set(${output} ${CMAKE_MATCH_1}) | ||
else() | ||
set(${output} linux) | ||
endif() | ||
unset(OS_RELEASE) | ||
unset(MATCH) | ||
unset(CMAKE_MATCH_1) | ||
endmacro() |