From 2806a8a9ecd7e8d507c3dc417adbfcbbbee1386a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 26 Oct 2023 05:55:09 +0300 Subject: [PATCH] docs: use `-cross` instead of `-os cross` --- vlib/v/checker/if.v | 2 +- vlib/v/doc/doc.v | 2 +- vlib/v/help/build/build-c.txt | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/vlib/v/checker/if.v b/vlib/v/checker/if.v index 0ffe763ba3..ec412f7ca3 100644 --- a/vlib/v/checker/if.v +++ b/vlib/v/checker/if.v @@ -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 diff --git a/vlib/v/doc/doc.v b/vlib/v/doc/doc.v index c458b85828..1185c20409 100644 --- a/vlib/v/doc/doc.v +++ b/vlib/v/doc/doc.v @@ -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 diff --git a/vlib/v/help/build/build-c.txt b/vlib/v/help/build/build-c.txt index 257420afcd..123041ca6b 100644 --- a/vlib/v/help/build/build-c.txt +++ b/vlib/v/help/build/build-c.txt @@ -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 , -target-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.