docs: use -cross instead of -os cross

This commit is contained in:
Delyan Angelov 2023-10-26 05:55:09 +03:00
parent bdb8b30e4d
commit 2806a8a9ec
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
3 changed files with 7 additions and 5 deletions

View file

@ -268,7 +268,7 @@ fn (mut c Checker) if_expr(mut node ast.IfExpr) ast.Type {
}
if c.fn_level == 0 && c.pref.output_cross_c {
// do not skip any of the branches for top level `$if OS {`
// statements, in `-os cross` mode
// statements, in `-cross` mode
found_branch = false
c.skip_flags = false
c.ct_cond_stack << branch.cond

View file

@ -46,7 +46,7 @@ pub enum Platform {
vinix
haiku
raw
cross // TODO: add functionality for v doc -os cross whenever possible
cross // TODO: add functionality for v doc -cross whenever possible
}
// copy of pref.os_from_string

View file

@ -109,11 +109,13 @@ see also `v help build`.
The module declaration should be `builtin`. The default Linux
implementation can be found in `vlib/builtin/linux_bare`.
-cross
With `-cross`, V will attempt to output cross-platform C code.
-os <os>, -target-os <os>
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.
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`
@ -142,7 +144,7 @@ see also `v help build`.
If you compile with `-os freebsd`, then x_default.c.v will be used.
If you compile with `-os linux`, then x_linux.c.v will be used.
If you compile with `-os windows`, then x_windows.c.v will be used.
If you compile with `-os cross`, then all, *except x_default.c.v*
If you compile with `-cross`, then all, *except x_default.c.v*
will be used, wrapped in conditional compilation guards, so that
the generated C source code will be larger, but will compile on all
explicitly supported platforms without source changes.