Skip to content

Commit 28d65b5

Browse files
committed
doc: add examples of using #flag /path/to/ffi.a@START_LIBS
1 parent 241dfe3 commit 28d65b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/docs.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7955,6 +7955,17 @@ Add `#flag` directives to the top of your V files to provide C compilation flags
79557955
- `-L` for adding C library files search paths
79567956
- `-D` for setting compile time variables
79577957
7958+
You can also use `#flag` directives, to link to static C libraries, which
7959+
will be added last (note the .a suffix):
7960+
```v oksyntax
7961+
#flag /path/to/ffi.a
7962+
```
7963+
If you need to reverse the order (prepend the static library in the libs section of the
7964+
C compilation line, before other libs), use:
7965+
```v oksyntax
7966+
#flag /path/to/ffi.a@START_LIBS
7967+
```
7968+
79587969
You can (optionally) use different flags for different targets.
79597970
Currently the `linux`, `darwin` , `freebsd`, and `windows` flags are supported.
79607971

0 commit comments

Comments
 (0)