serenity: add more support
parent
f62b6b37f0
commit
972cbe2e9a
|
@ -88,8 +88,16 @@ see also `v help build`.
|
||||||
Change the target OS that V tries to compile for.
|
Change the target OS that V tries to compile for.
|
||||||
By default, the target OS is the host system.
|
By default, the target OS is the host system.
|
||||||
When OS is `cross`, V will attempt to output cross-platform C code.
|
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
|
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
|
with `_platform.c.v`, and usually only the matching files are used in
|
||||||
|
|
|
@ -21,8 +21,7 @@ const int_max = int(0x7FFFFFFF)
|
||||||
const (
|
const (
|
||||||
valid_comp_if_os = ['windows', 'ios', 'macos', 'mach', 'darwin', 'hpux', 'gnu',
|
valid_comp_if_os = ['windows', 'ios', 'macos', 'mach', 'darwin', 'hpux', 'gnu',
|
||||||
'qnx', 'linux', 'freebsd', 'openbsd', 'netbsd', 'bsd', 'dragonfly', 'android', 'solaris',
|
'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_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
|
||||||
valid_comp_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32']
|
valid_comp_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32']
|
||||||
valid_comp_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
valid_comp_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
||||||
|
|
|
@ -40,7 +40,9 @@ pub enum Platform {
|
||||||
js // for interoperability in prefs.OS
|
js // for interoperability in prefs.OS
|
||||||
android
|
android
|
||||||
solaris
|
solaris
|
||||||
|
serenity
|
||||||
haiku
|
haiku
|
||||||
|
raw
|
||||||
cross // TODO: add functionality for v doc -os cross whenever possible
|
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 }
|
'dragonfly' { return .dragonfly }
|
||||||
'js' { return .js }
|
'js' { return .js }
|
||||||
'solaris' { return .solaris }
|
'solaris' { return .solaris }
|
||||||
|
'serenity' { return .serenity }
|
||||||
'android' { return .android }
|
'android' { return .android }
|
||||||
'haiku' { return .haiku }
|
'haiku' { return .haiku }
|
||||||
'nix' { return .linux }
|
'nix' { return .linux }
|
||||||
|
|
|
@ -59,7 +59,7 @@ pub fn (o OS) str() string {
|
||||||
.js { return 'JavaScript' }
|
.js { return 'JavaScript' }
|
||||||
.android { return 'Android' }
|
.android { return 'Android' }
|
||||||
.solaris { return 'Solaris' }
|
.solaris { return 'Solaris' }
|
||||||
.serenity { return 'serenity' }
|
.serenity { return 'SerenityOS' }
|
||||||
.haiku { return 'Haiku' }
|
.haiku { return 'Haiku' }
|
||||||
.raw { return 'Raw' }
|
.raw { return 'Raw' }
|
||||||
.all { return 'all' }
|
.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') {
|
if prefs.os != .solaris && file.ends_with('_solaris.c.v') {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if prefs.os != .serenity && file.ends_with('_serenity.c.v') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue