mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
serenity: add more support
This commit is contained in:
parent
f62b6b37f0
commit
972cbe2e9a
@ -88,8 +88,16 @@ see also `v help build`.
|
||||
Change the target OS that V tries to compile for.
|
||||
By default, the target OS is the host system.
|
||||
When OS is `cross`, V will attempt to output cross-platform C code.
|
||||
List of OS supported by V: `linux`, `windows`, `ios`, `mac`, `freebsd`, `openbsd`,
|
||||
`netbsd`, `dragonfly`, `solaris`, `android` and `haiku`.
|
||||
|
||||
Here is a list of the operating systems, supported by V:
|
||||
(CI tests runs on every commit/PR for each of these):
|
||||
`windows`, `linux`, `macos`
|
||||
|
||||
The compiler is known to also work, and has support for these operating
|
||||
systems also (although we do not test it as regularly as for the above):
|
||||
`android`, `ios`,
|
||||
`freebsd`, `openbsd`, `netbsd`, `dragonfly`,
|
||||
`solaris`, `serenity`, `haiku`
|
||||
|
||||
Note that V has the concept of platform files, i.e. files ending
|
||||
with `_platform.c.v`, and usually only the matching files are used in
|
||||
|
@ -21,8 +21,7 @@ const int_max = int(0x7FFFFFFF)
|
||||
const (
|
||||
valid_comp_if_os = ['windows', 'ios', 'macos', 'mach', 'darwin', 'hpux', 'gnu',
|
||||
'qnx', 'linux', 'freebsd', 'openbsd', 'netbsd', 'bsd', 'dragonfly', 'android', 'solaris',
|
||||
'haiku',
|
||||
]
|
||||
'haiku', 'serenity']
|
||||
valid_comp_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
|
||||
valid_comp_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32']
|
||||
valid_comp_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
||||
|
@ -40,7 +40,9 @@ pub enum Platform {
|
||||
js // for interoperability in prefs.OS
|
||||
android
|
||||
solaris
|
||||
serenity
|
||||
haiku
|
||||
raw
|
||||
cross // TODO: add functionality for v doc -os cross whenever possible
|
||||
}
|
||||
|
||||
@ -58,6 +60,7 @@ pub fn platform_from_string(platform_str string) ?Platform {
|
||||
'dragonfly' { return .dragonfly }
|
||||
'js' { return .js }
|
||||
'solaris' { return .solaris }
|
||||
'serenity' { return .serenity }
|
||||
'android' { return .android }
|
||||
'haiku' { return .haiku }
|
||||
'nix' { return .linux }
|
||||
|
@ -59,7 +59,7 @@ pub fn (o OS) str() string {
|
||||
.js { return 'JavaScript' }
|
||||
.android { return 'Android' }
|
||||
.solaris { return 'Solaris' }
|
||||
.serenity { return 'serenity' }
|
||||
.serenity { return 'SerenityOS' }
|
||||
.haiku { return 'Haiku' }
|
||||
.raw { return 'Raw' }
|
||||
.all { return 'all' }
|
||||
|
@ -181,6 +181,9 @@ pub fn (prefs &Preferences) should_compile_c(file string) bool {
|
||||
if prefs.os != .solaris && file.ends_with('_solaris.c.v') {
|
||||
return false
|
||||
}
|
||||
if prefs.os != .serenity && file.ends_with('_serenity.c.v') {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user