From dbbfb04e7c8235630cd338ff6ae0e27b3bcf8020 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 2 May 2020 19:01:43 +0300 Subject: [PATCH] docs: change obsolete -show_c_cmd to -showcc and -keepc --- doc/docs.md | 10 +++++++--- vlib/v/builder/cc.v | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index 2e1f567cef..5bab6bb9f7 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -1396,13 +1396,17 @@ Check out [socket.v for an example of calling C code from V](https://github.com/ To debug issues with the generated C code, you can pass these flags: - `-cg` - produces a less optimized executable with more debug information in it. -- `-keep_c` - keep the generated C file, so your debugger can also use it. -- `-show_c_cmd` - prints the C command that is used to build the program. +- `-keepc` - keep the generated C file, so your debugger can also use it. +- `-showcc` - prints the C command that is used to build the program. -For best debugging experience, you can pass all of them at the same time: `v -cg -keep_c -pretty_c -show_c_cmd yourprogram.v` , then just run your debugger (gdb/lldb) or IDE with the produced executable `yourprogram`. +For best debugging experience, you can pass all of them at the same time: `v -cg -keepc -showcc yourprogram.v` , then just run your debugger (gdb/lldb) or IDE with the produced executable `yourprogram`. If you just want to inspect the generated C code, without compiling it further, you can also use: `-o file.c`. This will make V produce the `file.c` then stop. +If you want to see the generated C source code for *just* a single C function, for example `main`, you can use: `-printfn main -o file.c` . + +To see a detailed list of all flags that V supports, use `v help`, `v help build`, `v help build-c` . + ## Compile time if ```v diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 9dc140badc..403b5e0609 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -550,7 +550,7 @@ fn (mut c Builder) cc_windows_cross() { /* if c.pref.build_mode != .build_module { link_cmd := 'lld-link $obj_name $winroot/lib/libcmt.lib ' + '$winroot/lib/libucrt.lib $winroot/lib/kernel32.lib $winroot/lib/libvcruntime.lib ' + '$winroot/lib/uuid.lib' - if c.pref.show_c_cmd { + if c.pref.show_cc { println(link_cmd) } if os.system(link_cmd) != 0 {