mirror of
https://github.com/vlang/v.git
synced 2025-09-13 09:25:45 -04:00
os: detect termux more reliably
This commit is contained in:
parent
b6b611aa82
commit
69d292e8d1
@ -317,9 +317,6 @@ pub fn get_raw_lines_joined() string {
|
|||||||
// user_os returns current user operating system name.
|
// user_os returns current user operating system name.
|
||||||
pub fn user_os() string {
|
pub fn user_os() string {
|
||||||
$if linux {
|
$if linux {
|
||||||
if getenv('TERMUX_VERSION') != '' {
|
|
||||||
return 'termux'
|
|
||||||
}
|
|
||||||
return 'linux'
|
return 'linux'
|
||||||
}
|
}
|
||||||
$if macos {
|
$if macos {
|
||||||
@ -358,6 +355,9 @@ pub fn user_os() string {
|
|||||||
$if vinix {
|
$if vinix {
|
||||||
return 'vinix'
|
return 'vinix'
|
||||||
}
|
}
|
||||||
|
if getenv('TERMUX_VERSION') != '' {
|
||||||
|
return 'termux'
|
||||||
|
}
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ pub fn (mut t Table) parse_cflag(cflg string, mod string, ctimedefines []string)
|
|||||||
}
|
}
|
||||||
mut fos := ''
|
mut fos := ''
|
||||||
mut allowed_os_overrides := ['linux', 'darwin', 'freebsd', 'openbsd', 'windows', 'mingw',
|
mut allowed_os_overrides := ['linux', 'darwin', 'freebsd', 'openbsd', 'windows', 'mingw',
|
||||||
'solaris']
|
'solaris', 'android', 'termux']
|
||||||
allowed_os_overrides << ctimedefines
|
allowed_os_overrides << ctimedefines
|
||||||
for os_override in allowed_os_overrides {
|
for os_override in allowed_os_overrides {
|
||||||
if !flag.starts_with(os_override) {
|
if !flag.starts_with(os_override) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user