Skip to content

Commit

Permalink
docs: use -cross instead of -os cross
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Oct 26, 2023
1 parent bdb8b30 commit 2806a8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vlib/v/checker/if.v
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/doc/doc.v
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions vlib/v/help/build/build-c.txt
Expand Up @@ -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`
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2806a8a

Please sign in to comment.