mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: change obsolete -show_c_cmd to -showcc and -keepc
This commit is contained in:
parent
02807aab43
commit
dbbfb04e7c
10
doc/docs.md
10
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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user