v help: describe CFLAGS and LDFLAGS support in `v help build-c`

pull/9845/head
Delyan Angelov 2021-04-22 18:12:28 +03:00
parent b951d679ca
commit ba512a6a8e
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 7 additions and 1 deletions

View File

@ -16,7 +16,13 @@ see also `v help build`.
Pass the provided flag as is to the C compiler. Pass the provided flag as is to the C compiler.
Can be specified multiple times to provide multiple flags. Can be specified multiple times to provide multiple flags.
Use quotes to wrap the flag argument if it contains spaces. Use quotes to wrap the flag argument if it contains spaces.
V also supports the environment variables CFLAGS and LDFLAGS.
The contents of the CFLAGS variable will be prepended as is, at the start
of the C backend command, right after the name of the compiler.
The contents of the LDFLAGS variable will be appended as is, at the end
of the C backend command, after all other options.
-cstrict -cstrict
Turn on additional C warnings. This slows down compilation Turn on additional C warnings. This slows down compilation
slightly (~10-10% for gcc), but sometimes provides better diagnosis. slightly (~10-10% for gcc), but sometimes provides better diagnosis.