Skip to content

Commit e671e2b

Browse files
Fix Jammy (and Windows) builds
1 parent e32145b commit e671e2b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ find_package(pybind11 CONFIG REQUIRED)
66
find_package(Boost CONFIG REQUIRED)
77

88
set(_USE_MT_RNG OFF)
9-
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
10-
if (CMAKE_SYSTEM_VERSION MATCHES "22\\.04")
9+
# Check if the system is Ubuntu
10+
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
11+
execute_process(
12+
COMMAND lsb_release -a
13+
OUTPUT_VARIABLE LSB_RELEASE_OUTPUT
14+
)
15+
16+
# Extract the version number
17+
string(REGEX MATCH "Release:[ \t]+([0-9.]+)"
18+
UBUNTU_VERSION "${LSB_RELEASE_OUTPUT}")
19+
set(UBUNTU_VERSION "${CMAKE_MATCH_1}")
20+
21+
message(STATUS "Ubuntu version: ${UBUNTU_VERSION}")
22+
23+
if ("${UBUNTU_VERSION}" STREQUAL "22.04")
1124
set(_USE_MT_RNG ON)
12-
endif()
25+
endif ("${UBUNTU_VERSION}" STREQUAL "22.04")
1326
endif()
1427

1528
option (USE_MT_RNG "Use mt19937 random number generator instead of taus88" _USE_MT_RNG)

0 commit comments

Comments
 (0)