diff options
Diffstat (limited to 'functions.cmake')
-rw-r--r-- | functions.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/functions.cmake b/functions.cmake index bdecc2f5124..0152554669a 100644 --- a/functions.cmake +++ b/functions.cmake @@ -702,7 +702,15 @@ function(vespa_detect_build_platform) file(STRINGS /etc/os-release OS_DISTRO REGEX "^ID=") string(REGEX REPLACE "ID=\"?([^\"]+)\"?" "\\1" OS_DISTRO ${OS_DISTRO}) file(STRINGS /etc/os-release OS_DISTRO_VERSION REGEX "^VERSION_ID=") - string(REGEX REPLACE "VERSION_ID=\"?([^\"]+)\"?" "\\1" OS_DISTRO_VERSION ${OS_DISTRO_VERSION}) + if(OS_DISTRO_VERSION) + string(REGEX REPLACE "VERSION_ID=\"?([^\"]+)\"?" "\\1" OS_DISTRO_VERSION ${OS_DISTRO_VERSION}) + else() + if (OS_DISTRO STREQUAL "debian") + set(OS_DISTRO_VERSION "sid") + else() + message(FATAL_ERROR "-- Could not determine ${OS_DISTRO} version") + endif() + endif() elseif(EXISTS /etc/redhat-release) set(OS_DISTRO "rhel") file(STRINGS "/etc/redhat-release" OS_DISTRO_VERSION) |