File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 16
16
cd pgvector
17
17
make
18
18
sudo make install
19
- - run : zig run example.zig -I/usr/include/postgresql -lc -lpq
19
+ - run : zig build
20
+ - run : zig-out/bin/example
Original file line number Diff line number Diff line change 1
- /example
2
- * .o
1
+ /.zig-cache
2
+ / zig-out
Original file line number Diff line number Diff line change @@ -75,11 +75,12 @@ To get started with development:
75
75
git clone https://github.com/pgvector/pgvector-zig.git
76
76
cd pgvector-zig
77
77
createdb pgvector_zig_test
78
- zig run example.zig -lc -lpq
78
+ zig build
79
+ zig-out/bin/example
79
80
```
80
81
81
82
Specify the path to libpq if needed:
82
83
83
84
``` sh
84
- zig run example.zig -I/opt/homebrew/opt/libpq/include -L /opt/homebrew/opt/libpq/lib -lc -lpq
85
+ zig build --search-prefix /opt/homebrew/opt/libpq
85
86
```
Original file line number Diff line number Diff line change
1
+ const std = @import ("std" );
2
+
3
+ pub fn build (b : * std.Build ) void {
4
+ const exe = b .addExecutable (.{
5
+ .name = "example" ,
6
+ .root_source_file = b .path ("example.zig" ),
7
+ .target = b .graph .host ,
8
+ });
9
+
10
+ exe .linkSystemLibrary ("pq" );
11
+ exe .linkLibC ();
12
+
13
+ b .installArtifact (exe );
14
+ }
You can’t perform that action at this time.
0 commit comments