diff options
| author | 2022-08-29 09:30:54 +0600 | |
|---|---|---|
| committer | 2022-08-29 23:08:04 +0200 | |
| commit | d53ab5848eba22d6dcaa60aeeedc54344c4219b8 (patch) | |
| tree | c2a873ff630a998d5a62b49ab7293e398727e2a4 | |
| parent | Fix error formatting in readme for the newest zig 3685+dae7aeb33 (diff) | |
| download | zig-sqlite-d53ab5848eba22d6dcaa60aeeedc54344c4219b8.tar.gz zig-sqlite-d53ab5848eba22d6dcaa60aeeedc54344c4219b8.tar.xz zig-sqlite-d53ab5848eba22d6dcaa60aeeedc54344c4219b8.zip | |
Remove unnecessary linkLibC() when static linking
Diffstat (limited to '')
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | build.zig | 3 |
2 files changed, 1 insertions, 3 deletions
| @@ -124,7 +124,6 @@ If you need to define custom [compile-time options](https://www.sqlite.org/compi | |||
| 124 | Now it's just a matter of linking your `build.zig` target(s) to this library instead of the system one: | 124 | Now it's just a matter of linking your `build.zig` target(s) to this library instead of the system one: |
| 125 | 125 | ||
| 126 | ```zig | 126 | ```zig |
| 127 | exe.linkLibC(); | ||
| 128 | exe.linkLibrary(sqlite); | 127 | exe.linkLibrary(sqlite); |
| 129 | exe.addPackagePath("sqlite", "third_party/zig-sqlite/sqlite.zig"); | 128 | exe.addPackagePath("sqlite", "third_party/zig-sqlite/sqlite.zig"); |
| 130 | exe.addIncludeDir("third_party/zig-sqlite/c"); | 129 | exe.addIncludeDir("third_party/zig-sqlite/c"); |
| @@ -4,11 +4,10 @@ const builtin = @import("builtin"); | |||
| 4 | var sqlite3: ?*std.build.LibExeObjStep = null; | 4 | var sqlite3: ?*std.build.LibExeObjStep = null; |
| 5 | 5 | ||
| 6 | fn linkSqlite(b: *std.build.LibExeObjStep) void { | 6 | fn linkSqlite(b: *std.build.LibExeObjStep) void { |
| 7 | b.linkLibC(); | ||
| 8 | |||
| 9 | if (sqlite3) |lib| { | 7 | if (sqlite3) |lib| { |
| 10 | b.linkLibrary(lib); | 8 | b.linkLibrary(lib); |
| 11 | } else { | 9 | } else { |
| 10 | b.linkLibC(); | ||
| 12 | b.linkSystemLibrary("sqlite3"); | 11 | b.linkSystemLibrary("sqlite3"); |
| 13 | } | 12 | } |
| 14 | } | 13 | } |