File tree 3 files changed +35
-7
lines changed
3 files changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ separate_arguments(LUAJIT_TEST_COMMAND)
74
74
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
75
75
include (AddTestLib)
76
76
include (GetLibCVersion)
77
+ include (GetLinuxDistro)
77
78
include (LibRealPath)
78
79
79
80
# CTEST_FLAGS is used by CMake targets in test suites.
Original file line number Diff line number Diff line change @@ -62,13 +62,17 @@ if(CMAKE_C_FLAGS MATCHES "-march=skylake-avx512")
62
62
list (APPEND LUAJIT_TEST_TAGS_EXTRA +avx512)
63
63
endif ()
64
64
65
- if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
66
- GetLibCVersion(LIBC_VERSION)
67
- # XXX: <tonumber_scan.lua> uses `strtod()`, old versions of
68
- # which have the bug [1] for "0x1p-2075" parsing. Add the skip
69
- # check for it.
70
- # [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16151
71
- list (APPEND LUAJIT_TEST_TAGS_EXTRA +libc=${LIBC_VERSION} )
65
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
66
+ GetLinuxDistro(LINUX_DISTRO)
67
+ # Alpine uses musl instead of glibc.
68
+ if (NOT LINUX_DISTRO MATCHES "alpine" )
69
+ GetLibCVersion(LIBC_VERSION)
70
+ # XXX: <tonumber_scan.lua> uses `strtod()`, old versions of
71
+ # which have the bug [1] for "0x1p-2075" parsing. Add the skip
72
+ # check for it.
73
+ # [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16151
74
+ list (APPEND LUAJIT_TEST_TAGS_EXTRA +libc=${LIBC_VERSION} )
75
+ endif ()
72
76
endif ()
73
77
74
78
if (LUAJIT_ENABLE_TABLE_BUMP)
Original file line number Diff line number Diff line change
1
+ # Determine the Linux distro id and return it in the `output`
2
+ # variable. See https://www.linux.org/docs/man5/os-release.html
3
+ # for details.
4
+ macro (GetLinuxDistro output )
5
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" )
6
+ message (FATAL_ERROR "GetLinuxDistro macro must be used only on Linux" )
7
+ endif ()
8
+ set (OS_RELEASE_FILE /etc/os-release)
9
+ if (NOT EXISTS ${OS_RELEASE_FILE} )
10
+ set (OS_RELEASE_FILE /usr/lib/os-release)
11
+ endif ()
12
+ file (READ ${OS_RELEASE_FILE} OS_RELEASE)
13
+ string (REGEX MATCH "ID=([0-9a-z._-]+)" MATCH ${OS_RELEASE} )
14
+ if (MATCH)
15
+ set (${output} ${CMAKE_MATCH_1} )
16
+ else ()
17
+ set (${output} linux)
18
+ endif ()
19
+ unset (OS_RELEASE_FILE)
20
+ unset (OS_RELEASE)
21
+ unset (MATCH)
22
+ unset (CMAKE_MATCH_1)
23
+ endmacro ()
You can’t perform that action at this time.
0 commit comments