diff options
| author | 2024-04-14 18:27:26 +0200 | |
|---|---|---|
| committer | 2024-04-14 18:27:26 +0200 | |
| commit | a16c3fe76e70099d5de06e8355eabd8b2cfccee0 (patch) | |
| tree | 3e9d04c54912a66e7c1d119e893a7f778f082066 /build.zig | |
| parent | Merge pull request #154 from JacobCrabill/dev/zig-0.12-modules (diff) | |
| parent | build: use the already defined sqlite module (diff) | |
| download | zig-sqlite-a16c3fe76e70099d5de06e8355eabd8b2cfccee0.tar.gz zig-sqlite-a16c3fe76e70099d5de06e8355eabd8b2cfccee0.tar.xz zig-sqlite-a16c3fe76e70099d5de06e8355eabd8b2cfccee0.zip | |
Merge pull request #157 from vrischmann/update-latest-zig
fix for latest zig
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 19 |
1 files changed, 5 insertions, 14 deletions
| @@ -279,7 +279,7 @@ pub fn build(b: *std.Build) !void { | |||
| 279 | .flags = &[_][]const u8{"-std=c99"}, | 279 | .flags = &[_][]const u8{"-std=c99"}, |
| 280 | }); | 280 | }); |
| 281 | sqlite_lib.linkLibC(); | 281 | sqlite_lib.linkLibC(); |
| 282 | sqlite_lib.installHeader("c/sqlite3.h", "sqlite3.h"); | 282 | sqlite_lib.installHeader(.{ .path = "c/sqlite3.h" }, "sqlite3.h"); |
| 283 | 283 | ||
| 284 | b.installArtifact(sqlite_lib); | 284 | b.installArtifact(sqlite_lib); |
| 285 | 285 | ||
| @@ -399,9 +399,7 @@ pub fn build(b: *std.Build) !void { | |||
| 399 | fuzz_lib.linkLibrary(lib); | 399 | fuzz_lib.linkLibrary(lib); |
| 400 | fuzz_lib.want_lto = true; | 400 | fuzz_lib.want_lto = true; |
| 401 | fuzz_lib.bundle_compiler_rt = true; | 401 | fuzz_lib.bundle_compiler_rt = true; |
| 402 | fuzz_lib.root_module.addImport("sqlite", b.createModule(.{ | 402 | fuzz_lib.root_module.addImport("sqlite", sqlite_mod); |
| 403 | .root_source_file = .{ .path = "sqlite.zig" }, | ||
| 404 | })); | ||
| 405 | 403 | ||
| 406 | // Setup the output name | 404 | // Setup the output name |
| 407 | const fuzz_executable_name = "fuzz"; | 405 | const fuzz_executable_name = "fuzz"; |
| @@ -430,9 +428,7 @@ pub fn build(b: *std.Build) !void { | |||
| 430 | }); | 428 | }); |
| 431 | fuzz_debug_exe.addIncludePath(.{ .path = "c" }); | 429 | fuzz_debug_exe.addIncludePath(.{ .path = "c" }); |
| 432 | fuzz_debug_exe.linkLibrary(lib); | 430 | fuzz_debug_exe.linkLibrary(lib); |
| 433 | fuzz_debug_exe.root_module.addImport("sqlite", b.createModule(.{ | 431 | fuzz_debug_exe.root_module.addImport("sqlite", sqlite_mod); |
| 434 | .root_source_file = .{ .path = "sqlite.zig" }, | ||
| 435 | })); | ||
| 436 | 432 | ||
| 437 | // Only install fuzz-debug when the fuzz step is run | 433 | // Only install fuzz-debug when the fuzz step is run |
| 438 | const install_fuzz_debug_exe = b.addInstallArtifact(fuzz_debug_exe, .{}); | 434 | const install_fuzz_debug_exe = b.addInstallArtifact(fuzz_debug_exe, .{}); |
| @@ -453,11 +449,8 @@ pub fn build(b: *std.Build) !void { | |||
| 453 | .target = getTarget(target, true), | 449 | .target = getTarget(target, true), |
| 454 | .optimize = optimize, | 450 | .optimize = optimize, |
| 455 | }); | 451 | }); |
| 456 | zigcrypto_loadable_ext.pie = true; | ||
| 457 | zigcrypto_loadable_ext.addIncludePath(.{ .path = "c" }); | 452 | zigcrypto_loadable_ext.addIncludePath(.{ .path = "c" }); |
| 458 | zigcrypto_loadable_ext.root_module.addImport("sqlite", b.createModule(.{ | 453 | zigcrypto_loadable_ext.root_module.addImport("sqlite", sqlite_mod); |
| 459 | .root_source_file = .{ .path = "sqlite.zig" }, | ||
| 460 | })); | ||
| 461 | zigcrypto_loadable_ext.linkLibrary(lib); | 454 | zigcrypto_loadable_ext.linkLibrary(lib); |
| 462 | 455 | ||
| 463 | const install_zigcrypto_loadable_ext = b.addInstallArtifact(zigcrypto_loadable_ext, .{}); | 456 | const install_zigcrypto_loadable_ext = b.addInstallArtifact(zigcrypto_loadable_ext, .{}); |
| @@ -469,9 +462,7 @@ pub fn build(b: *std.Build) !void { | |||
| 469 | .optimize = optimize, | 462 | .optimize = optimize, |
| 470 | }); | 463 | }); |
| 471 | zigcrypto_test.addIncludePath(.{ .path = "c" }); | 464 | zigcrypto_test.addIncludePath(.{ .path = "c" }); |
| 472 | zigcrypto_test.root_module.addImport("sqlite", b.createModule(.{ | 465 | zigcrypto_test.root_module.addImport("sqlite", sqlite_mod); |
| 473 | .root_source_file = .{ .path = "sqlite.zig" }, | ||
| 474 | })); | ||
| 475 | zigcrypto_test.linkLibrary(lib); | 466 | zigcrypto_test.linkLibrary(lib); |
| 476 | 467 | ||
| 477 | const install_zigcrypto_test = b.addInstallArtifact(zigcrypto_test, .{}); | 468 | const install_zigcrypto_test = b.addInstallArtifact(zigcrypto_test, .{}); |